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

Got it! The decission works!

Recommended Posts

Hi, everybody!
Some days ago I posted here a question: How to make the decission? (or something like that). I've figured out how to do it (I'm posting this here, because I think somebody may use it)
:-)

I tried it on simple sector with two switches on the opposite walls. In front of one of the switches I've placed the impassable polygon (through F9), then I put the vertices (and lines) together to make simple line (this is the only way to make "repulsion line" of field, without breaking up the
level structure :-)
The simple line in front of the exit switch has the ACS_Execute special to call up the 1st script and it is 2 units in front of
real (impassable) wall.
The line (impassable wall) has Exit_Normal special.
The switch on the opposite wall has the ACS_Execute special to call up the 2nd script.

Got it? :-)

Well, here are the scripts:

#include "zcommon.acs"

//Generator on/off flag.
int gon;

script 1 (void)
{
if (!gon) {
//Print message.
print (s:"\cGSet the generator on first. Then try it again.");
}

if (gon) {
//Clear the line.
clearlinespecial();
}
}

script 2 (void)
{
//Print message.
print (s:"\cDThe generator has been set on.");

delay(35);

//Set the flag.
gon=1;
}



That's all! But this effect has a bug (I don't know it exactly, but I think it is a bug :-(
When the generator is set on and the player will activate the line in front of the exit switch, second decission in script 1 will clear the line. But the player must hit the switch again, to touch the "real" switch. Somebody may get trapped on this: "I've set on the generator, but the switch isn't working!"

Do somebody know, how to fix this "bug"?

P.S. Sorry, Lazer. I didn't tried it your way, because I don't know how to make see-through door :-(

Share this post


Link to post

Hiya.

Not sure if this will make a difference, but try having gon evaluate something specifically:

if(gon <1);
...

if (gon >0);
...

The scripting engine might not be happy with !gon for some reason. Worth a shot anyway....

^_^

Paul L. Ming

Share this post


Link to post

I don't know what do you mean, but the variable !gon works well. I have no trouble with it and be sure the engine "likes it" :-}
The ! symbol is the NOT declarator. I haven't tried the < or > declarator. It seems to be much difficult to use for me.
I have solved the problem with invisible line in front of the wall anyway. There's no need to use it that way. If you're interested in my newest decissions, send me mail and I'll send you some examples.

Thanx for your reply anyway. :-}

Share this post


Link to post

Regarding the bug, it looks as if you ought to use the clearlinespecial as part of script two, and eliminate the:

if (gon) {
//Clear the line.
clearlinespecial();


from script one. Otherwise, you are using the second execution
of script one to just clear the line. By the way, don't you
need a line ID for the clearlinespecial?

Share this post


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