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 / Ambience scripting - Having a problem

Author
Message
Ausculta
14
Years of Service
User Offline
Joined: 24th Apr 2010
Location: A place - Things things here, and stuff.
Posted: 24th Jun 2010 06:35
I ran in to a slight problem working on a level recently. The level's concept requires some drastic over all changes to the ambient lighting at various times, which I've been using trigger zones for.

The first zone works perfectly.


The second zone... Not so much. The audio for it works fine, but the ambient lighting does not change.


My goal was to reduce the over-all ambient lighting gradually as a creepy sound effect played. What am I doing wrong here? Any tips?
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 24th Jun 2010 18:06
It worked fine when I tested it so check your script assignment for the trigger zone in case you have it running the wrong script.

Going from 25 to 15 is like all dark anyway, so maybe broaden the range like 35 to 15 in steps of 2 or something.
That would keep the delay the same but make the dim part more noticable.

   Conjured Entertainment

 WARNING: Intense Madness
The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 24th Jun 2010 18:20
I have used similar scripts for underwater and found that they are more reliable if i made them like this:


In case you find my grammar and spelling weird ---> native German speaker ^^
Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 24th Jun 2010 19:24
Of course, using Project Blue/Green you could have a real ambience fading script in much less code

:state=0:dimvar=amb,setvar=amb 255,etimerstart,state=1
:state=1,etimergreater=50:subvar=amb 1
:always:ambience=%amb

This will gradually turn the ambience from full to 0.


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
Ausculta
14
Years of Service
User Offline
Joined: 24th Apr 2010
Location: A place - Things things here, and stuff.
Posted: 25th Jun 2010 07:19
@Marc - I tried Project Green awhile back. It was great, in spite of some frame-rate issues, but... Crashed on my system when ever I tried making a full build (levels worked fine in test mode though). As a result, I've been reluctant to try Blue.

I tried The Storyteller 01's suggestion (reminded me of something I did with a friendly NPC AI to get an animation sequence to flow properly)...
with no luck. <side note> I moved the audio call to it's new location as part of the test. As a result: No audio, no change in lighting.

So far the only way I've managed to get ambient lighting changes to work for me is by (in a jarringly unpleasant manner) jumping from "point A" to "point Z" so to speak. I guess I could use a HUD flash to hide the drastic shift...
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 25th Jun 2010 07:59
First thing of note in your new script:


You have an extra comma in the actions list. It shouldn't harm the outcome, but better to be safe and get rid of it.

Second thing of note is that I don't see a "desc =" line in your scripts... typically this only effects HUDs, but neglecting to put it in can have consequences.


Also, what version of FPSC are you using? Any mod installed?


Quote: "I tried Project Green awhile back. It was great, in spite of some frame-rate issues, but... Crashed on my system when ever I tried making a full build (levels worked fine in test mode though). As a result, I've been reluctant to try Blue."


Building too many levels has been an issue with vanilla FPSC. Hopefully this will be fixed (not just an increase, but completely fixed) in the newest update and the fix will make its way into PB/PG.
People have workarounds for that issue, though. The normal cutoff that I've seen reported is that builds exceeding 3-4 levels will crash. Building multiple games and cropping your levels together into a single build manually has worked for many people, and though this can be painstaking, it is a proven process. (Not just for people using PB, but for people using the official version and other mods as well)


The one and only,


