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 / HELP! Light Alarm Script Problem!

Author
Message
Serious Sam P
16
Years of Service
User Offline
Joined: 6th Nov 2008
Location:
Posted: 9th Nov 2008 21:03
HI,
I have recently been learning scripting and this is the first script I have attempted from scratch.



The idea is for the script to activate the ifused condition on a timer. The ifused field is then given the name of the light to turn the light on and off. I have tested the timer with lighton/lightoff actions applying the script directly to the light. this works fine. The final script will then be applied to an alarm entity.

My problem is that when I run this script the light just stays constantly on.

I am sure this is probably just a stupid newb problem but I would appreciate any help.

Thanks for your help,
SSP
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 9th Nov 2008 21:47
Your script would work if the Light reset it's activation value to 0 each time and always used an activation of "1" to swap between on and off... so unless you did that, it's not going to work.

The way the stock light scripts work is you activate it with a "1" to turn it on and then activate it with a "0" to turn it off. Your script uses "1" both times, so that's why it always stays on.


The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.
Serious Sam P
16
Years of Service
User Offline
Joined: 6th Nov 2008
Location:
Posted: 10th Nov 2008 21:35
Thanks a lot Plystire!

I learned the scripting from your tutorials. 10/10! Nice work.

I changed the script accordingly to your instructions. However it seems I have another problem now. When I apply the new script to an object it flashes correctly. However, it only works while the player is in someway moving. And flashes faster if the player moves faster. Also when I applied it to my Alarm object the light lit up the whole room. When I applied it to the danger sign(stock) it only lit up the sign.

I am leaving all the light setting default apart from making it dynamic. And all the entity settings default apart from main script and IFUSED.

Any help would be greatly appreciated.

SSP

Login to post a reply

Server time is: 2024-11-24 14:00:26
Your offset time is: 2024-11-24 14:00:26