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 / "Always Active?" Property

Author
Message
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 18th Oct 2007 09:36
First things first, this property is what decides whether scripts will run no matter how far away the player is.

Okay, I want an entity to be running it's script within a specified distance from the player.

I do NOT want to set this property to "YES" because:

a) It's script is very complex
b) There are going to be TONS and TONS of these entities in one level

Is there a way to tell the entity that I want it to run it's script ONLY when the player is within a certain distance?

If no one can think of an editor solution I suppose I could do some more of my unfamous (yes, Unfamous) back-hand programming to force it to work and still salvage what little framerate I can.


The one and only,
~PlystirE~

Dammit, Jim! I'm a programmer not a graphic designer!!!
DJ Professor K
18
Years of Service
User Offline
Joined: 19th Dec 2005
Location: Somwhr in front of a brokn kyboard.....
Posted: 18th Oct 2007 10:58
Well, you can use "Umans - Load and unload Entities on the fly", hope it's what you're looking for.

Located on the scripts sub-forum (heres the direct link):
http://forum.thegamecreators.com/?m=forum_view&t=73014&b=23
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 18th Oct 2007 14:37 Edited at: 18th Oct 2007 14:51
Edit: Well, Uman's script didn't work for this instance. It didn't seem to have activated the entity at all.


The one and only,
~PlystirE~

Dammit, Jim! I'm a programmer not a graphic designer!!!
uman
Retired Moderator
19
Years of Service
User Offline
Joined: 22nd Oct 2004
Location: UK
Posted: 19th Oct 2007 06:59 Edited at: 19th Oct 2007 07:00
There are some complex flaws associated with the always active flag which can make working with it difficult.

You are probably best leaving the always active flag off if that command actually works at all and relying on your entities script to control activation. Playing around with the player proximity (distance) settings associated to the activated = 1, activated = 0 commands may return a result but it will depend on the individual scenario and a lot of scripting and testing of level before a successful result if acheivable at all may be seen. It can be long hard, stressful work I know if a result is not easily forthcoming with no guarantee of success.

You could also try the default trigger zones and activation scripts that come with FPSC they work well in some situations but not so well in others.



"There are those who said this day would never come - What have they to say Now?"
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 19th Oct 2007 08:47
@uman: Well, the things is, my scripts WORK FLAWLESSLY with the command turned on! The only time they start bugging up is when I turn it off to try and save myself some much needed FPS. In my current level with as many entities running this as there are, I'm getting a whoping 17fps on my pretty nice computer! I'd hate to see what it'd be like on a computer that isn't so nice. That's why I want to try and optimise it.

Perhaps, as you insinuated, the problem lies within the "activated =" effect of the property. My scripts sort of utilise this to turn on and off lights that are mentioned in their IfUsed field.

Maybe I can try and sort through this and get rid of... or even change the use of the "activated=" condition in my scripts, because the way I have it now, it checks for "activated=0" in order to work, and I manually activate/deactivate the entities myself, but I guess I can't do that with this property turned off.


The one and only,
~PlystirE~

Dammit, Jim! I'm a programmer not a graphic designer!!!
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 19th Oct 2007 08:56 Edited at: 19th Oct 2007 08:56
Update on the matter, new problem found...

I gave the entity "No" for the Always Active property, and the super simple script:



I turned on the Entity Debug option so I could see what state it was in... well, no matter how close or how far I got from the entity, it remained in S:0

What's up? Does anyone else get this? Or is it just me???


The one and only,
~PlystirE~

Dammit, Jim! I'm a programmer not a graphic designer!!!

Login to post a reply

Server time is: 2024-10-10 03:22:40
Your offset time is: 2024-10-10 03:22:40