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 - Script always runs no matter what I do

Author
Message
BanjoKid
11
Years of Service
User Offline
Joined: 16th Apr 2013
Location:
Posted: 16th Apr 2013 19:10
Hello. I am trying to use trigger zones to change the skybox image in my game. This is the code I am using (and I saved it in scriptbank).


;Artificial Intelligence Script

;Header

desc = Plr In Zone

;Triggers

:state=0,plrwithinzone=1:state=1,sky=skybank\natural\Rnf

;End of Script





Then I assign it to a trigger zone (Main). Filename is zskyrnf.fpi and I put the script in the scriptbank folder. I think I am using an older FPS creator but heck thats the one I have right now... Problem is, as soon as the game starts, the skybox is already changed to Rnf. It does not wait for me to enter into the trigger zone or anything. How do I keep the script from being executed until I enter the corresponding trigger zone?
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 2nd May 2013 18:16
Plrwithinzone=0:state=0
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 2nd May 2013 19:30
The engine does not allow you to change the skybox while "in-game". You define a skybox in your "setuplevel.fpi". If you define one in a script, this is what happens. The engine starts by assembling the game universe. It reads the sky you specify in the "setuplevel.fpi". Then it will read the scripts. If there is a call for a skybox in a script, it will replace the one defined in the "setuplevel.fpi" with the one in the script. That is why the skybox has changed to the one you specified in the script.

There was some discussions a while ago about how the older version of the engine apparently allowed for the skybox to be changed in-game. I have yet to see which version. I use v1.17 and can tell you that it does not work like that from v1.17 and up. What you can do is change your skyboxes per level by specifying a skybox in the "loadingpage.fpi" for each level. I have outlined the procedure here.


There's no problem that can't be solved without applying a little scripting.
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 2nd May 2013 22:23
@BlackFox
Thanks for the explanation for this problem. I too was just
wondering about this a couple days ago.

Login to post a reply

Server time is: 2024-11-23 14:10:53
Your offset time is: 2024-11-23 14:10:53