Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  

ZDooM scripting question

Recommended Posts

I have 3 lines, each of which can trigger an earthquake effect. I've set up the lines to be one-time only (i.e., non-repeatable), activated when the player crosses. The quake effect works just fine. Now, I want to set it up so that once the player has crossed any of the 3 lines, the other two lines become inactive. That is, there will be only one quake, regardless of which line the player crosses. Thanks.

Share this post

Link to post

Let all linedefs trigger a script like this one:


int quake_has_happened;

script 100 {
if (!quake_has_happened) {
quake_has_happened = 1;
// do the quake or whatever you want to do


By definition the global variable quake_has_happened is initialized as 0. After the script is executed the first time, the quake_has_happened is set to 1, so the script won't run again.

Simple as that :-)

Share this post

Link to post

Don't make the lines trigger the earthquake directly, but make use the "line_setidentification" special to assign an id to the lines (all lines same id). The use an open script and put the line "setlinespecial([idofline], 80, 0, [scripttoexecute], 0);"
in "scripttoexecute" write "Radius_Quake (intensity, duration, damrad, tremrad, tid);" also add the line "setlinespecial([idofline], 0, 0, 0, 0);" This will make all lines become inactive once one of them is triggered. At least I hope so :)

Share this post

Link to post
This topic is now closed to further replies.
Sign in to follow this