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 / Why isn't this VERY simple script working?

Author
Message
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 2nd Oct 2007 10:32
Okay, I was playing around with the scripting files trying to get some better than default things to happen. When absolutely NOTHING happened from my script, I tried putting this into a simple Light script (I know, it's even worse than the default, but it's just a test):


I use that script on a simple light in a room and attached it to a switch (So I could turn it on). When I flip the switch (Yes, I put the light entities name in the "If Used" field) nothing happens, and I know for a fact that the light should be hitting the wall, but I don't see anything. Even flipping the switch again didn't work.

Anybody got any ideas? This is driving me nuts!


The one and only,
~PlystirE~

In Soviet Russia, road forks you!

Mom: I may not be the alpha and omega, but I can sure as hell be yours!
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 2nd Oct 2007 10:42
Okay, here's an even bigger problem:

I openned the light1.fpi script and SAVED IT UNDER A NEW NAME. Now tell me why in the world the script doesn't fricken work?! It works just fine as "light1.fpi" but when I try to use a script called "light_test.fpi" that has THE EXACT SAME CODE, it doesn't work?!?

This is just stupid now.


The one and only,
~PlystirE~

In Soviet Russia, road forks you!

Mom: I may not be the alpha and omega, but I can sure as hell be yours!
Captain Kirk
19
Years of Service
User Offline
Joined: 30th Aug 2005
Location: Sickbay
Posted: 2nd Oct 2007 14:25 Edited at: 2nd Oct 2007 14:26
Be sure that the new script replaced with the old one in the menu which appears when right click on the entity.

But I think you already did this, so the problem is not this.

In Windows go to Control center -> folder settings -> View tab, and check if the "Hide known extension" is not checked.

(I don't know the exact name of this option because I use a non english version of Xp, but it should be something like I wrote above)
Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 2nd Oct 2007 19:49
Make sure the object you attach it to is set to DYNAMIC "static = no".

"he is coming!..." - WIP in 'Showcase'
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 3rd Oct 2007 02:12
Quote: "Make sure the object you attach it to is set to DYNAMIC "static = no".
"


I tried the script in both dynamic setting AND static setting. (I initially had the light set as dynamic, but when it wasn't working no matter what I tried, i changed it to static to see if it mae a difference.)

I really want to get some scripts working, and seeing that I can't even replicate a simple light switching on and off, this isn't looking too good for me.


The one and only,
~PlystirE~

In Soviet Russia, road forks you!

Mom: I may not be the alpha and omega, but I can sure as hell be yours!
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 3rd Oct 2007 02:47
Okay, I made a small discovery... I copied one of my working lights from another room and put it into the room I was trying to test in.... and found out that they didn't work either!!!

It seems that lights just don't want to work in this particular room... hmmmmmmmmm.


The one and only,
~PlystirE~

In Soviet Russia, road forks you!

Mom: I may not be the alpha and omega, but I can sure as hell be yours!
TGPEG
17
Years of Service
User Offline
Joined: 28th Dec 2006
Location: Bristol, United Kingdom
Posted: 3rd Oct 2007 23:00
That doesn't make much sense. Lights should work wherever thay are on the map. Hmmm...

[center]
The all new EG Interactive Forums.
TZap
19
Years of Service
User Offline
Joined: 29th Aug 2005
Location:
Posted: 3rd Oct 2007 23:21
Try removing that last line and the light will stay on. In the last line , you set the state back to zero...which will turn the light off immediately.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 4th Oct 2007 03:33
@TZap:

The reason my code is the way it is, is so i can turn it on and off when I use a switch to activate/deactivate it. Hence why it checks for (de)activation before it changes states.

@TGPEG:

I completely agree, and it baffles me, too. But for some reason the light started working!! Then later on, it stopped working again! I didn't do anything to the light's script or properties while this was happening.


The one and only,
~PlystirE~

In Soviet Russia, road forks you!

Mom: I may not be the alpha and omega, but I can sure as hell be yours!

Login to post a reply

Server time is: 2024-11-23 22:52:27
Your offset time is: 2024-11-23 22:52:27