Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / can you call a lift when its above you?

Author
Message
randbo
18
Years of Service
User Offline
Joined: 10th Apr 2006
Location:
Posted: 18th Apr 2006 11:49
is there any way to call down a lift when its way above you.
like when you DIE on the upper level and respawn at the original site and you cannot access the ONLY WAY UP, the lift, since its at the top of the elevator. is there a script command that you can use on a switch or something that triggers the lift to come back down?
i have tried it over and over with various switches. no luck yet.
Lost Soul
18
Years of Service
User Offline
Joined: 3rd Feb 2006
Location: Trapped in DOS
Posted: 18th Apr 2006 16:55
its lift2.fpi or something, that allows it to be called using switches

Doom,where the sanest place is behind a trigger.
K Jah
18
Years of Service
User Offline
Joined: 13th Jun 2005
Location: UK
Posted: 18th Apr 2006 17:15
If lift2.fpi fails try putting a check point at the top of the lift. Then when the player dies they can start off at the top of the lift.

Hope this helps.

randbo
18
Years of Service
User Offline
Joined: 10th Apr 2006
Location:
Posted: 18th Apr 2006 20:45
its lift1.fps and it big time DOESN'T WORK.
i have been working on it for hours to no avail. i set a switch to access the lift and the lift stops working completely.
Les Horribres
18
Years of Service
User Offline
Joined: 20th Nov 2005
Location: My Name is... Merry
Posted: 19th Apr 2006 02:17
I am pretty sure it is lift2.fpi

And I am pretty sure that it would help if you had a switch ACTIVATING the lift.

We all have our inner noob. Join the NJL, and have more fun!
I believe society is flawed; our notions on life, on child rearing, stem too far back to be of relevance in this day and time.
randbo
18
Years of Service
User Offline
Joined: 10th Apr 2006
Location:
Posted: 19th Apr 2006 20:08
lift1 is for lifts going up at startup. it says up and down.
lift2 if for lifts going down at startup. it says down and up.

lift1 has some movement code that is switch activated but if you look at it closely, it wont work. it will hang at state 5 with no place to go.
when you switch activate lift1, the lift stops working.

lift 2 has no activation code.
i have been working on writing activation code for 2 days now.
i overcame one hurdle when i looked closely at the activation code in switch1, which is used on the lift switch.
it seems that switch1 code will keep calling activateifused=1 for like 50 times until the button animation ends. this hangs up the lift1 code and locks up the lift.
i added activateifused=0 on the next line and this stops the lift from locking up, but no lift movement yet.

now the lift1 code is messed up for this purpose so i changed it to make it run better. still not working.
the automated lift feature still works. you can step on the lift and it will go up and down. you can use my switch on it and it wont lock up the lift, but no lift movement when i use the switch.
randbo
18
Years of Service
User Offline
Joined: 10th Apr 2006
Location:
Posted: 19th Apr 2006 20:15
i have a question about the execution of scripts.

you have code in a script that change the state from say state 1 to state 2 due to some condition that was successfully applied.

i would think that the state variable is updated right there to state 2, but is it executed in the same pass or is it executed on the next pass?

for example, does this code piece (with phony say commands) update the state to state 4 IN ONE PASS and say hello how are you in one pass?
randbo
18
Years of Service
User Offline
Joined: 10th Apr 2006
Location:
Posted: 19th Apr 2006 20:18
oops i did it wrong, here is the code piece

:state=0:state=1,say hello
:state=1:state=2,say how
:state=2:state=3,say are
:state=3:state=4,say you
randbo
18
Years of Service
User Offline
Joined: 10th Apr 2006
Location:
Posted: 19th Apr 2006 20:34
ok here is what i have done so far.
here is lift1
[/code]

here is what i did to lift1
[code]
randbo
18
Years of Service
User Offline
Joined: 10th Apr 2006
Location:
Posted: 19th Apr 2006 20:36
sorry guys, i havent figured out the code snippet thing yet.
randbo
18
Years of Service
User Offline
Joined: 10th Apr 2006
Location:
Posted: 19th Apr 2006 20:37
i keep trying

