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 / Lift calling scripts that Work. also some thoughts on how scripts run

Author
Message
randbo
18
Years of Service
User Offline
Joined: 10th Apr 2006
Location:
Posted: 20th Apr 2006 06:35
ok i have 2 working scripts that call the lift when its not at your level. one is for lift starting down (lift1a.fpi) and the other is for lift starting up (lift2a.fpi)
they work with my modified switch script switch1a.fpi and a lift switch.

here is the first one for lifts that start GOING UP:


here is the second one for lifts that start GOING DOWN:



here is the switch script. its important to use this one as it only sends activateifused=1 ONCE to the lift:



i will post again with some notes on how they work. same thread.
randbo
18
Years of Service
User Offline
Joined: 10th Apr 2006
Location:
Posted: 20th Apr 2006 06:41
ok first the easy one. the original switch1 sends activateifused=1 to the lift a number of times as the button animation is running. this will hang up the lift.
my fix is as follows:
1. i moved the state=10 line to the end of the script so the activateifused=1 runs last in the pass and once.
2. i added activateifused=0 to the first state=1 line so that on this pass and following passes used=0 is sent to the lift. the lift wont care about used=0.

those are the only changes. it works perfectly and wont lock up the lift.
randbo
18
Years of Service
User Offline
Joined: 10th Apr 2006
Location:
Posted: 20th Apr 2006 06:59
now for the fun one, the lift caller and autolift.

ok some operational notes:
1. first of all, all scripts are loaded at startup and each one runs all the way thru with each pass of the game loop.
2. the scripts will look at EACH LINE of the script in order that they are presented in the script. so stuff like:
:state=0:state=1
:state=1:state=2
:state=2:state=3
:state=3:sound=up.wav
will play the up.wav file ON THE FIRST PASS OF THE LOOP.
if the code lines were in a different order they wouldnt play on the first pass. that is why some of my decision lines are AFTER the code that uses them. i want them to execute on the NEXT pass. thats also why the switch1a script works, the state=10 line is LAST so the activateifused=1 is sent to the lift at the end of the pass and the NEXT PASS activateifused=0 is sent.
3. there is some special relationship between lifts and players that is not documented. the lift script wouldnt work until collision is off on the lift--coloff. that hung me up for over a day. also when the lift is further than 100 from the player it will inch up or down. i dont know how to correct this. it works, but slow. you can get in the way of the lift and it will speed up or you can move away and it will inch down again. undocumented behavior.
4. i did some expedient stuff on the script, like an extra pair of colon and coloff statements. this prevents ghost lifts where the lift moves but you dont. strange behavior but the extra pair of colon coloff fixes it.
5. more lift player tiein behavior: when the lift is at your level and you press the button, it must not screw the lift up. so i put in lines that test when the player is within 150 of the lift which turns collision back on and plays the ironlever.wav file. this prevents the lift from going back down when you press the button and you are standing next to it on the upside.

ok i hope some of you try my code out on a lift.
use liftswitch from entities scifi wallfurniture menu.
use my switch1a.fpi script with the liftswitch.

it all works and is bulletproof so far.
Benjamin A
19
Years of Service
User Offline
Joined: 31st Oct 2005
Location: The Netherlands
Posted: 20th Apr 2006 22:54
First of all.... excellent work!!!! I've tried it and it works fine, but indeed the player needs to stay close to the lift to get it working well.

The speed of the lift coming towards the player is controled by these two lines:



You can change these moveup numbers to speed up the lift, but that causes another problem. The lift will come down fast enough, but dissappears into the ground, until the player steps into the tube, the the lift will come back and work fine. Problem is, the player will think the lift hasn't arrived yet.

If changed the moveup to 2/-2 and that works fine and speed up the lift nicely. Increasing the number above 2 causes problems.

