Jump to content

Home

Help ! Confused about trigger spawning enemys


Quanon

Recommended Posts

Title says all : Thing is I got my transitions that work fine, so spawning NPCs with triggers should be almost the same...

 

Still I got no results, nothing spawns ... bugger :

 

So here the trigger setup in K-GFF :

 

K_GFF_TRIG.jpg

 

This the setup of my UTT file :

 

UTT_FILE_BASIC.jpg

 

UTT_SCRIPTTAB.jpg

 

And ofcourse the script, which compiles but doesn't seem to take effect. :(

 

SCRIPT.jpg

 

 

I just hope theres an obvious "dumb" mistake in there , been cracking my head on this silly problem.

 

Plus I packed it all up into my .mod file.

Link to comment
Share on other sites

Title says all : Thing is I got my transitions that work fine, so spawning NPCs with triggers should be almost the same...

 

Still I got no results, nothing spawns ... bugger :

 

I just hope theres an obvious "dumb" mistake in there , been cracking my head on this silly problem.

 

There is. :)SpawnGhostsAttack1 is longer than 16 characters, and a ResRef can be at most 16 characters in length. You'll have to rename your script to something shorter.

Link to comment
Share on other sites

There is. :)SpawnGhostsAttack1 is longer than 16 characters, and a ResRef can be at most 16 characters in length. You'll have to rename your script to something shorter.

 

:lol: I knew it was something plain obvious...

 

@Seamheinn : It was not directly a problem, but sloppy name giving is not good... and I'm already a chaotic mind :p

 

Edit : Just one more problem , the trigger seems to work Twice ?

 

I want to fire just once , is there an extra line for the script to destroy the trigger ?

 

Or to make it safe to just fire it off once ?

Link to comment
Share on other sites

Edit : Just one more problem , the trigger seems to work Twice ?

 

I want to fire just once , is there an extra line for the script to destroy the trigger ?

 

You can use a local boolean variable set on the trigger to determine if it has already been fired, and if so don't do the spawning again. Something like:

void main() {
   if (GetEnteringObject() == GetFirstPC()) {
       if (!GetLocalBoolean(OBJECT_SELF, 40) && !GetIsObjectValid( GetObjectByTag("g_qgmdarkjedi01") )) {
           CreateObject(OBJECT_TYPE_CREATURE, "g_qgmdarkjedi01", Location(Vector(-7.22, -43.42, 0.0), 0.0));
           SetLocalBoolean(OBJECT_SELF, 40, TRUE);
       }
   }   

}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...