Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: [GM6] Won't Declare a Variable  (Read 1038 times)

0 Members and 1 Guest are viewing this topic.

PoeFacedKilla

Prussian Killer Bee
[GM6] Won't Declare a Variable
« on: April 06, 2009, 02:34:04 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 269
I'm trying, to load a sprite from a .sav file.  But the variable won't declare:

Code: [Select]
{

   
    ini_open('1.sav');
    box_color = ini_read_string('Character','sprite','1');
   
    ini_close();
   

   
}

and then under create for the object:

Code: [Select]
{

    if( box_color == "1" )
    {
    sprite_index = sprite_red;
    }

   
}

but it says unknown variable.
Logged
the Indyboard - User Generated Social Forum | Now With Even More Discussion!
Poe, The Independent Programmer
  • Zelda Shrine
Re: [GM6] Won't Declare a Variable
« Reply #1 on: April 06, 2009, 06:59:14 am »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Posts: 728
What variable is unknown? Where does the first script you posted exist in? Is it a separate script? Is it in the step event?
Logged
  • Pyxosoft
Re: [GM6] Won't Declare a Variable
« Reply #2 on: April 06, 2009, 10:50:54 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1141
Try using "global.box_color" in both codes.
(EDIT: Or refer from which object you're getting this variable.)
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.065 seconds with 40 queries.