Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Doom'd Marine

scripting help

Recommended Posts

Im scripting a forcefeild to learn how to do it correctly, and when i get to test the two scripts ( one is for the force feilds itself, and the second is to turn it off. well when i go to turn them off they dont turn off, and when i test the forcefeild it only stops me, it doesnt repulse me, just keeps me from moving forwards.

#include "zcommon.acs"



int foff;

script 1 (void)
{

if (!foff) {

thrustthing(random(160, 224), 8);
damagething(5);
}
}

script 2 (int line)
{

foff=1;

delay(32);


setlinetexture(line, SIDE_FRONT, TEXTURE_MIDDLE, "-");
setlinetexture(line, SIDE_BACK, TEXTURE_MIDDLE, "-");


setlineblocking(line, OFF);



thats the code im using O.o is there something obivious going on (im still a newb at scripting so yeah.)

}

Share this post


Link to post
TheDarkArchon said:

Check line activation type.



Script 1 was marked " player crosses " or when a player bumps up against it, and it was set to repeatible.

script 2 was set up like a switch.

Share this post


Link to post
Quast said:

nm

mods delete plz


Shush it =/ Why dont you make yourself useful and at least try and help instead of asking the mods to delete it for no reason.

Share this post


Link to post

He made a post and then edited it before you made your post. He's saying his post should be deleted (If he was asking the mods to delete this thread, he would probabally get an evil eye from the mods for backseat moderating)

Share this post


Link to post
Doom'd Marine said:

Script 1 was marked " player crosses " or when a player bumps up against it, and it was set to repeatible.


That's confusing. You appear to be describing 2 different activation types. Player crosses is just that: the player crosses the line and it gets activated. There is also a "player pushes wall" activation type. That is the type where the player bumps up against the wall to activate the line and it is different from "player uses wall" which is the more traditional "space-bar activated" line.

Share this post


Link to post
TheDarkArchon said:

He made a post and then edited it before you made your post. He's saying his post should be deleted (If he was asking the mods to delete this thread, he would probabally get an evil eye from the mods for backseat moderating)

pretty much. my reply was a script that was an on/off switch script i made and tried to modify for a forcefield, but then i actually tested it and got confused myself because i couldn't get line action 33 to work.

I am confident this needs only one script however.

Share this post


Link to post
Quast said:

pretty much. my reply was a script that was an on/off switch script i made and tried to modify for a forcefield, but then i actually tested it and got confused myself because i couldn't get line action 33 to work.

I am confident this needs only one script however.



Oh.. i was just following the tutorial on the Zdoom page, o.o;


"That's confusing. You appear to be describing 2 different activation types. Player crosses is just that: the player crosses the line and it gets activated. There is also a "player pushes wall" activation type. That is the type where the player bumps up against the wall to activate the line and it is different from "player uses wall" which is the more traditional "space-bar activated" line."

Oh.. script one had the player bump activation ( where the force field would push you back and do damage) and the switch that turned the first script off was the "player uses" activated

Share this post


Link to post

#include "zcommon.acs"


//Field on/off flag.
int foff;

script 1 (void)
{
//If field is on then repulse player.
if (!foff) {
//Shove the player and do a bit of damage.
thrustthing(random(160, 224), 8);
damagething(5);
}
}

script 2 (int line)
{
//Set the flag.
foff=1;

delay(32);

//Get rid of the textures.
setlinetexture(line, SIDE_FRONT, TEXTURE_MIDDLE, "-");
setlinetexture(line, SIDE_BACK, TEXTURE_MIDDLE, "-");

//Turn off the impassible flag.
setlineblocking(line, OFF);
}

Thats the tutorials script... i wonder why my script ( which is almost the same ) doesnt work..

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×