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 / Using player within a distance

Author
Message
New Comers Corner
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Dallas Ft.Worth USA
Posted: 4th May 2006 08:08
I wanted to get up really close to a desk to read a note. (ie before it shows as a hud) I couldn't use an unmodified trigger zone, because it detects such a wide area, and you get more of a sense of reality in a game if reactions to things are in a small area, for instance, you go to a desk and move to the left to look, and the letter pops up, where if you move right a message pops up "Its the key to a door"

So I tired modifying a trigger zone. It works fine up to a point, the player has to move right up to the desk were the active object, in this case a note, is laying on top, very close. But an odd thing happens when I test it, and the player moves forward. The screen fades out dark and it says "deleting test level". The hud normally shows just fine using the usual player in the zone code. The timer part just lets it display longer so the player has time to read it in case he moves away too quick, because the note is read only once.

Student Programmer
Wehtam_
User Deleted
Posted: 4th May 2006 12:29
I am not familiar with your "timeron" action. Shouldn't it be timerstart ?

http://www.wehtam.co.uk - Are you creative ? Artistic projects | Forum | Game media downloads
New Comers Corner
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Dallas Ft.Worth USA
Posted: 4th May 2006 17:58
Ok, changed that, tested. It works. You might have to climb on the desk to read it tho, and that wasn't any good, so I assigned the script to an inconspicuous tile the same color as the floor, so its triggered when the player moves close to the desk to read the note. But you can use finer areas now, you don't have to activate a large trigger zone. For example you can have three different things on the desk and examine each of them separately, just place them left right and center, and attach the triggers to tiny objects on the floor beneath. When you think about it, large triggers work most of the time, but if you want to feel you're really interacting with an environment you need to activate small things. Big trigger zones are like going through the next hour in real life with huge foam rubber covers duct taped over your arms. Since you don't have a virtual hand, this gives the impression you're leaning over and examining something small.

desc = HUD Display for note on desk popping up in the air to read.

;Trigger

:state=0:hudreset,hudx=50,hudy=36,hudimagefine=gamecore\usertext\note1.tga,hudname=note1hud,hudhide=1,hudmake=display,state=1

:state=1,plrdistwithin=30:hudshow=note1hud,timerstart,state=2
:state=2,timergreater=400:state=3
:state=3,plrwithinzone=0:hudunshow=note1hud,state=4

;End of Script

Student Programmer
Les Horribres
18
Years of Service
User Offline
Joined: 20th Nov 2005
Location: My Name is... Merry
Posted: 5th May 2006 06:57
Quote: ":state=3,plrwithinzone=0:hudunshow=note1hud,state=4"


you are not using triggerzones, I think, so this line is unnessisary...

No really, you aren't... using 'plrdistwithin' is your new 'zone'. just attach it to the phone.

Also, I don't think that less then half a second is enough time to read a message off the screen. Timer, is in miliseconds.

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.

Login to post a reply

Server time is: 2024-04-24 21:36:40
Your offset time is: 2024-04-24 21:36:40