randbo
18
Years of Service
User Offline
Joined: 10th Apr 2006
Location:
Posted: 19th Apr 2006 20:39
almost got it right

brummel
18
Years of Service
User Offline
Joined: 26th Nov 2005
Location: Sweden
Posted: 19th Apr 2006 20:58
7 posts in a row?! You could just edit the first post!

randbo
18
Years of Service
User Offline
Joined: 10th Apr 2006
Location:
Posted: 19th Apr 2006 21:06
ok that got it right. now here is lift1 as is:



now if you look at the activation part of the code you will notice the following:
you are above the lift OUTSIDE IT and you call it using a switch.
first up activated is 1 so state goes to 11 and activate goes to 0
next pass, I ASSUME, state 11 is read and playerhigher is greater than 100, OR DOES plrhigher=100 mean it must be 100 exactly?
anyways, state becomes 21
next pass, state is 21 and raycastup does not see anything as you are like 300 higher than the lift, so we go to the next line
state is 21 and then is changed to 1
next pass state is 1 so moveup=1, next line state is 1 raycast fails again
next pass state is still 1 and moveup 1 again and so on
a number of passes later state is still 1 but this time raycastup sees something 100 above, like a roof so this line is valid and state becomes 2
next pass state is 2 and plyrdistfurther is 55 BUT BUT BUT playerassociated is FALSE. you were not in the elevator and never got associated, so the state never changes and the lift hangs at state 2.
this is how i see that the activation code fails in lift1.
NOW NOTE that i have used lift1 and switch1 and if my reading of the code is right, then the lift should have gone up to my level and then locked up. it never moved.

here is what i did to lift1:



ok at the activation part i cleaned it up.
you are OUTSIDE THE LIFT and press the switch, activation is 1
state is 0 and activated is 1 so state becomes 1 and activate becomes 0
next pass state is 11 and plrhigher is more than 100 so state becomes 21
next pass state is 21 and raycastup fails as you are like 300 above the lift
next line state is 21 so moveup 1
next pass state is 21, raycast fails so next line moveup 1
this goes on until raycastup succeeds as the lift is 100 from the roof.
next pass state is 21 and raycastup succeeds so state becomes 3
next pass state is 3 plrhigher is 10 but plrdistwithin is not 50 as the player is not on the lift yet, so the state stays at 3.
note that if you get on the lift at this point, state becomes 7 and the lift is READY TO GO DOWN.

now it appears that my code is correct, but i have noticed that i have NEVER gotten the lift to move on an activation. i believe that is where it hangs now. in the original code if i got it right the lift should have come up to me and then hanged, but it never moved.
this new code wont move it either.
next post talks about the switch, which is also relevant.
Lost Soul
18
Years of Service
User Offline
Joined: 3rd Feb 2006
Location: Trapped in DOS
Posted: 19th Apr 2006 21:09
that has to be a record on these forums

Doom,where the sanest place is behind a trigger.
randbo
18
Years of Service
User Offline
Joined: 10th Apr 2006
Location:
Posted: 19th Apr 2006 21:32
ok so if i read the switch code right it will hang the lift as it repeatedly sets activated to 1 until the switch animation is done.
here is the original switch1 code:



ok as i read this, the first line sets up the text on screen PRESS TO ENTER and then fades it out.
state is 0, the hud message is created, named and hidden and then state becomes 10
next pass state is 10 and plrdistwithin=100 passes as the player is within 100 of the switch so hud shows and then hud fades.
next line state is 10, player is within 100 and HE HAS PUSHED THE BUTTON so plrusingaction=1 passes SO state becomes 1, button animation is set at frame 0, button push sound fails as there is none loaded (not a biggie), AND activatedifused=1. this activates the lift.
next pass state is 1 and button animation in incremented one frame and ACTIVATION IS STILL 1. next line frame is not at end.
next pass state is 1 and buttom animation is incremented and so on but activation is still 1.
this goes on until frameatend=0, the last frame of the animation, then state becomes 2. as i see it, each time the animation is running, the activateifused=1 sends activation 1 to the lift, over and over and this locks up the lift. this happens in practice.
now next pass state is 2 and player has finger off the button (player has finger off the enter key) so state becomes 4
next pass state is 4 and the animation is played backwards until frame 0 again
a few passes later frame is 0 again, frameatstart=0, so state becomes 5 and setframe=0
next pass state is 5 and then becomes 10 and its ready to be pressed again.

