Jump to content

Water trap


Roycesraphim

Recommended Posts

So the plan I have for a future update is that you lead some people into a room with some water and when they start milling around, you run to the second floor and hit a switch that enables a marker that is parent to sparking effects in the water and on the walls and to the trigger for the ground floor.

 

This is the script I plan for the ground floor trigger. Ideally, with at least 5 people down there, I plan for a few people to get shocked at a time and you have to run and reset the generator (the switch you hit first) to reactivate the trigger.

scn VTFIMQ2WatertrapScript

short shockcount

Begin Ontrigger

If (getstage VTFIMQ2 == 164)
	DamageActorValue Health 5
	set shockcount+1
	setenemy VTFFaction VTFFaction VTHamEslin 0 0
	setenemy VTFFaction VTFFaction VTHamPhae 0 0
	setenemy VTFFaction VTHamPhae Player 0 0
	setenemy VTFFaction VTHamEslin Player 0 0
Elseif (getstage VTFIMQ2 == 168)
	DamageActorValue Health 5
	set shockcount.shockcount+1
	setenemy VTFFaction VTFFaction VTHamEslin 0 0
	setenemy VTFFaction VTFFaction VTHamPhae 0 0
	setenemy VTFFaction VTHamPhae Player 0 0
	setenemy VTFFaction VTHamEslin Player 0 0
endif
END

Begin gamemode

If shockcount == 5
	ShockTrapMarker.disable
	showmessage VTFIMQ2GenOverload
endif
end

Edited by Roycesraphim
Link to comment
Share on other sites

You may be better off using GetActionRef inside the onTrigger block. Something like

ref npcID;

 

BEGIN OnTrigger

set npcID to GetActionREF;

npcID.DamageActor Value.....

....

END

 

Btw your shock count code is wrong. It should be something like

 

set shockcount to shockcount + 1

Link to comment
Share on other sites

Thats the problem, I want it to trigger for any one who walks into the area (water). I'd rather not list every enemy NPC and just have them get hurt when they enter.

 

The code above works for any NPC, as long as they enter the trigger. Adding each enemy reference is insane as there may might as well be hundreds of unique references + randomly generated references + ones added by mods.

 

If you want yours to trigger for only one reference (like the Player) you need to specify that in the ontrigger block

 

BEGIN onTrigger Player

...

END

Link to comment
Share on other sites

  • Recently Browsing   0 members

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