Keiko Posted April 23, 2005 Share Posted April 23, 2005 Hello, What I am trying to do is put two scripts together, these are the scripts that im using: Script #1: void main() { AddAvailableNPCByObject(NPC_Owen_Star,GetObjectByTag("G0T0")); AddPartyMember(NPC_Owen_star,GetObjectByTag("G0T0")); } Script # 2: void main() { int iDelay = GetScriptParameter(1); string sTag = GetScriptStringParameter(); // Make it so the object can be destroyed, in case it was set to not be destroyable AssignCommand(GetObjectByTag( sTag ), SetIsDestroyable(TRUE,TRUE,TRUE)); DelayCommand( IntToFloat( 1.0 ),DestroyObject( GetObjectByTag( G0T0 ) ) ); } I have a feeling that I need to hook these scripts together using some kind of link, but I dont know what to do, im a scripting N00b, so thanks for you help! -Smallz Link to comment Share on other sites More sharing options...
stoffe Posted April 23, 2005 Share Posted April 23, 2005 Originally posted by DarthSmallz What I am trying to do is put two scripts together, these are the scripts that im using: (snip) What are you trying to do? As far as I can see those two scripts do fairly different things. I'll assume what you want is to get rid of G0T0 and spawn another custom party member in its place. If that's the case, this would probably work: #include "k_inc_glob_party" void ST_RemoveOldPartyNPC(int nSlot) { int nIdx = 0; object oNPC = GetObjectByTag(GetNPCTag(nSlot), nIdx); while (GetIsObjectValid(oNPC)) { if (IsObjectPartyMember(oNPC)) { AssignCommand(oNPC, SetIsDestroyable(TRUE)); DelayCommand(0.1, AssignCommand(oNPC, DestroyObject(OBJECT_SELF))); break; } oNPC = GetObjectByTag(GetNPCTag(nSlot), ++nIdx); } RemovePartyMember(nSlot); RemoveAvailableNPC(nSlot); } void ST_AddNewPartyNPC(int nSlot, string sTag) { object oNew = GetObjectByTag(sTag); if (GetIsObjectValid(oNew)) { AddAvailableNPCByObject(nSlot, oNew); AddPartyMember(nSlot, oNew); } } void main() { int nNPC = GetScriptParameter(1); string sTag = GetScriptStringParameter(); if (IsAvailableCreature(nNPC)) { ST_RemoveOldPartyNPC(nNPC); } DelayCommand(0.5, ST_AddNewPartyNPC(nNPC, sTag)); } From your script above I assumed the script was intended to be used from a dialog. Attach it to a dialog node, set the first parameter (P1 in DLGEditor) to the slot of the NPC to replace, in this case "3" (which is the value of NPC_G0T0). Then set the StringParam to the tag of the creature to join in that slot instead, in this case "g0t0". That script should remove the standard creature who occupies G0T0s party slot, delete that creature from the game and then add the first new creature with the specified tag to that party slot instead. (Disclaimer: Since I just wrote that script it is entirely untested. It should work, but scripting without testing often tends to be a recipe for trouble even if it compiles... ) Link to comment Share on other sites More sharing options...
Keiko Posted April 23, 2005 Author Share Posted April 23, 2005 Thanks Bro! I'll tell you if it works Link to comment Share on other sites More sharing options...
Achilles Posted April 24, 2005 Share Posted April 24, 2005 Sorry for going off topic here. Darthsmallz, Since the forum rules prohibit the posting of personal email addresses, you might want to consider removing yours from your signature. Link to comment Share on other sites More sharing options...
Keiko Posted April 24, 2005 Author Share Posted April 24, 2005 @stoffe, where is the P1? Link to comment Share on other sites More sharing options...
stoffe Posted April 24, 2005 Share Posted April 24, 2005 Originally posted by DarthSmallz @stoffe, where is the P1? Uh? In the DLG Editor? Like here... The field is called ActionParam1 if you use the GFF Editor instead of the DLG Editor... Link to comment Share on other sites More sharing options...
Keiko Posted April 24, 2005 Author Share Posted April 24, 2005 Thanks Bro! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.