void main(string sNPC)
{
string sRosterName = GetRosterNameFromObject(GetObjectByTag(sNPC));
ActionMoveToObject(GetObjectByTag(sNPC),FALSE);
DelayCommand(3.0, DespawnRosterMember(sNPC));
}
The above script will not compile. I get the message: declaration does not match parameters. It compiles okay without the delay command and works (exept the despawn happens before any movement) but not with. What am I doing wrong ???
PJ
Delay command question
Débuté par
PJ156
, nov. 20 2011 03:05
#1
Posté 20 novembre 2011 - 03:05
#2
Posté 20 novembre 2011 - 03:37
I copied that code into a new script and it compiled. I am using Skywing's advanced script compiler plugin (http://nwvault.ign.c...ns.Detail&id=99) , but that shouldn't make any difference.
#3
Posté 20 novembre 2011 - 03:42
Thanks for the quick reply Kamal,
I wonder why that is. Perhaps I should try doing the same.
PJ
I wonder why that is. Perhaps I should try doing the same.
PJ
Modifié par PJ156, 20 novembre 2011 - 03:42 .
#4
Posté 20 novembre 2011 - 05:44
Certain function will not work with DelayCommand(). There is a work around though. Try this:
void Despawn(string sNPC);
void main(string sNPC)
{
string sRosterName = GetRosterNameFromObject(GetObjectByTag(sNPC));
ActionMoveToObject(GetObjectByTag(sNPC),FALSE);
DelayCommand(3.0, Despawn(sNPC));
}
void Despawn(string sNPC)
{
DespawnRosterMember(sNPC);
}
void Despawn(string sNPC);
void main(string sNPC)
{
string sRosterName = GetRosterNameFromObject(GetObjectByTag(sNPC));
ActionMoveToObject(GetObjectByTag(sNPC),FALSE);
DelayCommand(3.0, Despawn(sNPC));
}
void Despawn(string sNPC)
{
DespawnRosterMember(sNPC);
}
#5
Posté 20 novembre 2011 - 05:47
...as an afterthought, is there a reason you arent' using the standard ga function that despawns the roster member? Is it because you need the delay?
#6
Posté 20 novembre 2011 - 07:27
Thanks for the reply M.R.
The standard GA despawns the character, what I wanted to do was remove from the roster and spawn at a waypoint (which works fine) then have the character leave the area. I tried force exit but that does not work on a roster memeber so I thought to despawn. I did want the npc to walk off with his companions hence the walk to waypoint and then despawn but it was not to be.
I could perhaps add the npc as a henchman instead but there is a reason for not doind that. I need the player to be able to equip him tactically.
I will try recompiling my original one and your script then If that fails I will go with the guy just despawning and not walking first. this is taking up a disproportionate amount of time.
PJ
The standard GA despawns the character, what I wanted to do was remove from the roster and spawn at a waypoint (which works fine) then have the character leave the area. I tried force exit but that does not work on a roster memeber so I thought to despawn. I did want the npc to walk off with his companions hence the walk to waypoint and then despawn but it was not to be.
I could perhaps add the npc as a henchman instead but there is a reason for not doind that. I need the player to be able to equip him tactically.
I will try recompiling my original one and your script then If that fails I will go with the guy just despawning and not walking first. this is taking up a disproportionate amount of time.
PJ
#7
Posté 20 novembre 2011 - 08:17
Do you want to remove from the roster or the party. I think there may be different scripts for that, not 100% sure though.
#8
Posté 20 novembre 2011 - 11:03
From the party is all, though I think if I took him from the roster I could use force exit?
iirc when i use ga_roster_remove the npc despawns as well which is what i wanted to avoid.
PJ
iirc when i use ga_roster_remove the npc despawns as well which is what i wanted to avoid.
PJ
#9
Posté 20 novembre 2011 - 11:17
Try ga_roster_party_remove. According to the description it does not despawn the character. I actually think there may be the option to despawn or not.





Retour en haut







