Doom Marine
User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > ACS: Assign a line to trigger a lift, scripted.
 
Author
All times are GMT. The time now is 09:35. Post New Thread    Post A Reply
pablogener
Junior Member


Posts: 102
Registered: 11-12


I have this lift that should work 'automatically' when the player gets on it, but not before something else is done. I want my player to try to get on the lift, nothing would happen, he would then have to go up to a computer terminal and press 'use' on it, go back to the lift, then the lift would work ok.
how can I get it done?

thanks for your time!!

Old Post Apr 6 2013 16:33 #
pablogener is offline || Blog || PM || Post History || Add Buddy IP || Edit || Quote
Krispy
Senior Member


Posts: 1264
Registered: 02-12


This is how I would do it. Dunno if it works of not though.


script 1 (void)//for the lift
{
if(ActivatorTID == 1)
{
Plat_UpWaitDownStay (tag, speed, delay);
}
else
{
print(s:"No power!");
}
}

script 2 (void)//for the control panel

{
Thing_ChangeTID (0,1);
}

Old Post Apr 6 2013 19:25 #
Krispy is offline Youtube || Blog || PM || Post History || Add Buddy IP || Edit || Quote
gggmork
If you can make any sense of this post, congratulations


Posts: 2856
Registered: 06-07


make global variable (outside scripts) called liftActivated = 0; or whatever. Computer switch sets it to 1.
Walking on the lift does:
if liftactivated == 1: bla

Old Post Apr 6 2013 19:44 #
gggmork is offline || Blog || PM || Post History || Add Buddy IP || Edit || Quote
Krispy
Senior Member


Posts: 1264
Registered: 02-12


^Better

Old Post Apr 6 2013 19:54 #
Krispy is offline Youtube || Blog || PM || Post History || Add Buddy IP || Edit || Quote
pablogener
Junior Member


Posts: 102
Registered: 11-12


I did it gggmork's way, figure it out myself later. krispy's way seems better, though. It's actually working fine right now, so I wouldn't change it (don't fix it if it's not broken, right?), anyway, I didn't take into account that the player itself could be a carrier of a 'flag-acting' variable, with that TID value. it's a much useful resource, thanks for the tip.

Old Post Apr 6 2013 20:08 #
pablogener is offline || Blog || PM || Post History || Add Buddy IP || Edit || Quote
pablogener
Junior Member


Posts: 102
Registered: 11-12


just in case you guys wanted to checkout the code I produced, here it is:
code:
script 11 (void) //for the lift { if (pReroutePower == 0) { light_flicker(35,255,80); print(s:"Lift offline. Reroute backup power to operate"); } else { floor_raisebyvalue(35,4,255); delay(140); exit_normal(0); } } script 12 (void) //for the panel { pReroutePower = 1; light_fade(36,255,70); print(s:"Backup power on. Service lift operation restored"); }

Old Post Apr 6 2013 20:10 #
pablogener is offline || Blog || PM || Post History || Add Buddy IP || Edit || Quote
gggmork
If you can make any sense of this post, congratulations


Posts: 2856
Registered: 06-07


Now I bet you can run in and out of the lift really quick to make it go up without you and get stuck.

Old Post Apr 6 2013 21:17 #
gggmork is offline || Blog || PM || Post History || Add Buddy IP || Edit || Quote
pablogener
Junior Member


Posts: 102
Registered: 11-12


ya, just like with many id-original maps... and if you did that you'd be an ass.

Old Post Apr 6 2013 23:47 #
pablogener is offline || Blog || PM || Post History || Add Buddy IP || Edit || Quote
gggmork
If you can make any sense of this post, congratulations


Posts: 2856
Registered: 06-07


I see the lift is supposed to exit anyway, but you can prevent that by making another global variable:
int liftPosition = "down";
then put another if/else, nested inside of your else above.

if liftPosition=="down": lift goes up, liftPosition="up"
else: lift goes down, liftPosition="down"

So you can keep pressing the lift up/down.

Old Post Apr 7 2013 00:08 #
gggmork is offline || Blog || PM || Post History || Add Buddy IP || Edit || Quote
All times are GMT. The time now is 09:35. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > ACS: Assign a line to trigger a lift, scripted.

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.