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 / Teleport Script ??

Author
Message
ExE25
16
Years of Service
User Offline
Joined: 27th Mar 2008
Location: Turkey
Posted: 28th Mar 2008 00:40
I am trying to make something like this:
when player entered a zone like elevator if player press button "1" it will be teleported to Floor1.and when player enters the zone a hud will be shown

i write a code but when i put this a trigger zone. it shows the hud in the begining. and when pressed the key it wont teleport.

i am studying fpi for 2 days. Please help



I am a Noob
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 28th Mar 2008 04:25
In the following code:



You have two script lines on a single text line. You cannot do that.

Try replacing the above portion with this:



Notice how they are all on seperate lines? Your script needs to run like that.

Also, Floors 2, 3, 4 will not work as-is. The "state" will never reach 11, 12, and 13 so the script will never execute those lines. What you could try doing for this script is simply removing the "state=10", "state=11", "state=12", and "state=13" from the beginning of the above lines.

This type of script only needs the state command for loading up the HUD.


The one and only,
~PlystirE~

Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 28th Mar 2008 05:25
FYI

I noticed you were using the actual number keys scancodes 2-5. These keys are reserved for selecting weapons. The first weapon is stored in key 1, second in key 2 and so on through key 9. It would be best to use the scancode keys on the keypad, especially if the player has more than one weapon available. These codes are:

1-79, 2-80, 3-81, 4-75, 5-76, 6-77, 7-71, 8-72, 9-73

Now the person playing the game should then have the numlock key off because if it is on then it will then choose the stored weapon as well.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 28th Mar 2008 05:45
Hmmmm, my numlock is always ON, and I've never had it swap weapons via the numpad.


The one and only,
~PlystirE~

Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 28th Mar 2008 05:54 Edited at: 28th Mar 2008 06:24
I now have a laptop and the "keypad" is embedded in the keyboard and so I have to use the "Fn" key along with the number. So, I really can't remember. Maybe if the numlock is off then it swaps weapons. But I do remember having that problem with a regular keyboard and either had to turn it on or off. It is quite annoying when you press several numbers and you swamp out a weapon each time.
ExE25
16
Years of Service
User Offline
Joined: 27th Mar 2008
Location: Turkey
Posted: 28th Mar 2008 11:36
Thanks for your help but still doesnt work.

Hud is still visible in the begining of the level and when player enters the zone it takes the player to Floor1 without pressing the key...

i delete the last 4 lines because there was no comment about them.
This is new code i used...



I am a Noob
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 28th Mar 2008 15:15
ExE25,

Look in the scripts section on my site. There is a script called "Player Move". It has instructions in it that may be helpful. It uses the plrdistwithin= condition, but you can substitute your scancodekeypressed= for that.

Best.

ExE25
16
Years of Service
User Offline
Joined: 27th Mar 2008
Location: Turkey
Posted: 28th Mar 2008 16:15
Thanks xplosys,

i used looked at your script and changed my code like yours.
This time i must use an entity i think; so i used this code on a scifi-teleporter. when i tested this code hud worked fine but still doesnt wait for pressing a key.instantly takes player to Floor1

What am i missing???



I am a Noob
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 28th Mar 2008 19:24 Edited at: 28th Mar 2008 19:34
ExE25

May I suggest this if you still want to use zones. I tested it and it works.



If you go into the zone on floor 1, no need to code for that floor. That's why I left it out. So, when you enter into the zone on floor 1; the hud will be displayed and will wait for key 2, 3, or 4 to be pressed on the numeric keypad.

There is no need to change states as the scancode condition is what will make it true and then it will execute the actions that follows the second colon. Also, you should include a state for showing the hud as well. In this case it would be state 10, so that it continues to show until the state changes to 2. At his point it checks to see if player is out of the zone and if player is out of the zone it resets to state 10 awaiting once again for the player to enter the zone.
ExE25
16
Years of Service
User Offline
Joined: 27th Mar 2008
Location: Turkey
Posted: 28th Mar 2008 20:54
OK! Thank you all guys.
I figure out why my script doesnt work. I reinstall FPSC yesterday and forgot to install the update.

BTW thanks Flatlander for your script but i think i cant use your script in all floors. I wrote a new one



I am a Noob
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 28th Mar 2008 21:11
ExE25:

What version of FPSC are you using? This sounds like FPSC is not recognizing the scripting condition "scancodekeypressed", and it's natural response to conditions that it doesn't recognise is to just consider them as TRUE and continue on.


The one and only,
~PlystirE~

ExE25
16
Years of Service
User Offline
Joined: 27th Mar 2008
Location: Turkey
Posted: 28th Mar 2008 23:21
Plystire:
I forgot to update so it was 1.00. Now i installed 107 patch and it works fine. Thank you for your interest.

The last code i send works perfect.But the floors are in different layers so i realize sth. when the player teleports to a layer down, it loses health But im OK with that because the project i am working on is an educational one.. So doesnt matter.

Thanks to all who helped.

I am a Noob
ExE25
16
Years of Service
User Offline
Joined: 27th Mar 2008
Location: Turkey
Posted: 4th May 2008 16:33
Me again...

Sorry that i haven't tried this code properly so i got another problem now..i am trying to make an elevator that doesn't move. when the player hits the button "v", it must go 3 layers up.But there are walls and floors between these entities.

i added an image to explain it clearly. As u can see from the image there are stairs so this is a multilayer level.. but i can not teleport from layer to layer because of the floor.

There are two trigger zones in different layers and there is floor between them. when i tried this code the player goes up in the same level but when it reaches the top of layer but cant pass through the wall. can i do something for this?

Sorry for my English by the way.

I am a Noob

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-24 05:42:41
Your offset time is: 2024-11-24 05:42:41