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 / Lifts , associateplayer, collision and physics

Author
Message
Jock
17
Years of Service
User Offline
Joined: 14th May 2007
Location: UK
Posted: 18th May 2007 23:29
Hi Guys,

Along with everyone else (well, that\'s what it looks like from reading through old posts) I\'ve been thinking about the vehicle scripting possibilities in FPSC.

I took a look at Les Horribres script, and Xplosys lift script, and have been getting my head round the difficulties faced in getting the vehicle/platform to move up and down, as well as backwards and forwards.

My understanding is that it all comes down to the physics engine...

By scripting the .fpe to make the entity a character (enemy) you can use the scancodekeypressed function to issue movement commands:
movefore=1, movefore=-1, rotateiy=3 etc etc.

This is fine until you want to move up or down, at which point you have to turn collison off (coloff) so the player doesn\'t block the lifts upwards movement, and instead of relying on the lifts surface to move the player (because collision is off) you have to use associateplayer so that the player accompanies the lift in its upwards movement. The problem is that the associateplayer command doesn\'t seem to function with the movefore command...

Thinking about it as if it was real life, I thought that perhaps the reason the lift couldn\'t move up with collision on and the player standing on it was because it could not produce enough energy to lift the player.....in a rather silly eureka moment, I decided to increase the virtual mass of the platform, to see if I could trick the physics engine into re-calculating the energy behind the upwards movement...Setting the physics weight of the platform to a ridiculously high value allowed me to use the scancodekey command, with collision on and without using associateplayer to execute the moveup command.

It still doesn\'t let me move the platform sideways once it\'s off the ground, but it\'s given me a few ideas for \"tricking\" the physics engine in the DB source code.

Ok....edited \'cos I realised I was being stupid...the answer was in Les Horribres script all along.....nogravity

whack the physics weight of the entity/paltform up to a really high level to push the character up when he stands on the platform, but turn gravity off for the entity/platform so when it\'s up, it doesn\'t fall down! Collision is still on, so you don\'t need to use associateplayer, and the player will still be able to stand on it as it goes along.

Does this help anyone else (or am i just behind the times and its common knowledge?)

Thanks to Les Horribres and Xplosys for posting clear and logical scripts that really helped me to understand how the language works.
tyrano man
18
Years of Service
User Offline
Joined: 26th Oct 2006
Location: Battle City - Kalspher :)
Posted: 18th May 2007 23:41
It is not common Knowledge. With my script all that was possible was turning and moving up and down. But this looks like a great possiblity to maybe get the flying script (Or UFO script as i called it) to work

Thanks for the valuble info. I have been thinking about attmpting this again and that info may just help me pull it off.

Good luck to you if you can get it done

Jock
17
Years of Service
User Offline
Joined: 14th May 2007
Location: UK
Posted: 23rd May 2007 01:06
Did this work for you Tyrano man?....It seemed to work fine for me, I just can't tie the entity rotateiy= command to the player/camera POV... can't find a plrrotateiy= command in the manual. plenty of plrmove commands, but no plrrotate :-(

Pigmaei gigantum humeris impositi plusquam ipsi gigantes vident

Login to post a reply

Server time is: 2024-11-23 17:42:03
Your offset time is: 2024-11-23 17:42:03