Ausculta
14
Years of Service
User Offline
Joined: 24th Apr 2010
Location: A place - Things things here, and stuff.
Posted: 25th Jun 2010 16:45
I actually noticed the extra comma myself and deleted it from the original script (although it still didn't work afterwords). The actual script itself does have a "desc =" line ("desc = Dungeon1_1 Transition 1" in this case), I've just left it out of the code I've been posting.

I'm using unmodified v1.16 of FPSC. I've tried various mods and so far every single one has either crashed doing level tests or crashed during final builds. I'm aware of the crash bug you mentioned, but the test builds I tried doing with PG and other mods were only single level, 2 or 3 room, builds.

As it stands, my current project may end up getting put on hold until 1.17 is released anyway. The first "level hub" of the game already gets dangerously close to the 2MB memory limit during testing/building due to light mapping, and I'm afraid "Dungeon 1_1" might be getting close to hitting the same limit.... And it's only about a third complete at the moment.
Ausculta
14
Years of Service
User Offline
Joined: 24th Apr 2010
Location: A place - Things things here, and stuff.
Posted: 25th Jun 2010 17:04
As a side note.... I have wondered every once in awhile if the reason FPSC mods crash on me has something to do with my computer itself. Although, aside from the graphics card, it's a pretty ordinary Win 7 machine. Even the graphics card isn't anything too unusual though, just a modified nVidia 9600GSO card.
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 25th Jun 2010 18:44 Edited at: 25th Jun 2010 18:50
Quote: "The actual script itself does have a "desc =" line ("desc = Dungeon1_1 Transition 1" in this case), I've just left it out of the code I've been posting."

That's what I figured; you only posted the triggers and not the header+.
I started to say something about it, but then I figured if you got this far then you probably already knew that.
I guess I should have said something though, just in case, so good call Plystire.


Quote: "I'm using unmodified v1.16 of FPSC. "

I'm using v115 until v117 is out.

Quote: "As it stands, my current project may end up getting put on hold until 1.17 is released anyway."

I have a project in mind wating for v117 too.
There is going to be a lot of cool stuff being released shortly after the release of v117.

I'm not saying it is, but this problem could be v116 related.
As I said, your code worked fine for me when I tested in v115. (and yes, I used a DESC)

Has anyone else tested this in v116??

Quote: "As a side note...."

Take note of the EDIT option just under your avatar on your posts (when you are logged in).
You can use that to add something to your post later instead of double posting.
The double post does give you a bump though, but when a bump isn't needed it just clutters your thread.

Quote: "I have wondered every once in awhile if the reason FPSC mods crash on me has something to do with my computer itself. Although, aside from the graphics card, it's a pretty ordinary Win 7 machine. Even the graphics card isn't anything too unusual though, just a modified nVidia 9600GSO card. "

A modified video card?
Well, I guess that couldn't be the problem. [/sarcasm]

   Conjured Entertainment

 WARNING: Intense Madness
Ausculta
14
Years of Service
User Offline
Joined: 24th Apr 2010
Location: A place - Things things here, and stuff.
Posted: 25th Jun 2010 18:49
BAM! Narrowing down the issue. I loaded up a one-room level I call "Anime Test Room" that I use for testing character AI, slapped down a trigger zone using this script:


It worked perfectly. Tried the same script in the level it's intended for (Dungeon 1_1)... Nada, doesn't work. This leads me to believe that some script somewhere else in the level is not allowing this script to work. Problem being figuring out which one.
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 25th Jun 2010 18:52 Edited at: 25th Jun 2010 19:01
Quote: "BAM! Narrowing down the issue. I loaded up a one-room level I call "Anime Test Room" that I use for testing character AI, slapped down a trigger zone using this script:... It worked perfectly. Tried the same script in the level it's intended for (Dungeon 1_1)... Nada, doesn't work. This leads me to believe that some script somewhere else in the level is not allowing this script to work. Problem being figuring out which one. "

I'm glad you tested it out by itself, because that is how I tested it and each effect I create.
Once I get it working on its own, then I add it to my level.
That makes the load times for the tests a lot faster too by not having to load the whole level.
Of course, you do have the long wait once you test it after adding it to the level, but you reduce that down to once. (if it works without conflict)

It is the global timer causing the conflict I bet.
So, check all the scripts that use the timer first and I bet you will find it faster.
Another script is probably resetting it faster than this script so it never reaches the timergreater=x condition. (stuck)

Or, you may have another script stuck in a state that is setting the ambience level.
That would override any changes made by any other. (it is how I disable the < and > keys for built games)

So, check that first if there are less of those ambience scripts that the ones affecting the timer.

   Conjured Entertainment

 WARNING: Intense Madness
The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 25th Jun 2010 21:33
Quote: "Or, you may have another script stuck in a state that is setting the ambience level."

I did that once combining trigger zones with ambience scripts and a flashlight.

In case you find my grammar and spelling weird ---> native German speaker ^^
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 26th Jun 2010 02:09
Yes, I do believe Conjured is right. The timer is used for ALL scripts. Several (?) Mods out right now have an "etimer" which is a timer unique to each entity and will prevent it from having these problems. It's great, but if you're not into using a Mod here's what you can do.

- Set up a "timer" script, and have it activate it's if-used every 250 milliseconds (using the global timer)
- Name your ambience scripts the same name as your timer script's if-used.
- Now instead of using "timerstart" and "timergreater" in your scripts, just use "activate=0" (for resetting the activation) and "activated=1" (for checking if activation has occurred)

I've done this a lot of times to overcome that problem before I made a Mod which solved it. The trick is to have that ONE timer script handle the timing for any entities in the level that need it.

Hope that helps.


The one and only,


Ausculta
14
Years of Service
User Offline
Joined: 24th Apr 2010
Location: A place - Things things here, and stuff.
Posted: 26th Jun 2010 18:49
Well, thank you all for the suggestions. I did finally find the source of my problem: a dynamic light near my trigger zone. Once I found it, I couldn't even remember why it was dynamic to begin with, so I just witched over to static mode.

Login to post a reply

Server time is: 2024-11-24 21:54:29
Your offset time is: 2024-11-24 21:54:29