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 / moving items with the keyboards

Author
Message
PKaufman
17
Years of Service
User Offline
Joined: 13th Jul 2007
Location:
Posted: 13th Jul 2007 20:02
I'm trying to make items like boxes move when the player isn't right next to it by using the numpad.

So far, I'm trying to use this code on the box that is to be moved:

:state=1,plrdistwithin=1000,scancodekeypressed=78:nogravity=1,moveup=200,state=2
:state=2,scancodekeypressed=74:nogravity=0,moveup=-200,state=1
:state=2,scancodekeypressed=75:movefore=200
:state=2,scancodekeypressed=77:movefore=-200
:state=2,scancodekeypressed=72:move=200
:state=2,scancodekeypressed=76:move=-200

The problems that I'm running into are:
1. it won't move left or right(I'm guessing that the move action is wrong)
2. it takes forever for the game to respond to the keyboard
3. nothing will work unless physics is turned off, which causes the boxes to spawn slightly off the ground

any help or suggestions would be highly appreciated.
thanks in advance.
its that guy
17
Years of Service
User Offline
Joined: 24th Apr 2007
Location: illinois
Posted: 14th Jul 2007 03:39
woah this sounds really cool, i would help you, but i just started learning about scripting

pigs can fly
18
Years of Service
User Offline
Joined: 20th Aug 2006
Location: Luxembourg
Posted: 14th Jul 2007 13:30
give them much smaller values than 200... or bigger than -200.
Well, with as high values as these ones, the entity will make a huge movement. Setting them to 1 or 2 makes it move a bit slow, but fast enough to recognize the movement.

Also, I would place the coloff command if front of the movement commands...

Hope that helped


All the free PCF Productions Stuff

Login to post a reply

Server time is: 2024-11-23 21:02:30
Your offset time is: 2024-11-23 21:02:30