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
#14
RE: Script Crashes The Game

(03-14-2014, 02:59 PM)Mudbill Wrote: Do you understand what's going on here? Any ideas? Undecided

After going through it really briefly, your script looks fine to me. However, while trying it in my head, I noticed that sometimes a co-ordinate will result in containing a zero in one of it's numbers. Like this:

Spoiler below!

PHP Code: (Select All)
bool bWestbEastbNorthbSouth;

void AttachSlate(string &in asAreastring &in asBodyName)
{    
    if(
StringContains(asBodyName"west") == truebWest true; else bWest false;
    if(
StringContains(asBodyName"east") == truebEast true; else bEast false;
    if(
StringContains(asBodyName"north") == truebNorth true; else bNorth false;
    if(
StringContains(asBodyName"south") == truebSouth true; else bSouth false;
    
    
//bWest == true
    //bEast == true
    //bNorth == false
    //bSouth == false
    
    
for(int x=1<= 5; ++x) for(int y=1<= 5; ++y) {
                
        
string sThisArea "area_x"+x+"y"+y;
        
string sThisDoor "move_";
            
        if(
bWest  == truesThisDoor sThisDoor +"x" + --x; else sThisDoor sThisDoor +"x" +x;
        
//move_x0
        
if(bNorth == truesThisDoor sThisDoor +"y" + --y; else sThisDoor sThisDoor +"y" +y;
        
//move_x0y1
        
if(bEast  == truesThisDoor sThisDoor +"_x"+ ++x; else sThisDoor sThisDoor +"_x"+x;
        
//move_x0y1_x2
        
if(bSouth == truesThisDoor sThisDoor +"y" + ++y; else sThisDoor sThisDoor +"y" +y;
        
//move_x0y1_x2y1
        
        
if(asArea == sThisArea) {
            
UpdateDoors(sThisDoor1);
            
//UpdateDoors("move_x0y1_x2y1", 1);

            
AddDebugMessage("Area: " sThisAreafalse);
            
AddDebugMessage("Door: " sThisDoorfalse);
        }
    }
    
    
bWest false;
    
bEast false;
    
bNorth false;
    
bSouth false;
}

void UpdateDoors(string &in asDoorint alState)
{
    
AddDebugMessage("Updating Door: " asDoorfalse);
    
SetMoveObjectState(asDooralState);
    
//SetMoveObjectState("move_x0y1_x2y1, 1);



This isn't what's causing your crashes, but it's a bug (unless I'm too tired and sick to be able to think straight), since I'm guessing you don't have a door named like that.

I'll keep looking for a possible cause to your problems and I'll let you know if I find something.

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
03-14-2014, 03:56 PM
Find Reply


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)