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 Product Chat / Light Question

Author
Message
Jiffy
20
Years of Service
User Offline
Joined: 5th Mar 2004
Location: Hiding in the bushes in your backyard
Posted: 6th Mar 2005 16:47
I know there has been quite a few posts about lights, but I couldn't find anything about this (sorry if this has been asked numerous times). Firstly, I don't understand the way scripts work - at all. I think I can pretty much get by this, but for this I need help. Essentially, in my game you walk into a trigger zone and the lights go out. You go down to the basement, hit a light switch and all of the lights turn back on. I really don't know how to do this. I know it will have something to do with the lightoff.fpi script, but I don't know where to put it. Do I put it as the main script on the trigger zone? Anyway, if anyone can help me I would be very thankful.

Last night I was looking up at the stars and said "Where the hell is my roof?!"
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 6th Mar 2005 18:09
Before starting, copy the scriptbank\plrinzone.fpi and the scriptbank\switch.fpi into the scriptbank\user directory

Edit scriptbank\user\plrinzone.fpi and change the activateallinzone to activateifused. This will mean we just want the trigger to activate a specific entity not anything in the trigger area.

Edit the scriptbank\user\switch.fpi and modify the following line:

:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pressentertouse.tga,hudname=useswitchprompt,hudhide=1,hudmake=display,state=10

To:

:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pressentertouse.tga,hudname=useswitchprompt,hudhide=1,hudmake=display,alttexture=1,state=2

Basiclly setting the texture for the switch off position and telling it to start as though the switch has alreay switched off the light (As we know the trigger zone will already do this)

To do this the light needs to be a dynamic one not a static. (Press y key to toggle when placing the light). Name the light "light1". If you need more than one light make all the lights you use light1. Though remember you can only have 7 dynamic lights in use, if you use more, it will only light the ones nearest the player (Which can create some interesting auto lighting effects )

Next put in a trigger zone. And put in the IFUSED property "light1" and for the MAIN AI section select scriptbank\user\plrinzone.fpi

Add a light switch and put in the light switches IFUSED property "light1" and for the MAIN AI section select scriptbank\user\switch.fpi

This should hopefully give you the desired effect.

Basically the light has ether on (Activated=0) or off (Activated=1) and the two scripts just play around with these settings.

Jas

----
"What is this talk of 'release'? Klingons do not'release' software. It escapes leaving a bloody trail of developers and quality assurance people in its wake!"
Jiffy
20
Years of Service
User Offline
Joined: 5th Mar 2004
Location: Hiding in the bushes in your backyard
Posted: 6th Mar 2005 18:18
Cool! Thank you SO SO SO much!

Last night I was looking up at the stars and said "Where the hell is my roof?!"

Login to post a reply

Server time is: 2024-11-22 20:25:25
Your offset time is: 2024-11-22 20:25:25