Jump to content

Scripting Help


Spazman3000

Recommended Posts

Hello, I am sorry if this has already been asked but I am sort of new to the GECK especially when it comes to triggers and scripts(outside of ones that activate on someones death) but I was wondering if someone could answer my question: is there a way to make a script so that a trigger will only spawn npcs when the player enters it at a certain quest stage? I have made scripts that have worked only at certain stages before, but only with dialogue and I have made scripts that have spawned npcs before but I have not done it while trying to only have it happen at a certain stage. Essentally I am trying to make it so that if the player enters the trigger to spawn the npcs it will only happen if the player is at a certain stage of my quest. If it helps heres what I am doing in terms of the script for it:

 

begin ontriggerenter player

 

beginif getstage IDofmyquest =30

IDofnpc.enable

IDofnpc.enable

Continue this for about 4 more times identically

endif

 

end

 

Can someone please help me and tell me what is wrong with it whether it be I am just not typing the scripts in right or not using the right script commands?

(also for where it says IDofmyquest and IDofnpc I do have there actual IDs in place of that)

Link to comment
Share on other sites

Not a scripting guy, but.....

Probably an easier way to do it would be to enable the trigger at a quest stage (sort of backwards from the way your doing it, but simpler).

But if yo want to stick with your current setup you'll want to remove that "beginif" and replace it with an "if". Your not using the correct condition which is "==" not =. You also may want to use parenthesis to enclose the function so you can guarantee it's testing exactly how you want the condition checked.

You need to install powerup, it will list, by line, any syntax errors.

Link to comment
Share on other sites

Not a scripting guy, but.....

 

Probably an easier way to do it would be to enable the trigger at a quest stage (sort of backwards from the way your doing it, but simpler).

 

But if yo want to stick with your current setup you'll want to remove that "beginif" and replace it with an "if". Your not using the correct condition which is "==" not =. You also may want to use parenthesis to enclose the function so you can guarantee it's testing exactly how you want the condition checked.

 

You need to install powerup, it will list, by line, any syntax errors.

ok thanks I will take a look at that power up thing and try and fix it

 

I honestly think the problem may be more of I dont know how to script it properly. Also if someone could say how I would enable the trigger at the quest I would appreciate because I think in the way I am doing that would work. Also I installed powerup but all that does is say where the error is it doesnt tell me what I am doing wrong.

Edited by Spazman3000
Link to comment
Share on other sites

ok got them to spawn in the way I think you meant but now I need to know is there a way to script it so that the game will only advance the quest to the next stage when the player kills all the enemies?

spawnNPC.getDead. Put it in the quest script with an;

 

if spawnNPC1.getDead && spawnNPC2.getDead && spawnNPC3.getDead && spawnNPC4.getDead

SetStage yourQuest StageIndexWhateverStageYouWant

endIf

 

 

Or put it on each of the actors onDeath blocks for their scripts (when the last one dies the condition will be true).

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...