Aller au contenu

Photo

Delay command question


  • Veuillez vous connecter pour répondre
8 réponses à ce sujet

#1
PJ156

PJ156
  • Members
  • 2 983 messages
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

#2
kamal_

kamal_
  • Members
  • 5 250 messages
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
PJ156

PJ156
  • Members
  • 2 983 messages
Thanks for the quick reply Kamal,

I wonder why that is. Perhaps I should try doing the same.

PJ

Modifié par PJ156, 20 novembre 2011 - 03:42 .


#4
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
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);
}

#5
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
...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
PJ156

PJ156
  • Members
  • 2 983 messages
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

#7
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
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
PJ156

PJ156
  • Members
  • 2 983 messages
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

#9
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
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.