Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Crashes The Game
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#12
RE: Script Crashes The Game

SOLVED.

The problem was indeed an infinite loop. Due to a problem with both the if-statement and the contents of it in the function Amn pointed out, it caused a loop that never ended, ultimately being too much for the engine to handle.

In my case, I solved it by implementing a new way of searching for areas that hadn't already been shooting steam. I did this like this:

PHP Code: (Select All)
void RunSteamFlow(int alEventCount){
    
int iSteamArea RandInt(16);
    
int RunCount alEventCount;
    
        if(
GetLocalVarInt("iBlockedSteamArea_"+iSteamArea) == 1){
            if(
iSteamArea && GetLocalVarInt("SteamFlowCountDirection") == 0){
                  
//SteamFlowCountDirection determines whether to add or subtract from the number that has already been used in SteamEvent();. 0 = Add, 1 = Subtract.
                
SetLocalVarInt("iSteamAreaRecount"iSteamArea 1);
                                
//Add 1 to the integer to search for an unoccupied number.
                
RunSteamFlow(RunCount);
                                
//Run the function again to keep searching for numbers until a useable one is found.
            
}
            else{
                
SetLocalVarInt("SteamFlowCountDirection"1);
                                
//Changes the SteamFlowCountDirection so the number being manipulated is being subtracted from instead.
                
SetLocalVarInt("iSteamAreaRecount"iSteamArea 1);
                                
//Subtract 1 from the integer to search for an unoccupied number.
                
RunSteamFlow(RunCount);
                                
//Run the function again to keep searching for numbers until a useable one is found.
            
}
            
            
iSteamArea GetLocalVarInt("iSteamAreaRecount");
        }
        else{
            
SteamEvent(iSteamArea);
        }
        
    
SetLocalVarInt("SteamFlowCountDirection"0);


Also, Mudbill, I'll gladly take a look at your script to see if I can help you out. I'd happily help someone so dedicated to educate this community!

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
(This post was last modified: 03-14-2014, 08:57 AM by Wapez.)
03-14-2014, 08:54 AM
Find


Messages In This Thread
Script Crashes The Game - by Wapez - 03-11-2014, 01:54 PM
RE: Script Crashes The Game - by PutraenusAlivius - 03-11-2014, 02:34 PM
RE: Script Crashes The Game - by Wapez - 03-11-2014, 02:39 PM
RE: Script Crashes The Game - by PutraenusAlivius - 03-11-2014, 02:43 PM
RE: Script Crashes The Game - by Wapez - 03-11-2014, 02:57 PM
RE: Script Crashes The Game - by Mudbill - 03-11-2014, 03:12 PM
RE: Script Crashes The Game - by Daemian - 03-11-2014, 03:15 PM
RE: Script Crashes The Game - by Wapez - 03-11-2014, 03:40 PM
RE: Script Crashes The Game - by Mudbill - 03-11-2014, 09:09 PM
RE: Script Crashes The Game - by Daemian - 03-12-2014, 01:22 AM
RE: Script Crashes The Game - by Mudbill - 03-13-2014, 09:27 PM
RE: Script Crashes The Game - by Wapez - 03-14-2014, 08:54 AM
RE: Script Crashes The Game - by Mudbill - 03-14-2014, 02:59 PM
RE: Script Crashes The Game - by Wapez - 03-14-2014, 03:56 PM
RE: Script Crashes The Game - by Apfel - 03-14-2014, 04:35 PM
RE: Script Crashes The Game - by Wapez - 03-14-2014, 04:42 PM
RE: Script Crashes The Game - by Apfel - 03-14-2014, 05:31 PM
RE: Script Crashes The Game - by Wapez - 03-14-2014, 05:36 PM
RE: Script Crashes The Game - by Mudbill - 03-14-2014, 05:49 PM



Users browsing this thread: 1 Guest(s)