Bored of indoor? Add outdoor to your FPSC games!
http://www.aeilkema.dds.nl/mega/index.html
Need music for your games? Check the above link also!
randbo
18
Years of Service
User Offline
Joined: 10th Apr 2006
Location:
Posted: 21st Apr 2006 00:10
thx for the vote! i dont know why i didnt think about changing the moveup speed to 2. ahah
anyways, when the lift is creeping down to you its skipping positions and that is why it will go too far. it does the raycast check at 15 instead of 20 because it skipped. you can alter the raycastup trigger point. that will have to be checked over and over to see where it ends up each time.
we are currently stuck with doing it this way. mebbe someday they will publish the exact relationship between the player and the lift.

also, i dickered around with the raycast position to make the lift line up nicely at the top position. problem is when you step onto the lift you wind up STANDING on the bottom of the lift, not the top.
you dont see this as you dont see your feet. srange, but thats how it works. it may look cool when the lift lines up, but you wind up stepping up as you step off.
the good lineup spot is raycastup=19 202
i wouldnt change the down spot as it might disappear thru the floor when it creeps down.
Floating Applz
18
Years of Service
User Offline
Joined: 16th May 2006
Location:
Posted: 17th May 2006 05:53
i got a question in demo can you use scripts? i plan on getting full version soon. and how do i use the script??
Benjamin A
19
Years of Service
User Offline
Joined: 31st Oct 2005
Location: The Netherlands
Posted: 17th May 2006 08:52
Yes you can, but bofore asking these basic questions, you should really read the manual, it's all explained in there and it wills ave us lot's of typing

http://www.gamefun4u.nl/index.html
GameFun4U, the ultimate funtainment. Cool Games and Resources for your own games.
uman
Retired Moderator
20
Years of Service
User Offline
Joined: 22nd Oct 2004
Location: UK
Posted: 17th May 2006 09:26
I had already gone through all of this myself way back.

It seems one cannot get over the problem of the lift platforms misbehaving regarding the relationship with the player and how they have a jerking movement up and down when the player gets off and moves away. The speed issue of making the platform faster so that it moves faster - but then falls away and dissapears in another related issue which I could not find a way to overcome. These things are intertwined with the physics, gravity and collision.

These issues are made much worse in very complex levels where there are a lot of dynamic entities and where there are high ploy counts i.e. in levels where there is likely to be a burden on the engine - when lift platform behave much worse to such an extent that they become unusable - they will kill frame rates by around 50% when the player stands on them.

There are some serious isusues and bugs associated with the lift platform entities and the answer to correcting these lies in source.

The problems with the platform entities were only partly understood during Beta testing before V1 as insufficient real level scenario building and testing was available and all the problems were not detected nor fixed.

The more complex a game becomes the worse the behaviour the platforms return.

So severe were the bad responses from Lift platforms due to the poor or bad code associated with them that I have removed them altogether from my games.

Correctly working Lifts are not not possible currently in FPSC unless you stick to relatively simple level building or such erratic or erronous behaviours will creep in - sooner or later if you keep adding to your levels.

The problem is similar to that of other AI entities in that in simple levels you can have many but as complexity of levels in surrounding proximity increases - that number drops or entities behaviours become increasingly adversley affected and eventually behaviours just go haywire.

Two separate issues it seems are involved - bugs/errors relating Physics and so forth attached to entities and the resultant increase of erratic responses/behaviours brought about at times of an increase on the burden of the math which the engine cannot handle efficiently.

Really Lift platforms and the missing Ladders need some serious looking at for any FPSC upgrade.

Still nice one for releasing these and the work done - they will help users to at achieve another dimension to their lifts albeit with imperfect performance.

Jordan Siddall
20
Years of Service
User Offline
Joined: 1st Mar 2004
Location: UK
Posted: 18th May 2006 18:19
So, do you have a working finished script any where?

Login to post a reply

Server time is: 2024-11-22 09:26:31
Your offset time is: 2024-11-22 09:26:31