loadEnvironment(""); - Environment Loader

Author Topic: loadEnvironment(""); - Environment Loader  (Read 2867 times)

Basically something that lets you load an environment from a folder where an environment text file is, kinda like SpeedKart when it loads a map.
« Last Edit: August 08, 2014, 11:23:03 AM by Superstarxalien169 »

You can use the environment GUI function to select an environment. EnvGui::SetSky(EnvGui,Number); If you open the GUI itself the first one in the list is 0, the next is 1, etc.

EnvGui::SetSky(EnvGui,Number);
...

this would be EnvGui.SetSky(number);

Not what I meant? Just something that loads an environment .txt file?

this would be EnvGui.SetSky(number);
Duh?

Code: [Select]
function loadEnvironment(%envFile)
{
   if(isFile(%envFile))
   {
      %res = GameModeGuiServer::ParseGameModeFile(%envFile, 1);

      EnvGuiServer::getIdxFromFilenames();
      EnvGuiServer::SetSimpleMode();

      if(!$EnvGuiServer::SimpleMode)     
      {
         EnvGuiServer::fillAdvancedVarsFromSimple();
         EnvGuiServer::SetAdvancedMode();
      }
   }
}
This was taking out of SpeedKart, so this is how it does it. Not 100% sure if it works like this or not, I'm not going to bother testing it.

 
Duh?

Code: [Select]
function loadEnvironment(%envFile)
{
   if(isFile(%envFile))
   {
      %res = GameModeGuiServer::ParseGameModeFile(%envFile, 1);

      EnvGuiServer::getIdxFromFilenames();
      EnvGuiServer::SetSimpleMode();

      if(!$EnvGuiServer::SimpleMode)     
      {
         EnvGuiServer::fillAdvancedVarsFromSimple();
         EnvGuiServer::SetAdvancedMode();
      }
   }
}
This was taking out of SpeedKart, so this is how it does it. Not 100% sure if it works like this or not, I'm not going to bother testing it.
In some of this, you are calling a method on an object, and should use object.method(); instead of object::method(); . (I'm pretty sure about this, not 100% though)

Duh?

So why the hell are you doing object::method( object ) ? Ever heard of object.method( ) ?

In some of this, you are calling a method on an object, and should use object.method(); instead of object::method(); .
This was taking out of SpeedKart, so this is how it does it. Not 100% sure if it works like this or not, I'm not going to bother testing it.
Taken directly out of SpeedKart, so Object::Method should work fine in this case.

So why the hell are you doing object::method( object ) ? Ever heard of object.method( ) ?
Does it matter that much? The only difference is you don't have to add the extra object.

Not what I meant? Just something that loads an environment .txt file?

So why the hell are you doing object::method( object ) ? Ever heard of object.method( ) ?

Because it's just a namespace. There is no object.

I have an addon that lets you save and load environments. The topic link is broken, but Ive re-uploaded it if you want it.

https://www.mediafire.com/?jclls7rkndi2mpo
Still works fine for me.

I have an addon that lets you save and load environments. The topic link is broken, but Ive re-uploaded it if you want it.

https://www.mediafire.com/?jclls7rkndi2mpo
Still works fine for me.

Thanks! Just what I was wanting!

locking