so if i am right, the switch1 script is sending activate=1 to the lift many times until the button animation is done. this would lock up the lift.

now i made one small change to the switch1 code. here is the new one:



ok the only change i made was adding activateifused=0 at the first state=1 line. this would send activateifused=1 ONLY ONCE and then send activateifused=0 a number of times to the lift.
the lift code doesnt care about activateifused=0.
this change keeps the lift running after you hit the button, again and again, it wont lock up the lift.
BUT AS HAVE STATED ABOVE, the lift wont move.
the problem seems to be not being able to move the lift with activation code. the automated move code does work when you step on the lift and the player gets associated.

any thoughts, anyone?
Les Horribres
18
Years of Service
User Offline
Joined: 20th Nov 2005
Location: My Name is... Merry
Posted: 20th Apr 2006 06:00 Edited at: 20th Apr 2006 06:01
First off, rambo. I help people correct their scripts, not help people uncorrect scripts.
I would SINCERLY sudjest reading all the tutorial threads and playing with simple scripts before trying to correct something.


(line 1) :state=0:state=1
(line 2) :state=0:state=11
(line 3) :state=1,condition:state=0
(line 4) :state=1:state=2,rotate,fancy,random,actions
(line 5) ::state=0

line 2 will NEVER EVER run. line 1 takes precidence over line 2 (as it is first).

only if the contion is true will state=0 in line 3

all the actions in line 4 occur at once

line 5 is a special line, this will allways happen, since it is the last thing (it can be the first if you want) it can be used to reset a script everytime it runs.



Quote: "that has to be a record on these forums "

No, if you want to dig up some old threads (i made melee), I think that was 11 or 13.

We all have our inner noob. Join the NJL, and have more fun!
I believe society is flawed; our notions on life, on child rearing, stem too far back to be of relevance in this day and time.
randbo
18
Years of Service
User Offline
Joined: 10th Apr 2006
Location:
Posted: 20th Apr 2006 06:27 Edited at: 20th Apr 2006 06:28
i would read my next post as i now have corrected the lift scripts, and YES, they were wrong.
also, i have read a HUGE amount of material here on these boards, as well as the game manual OVER AND OVER. alot of what i have learned was by trial and error with some key information presented here.
Les Horribres
18
Years of Service
User Offline
Joined: 20th Nov 2005
Location: My Name is... Merry
Posted: 21st Apr 2006 03:02
Okay, your second script looks alot better. (lol)

Here is your problem, you aren't FULLY reading the script, forget what it does for a moment, you are a computer.

:activated=1:state=11,activate=0
:state=11,plrhigher=100:state=21
:state=11:state=31
:state=21,raycastup=20 100:state=3
:state=21:state=1
:state=31,raycastup=20 0:state=0
:state=31:state=4

if activated=1 then state=11
if activated=0 then state!=11

I know the script sucks, lee coded it.

hmm... thought...

:plrhigher=15:moveup=1
:plrhigher=10liftatplr)
else):moveup=-1

mabey later.

We all have our inner noob. Join the NJL, and have more fun!
I believe society is flawed; our notions on life, on child rearing, stem too far back to be of relevance in this day and time.
randbo
18
Years of Service
User Offline
Joined: 10th Apr 2006
Location:
Posted: 21st Apr 2006 06:10 Edited at: 21st Apr 2006 06:16
read my other post about a Working lift calling script. its on this same board about 4 or 5 posts below this one.

the prime problem with the existing lift script is yes if activated it will go to state 21 or 31 BUT, those states send you to state 1 or 4 AND YOU ARE NOT ASSOCIATED so it hangs right there.
also, the lift wont move if collision is on. read my other post.

i did it already and its bulletproof.
Benjamin A tested it and it works for him too.

the button will also sense if the lift is at your same level and just make a lever noise with no other action.

Login to post a reply

Server time is: 2024-04-25 13:07:54
Your offset time is: 2024-04-25 13:07:54