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 Help Using Global.hps to use a script in every level
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#8
RE: Using Global.hps to use a script in every level

(05-14-2013, 03:08 PM)JustAnotherPlayer Wrote: Um no. I've seen some scripts where the global.hps is used for scripting.

nvm statyk says so

*edit*

I just tried to do some class type thing and it doesn't seem to work in the global sense. Which is what you were going for, I suppose. Now, you could just copy&paste the class to each script file, but that might be arduous/sloppy/beyond the scope of practicality.

PHP Code: (Select All)
class TestClass
{
  
//Constructor, basically an OnStart
  
TestClass()
  {
    
//This is called when you create an instance of this class
  
}

  
//You can put methods etc beyond this
  //Example of a method
  
void/whatever return type Method(parameters etc)
   {
    
//Do stuff and things
    
}

}

void OnStart() //The actual game script starts here, like always
{
  
//Create an instance of the TestClass class
  
TestClass TestingClass//You can do this outside of OnStart etc, I believe
  
   //You can call methods like so
   
TestingClass.Method(arguments etc)


Like I said, beyond the scope of practicality.
(This post was last modified: 05-14-2013, 07:22 PM by Tomato Cat.)
05-14-2013, 04:58 PM
Find


Messages In This Thread
RE: Using Global.hps to use a script in every level - by Tomato Cat - 05-14-2013, 04:58 PM



Users browsing this thread: 1 Guest(s)