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
Adding Scripts?
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Adding Scripts?

Oh, haha Smile

See, when you downloaded the maps, did you notice these .hps files?

These are what you're looking for. I recommend having a program like Geany. It'll help you with colors and such when you're scripting, but notepad is ok too. Download Geany though. It'll help you.

What you do is, you start with an empty text file.
Then you write this:
PHP Code: (Select All)
void OnStart()
{

}
void OnEnter()
{

}
void OnLeave()
{




This has to be in the file, for it to work.

Now save the file, but change the extension from .txt to .hps.
Save it in the maps folder of your custom story and call it the same as the corresponding map.

A script is always defined inside brackets like these { }
It's important to keep all script lines inside brackets.
These scripts can only be triggered if they're in a function.

NOTE: A function is one sequence of script lines, created by a name, parameters and two brackets.
Help with parameters: http://www.frictionalgames.com/forum/thread-18368.html

If you're having any more problems with scripting, please DO ask!


Also... Questions about scripting and Level Editing usually goes here: http://www.frictionalgames.com/forum/forum-39.html

Trying is the first step to success.
(This post was last modified: 09-24-2013, 10:13 PM by FlawlessHappiness.)
09-24-2013, 10:07 PM
Find


Messages In This Thread
Adding Scripts? - by schwem00 - 09-24-2013, 09:42 PM
RE: Adding Scripts? - by FlawlessHappiness - 09-24-2013, 10:07 PM
RE: Adding Scripts? - by schwem00 - 09-24-2013, 11:37 PM
RE: Adding Scripts? - by CarnivorousJelly - 09-25-2013, 03:57 AM
RE: Adding Scripts? - by FlawlessHappiness - 09-25-2013, 07:08 AM



Users browsing this thread: 1 Guest(s)