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
Help
Tripication Offline
Member

Posts: 172
Threads: 19
Joined: Dec 2011
Reputation: 6
#6
RE: Help

thats ok and No, not really. Heres an example.

void OnStart//YOUR MAIN VOID
{
SetEntityPlayerInteractCallback("ENTITY", "FUNCTION01", (remove after 1 use[true/false]);//THE CALLBACK(EXPECTED TO BE "CALLED BACK" LATER ON)
}


void FUNCTION01(string &in asEntity)//THIS IS THE SYNTAX, THE FUNTION THE SYNTAX PLANS TO USE IS COLOURED WITH AQUA BLUE.

{
SetEntityActive("grunt", true);//THIS IS THE COMMAND THAT WILL BE CALLED, BECAUSE IT IS INSIDE { }, IT MUST HAVE A SEMICOLAN AFTER THE LINE OF CODE(Wink
}








And i'll try to explain a bit more down here.


Starting from the top, The void onstart, is whatever will be loaded AS SOON as the map is loaded.


Then, when the Player(SetEntityPlayerInteractCallback) interacts with a certain entity(SetEntityPlayerInteractCallback) on the map, it will call(SetEntityPlayerInteractCallback)a function. But ONLY when the player interacts with that entity, wich could be in half an hour or 2 minutes. Whenever.

For example.
When a player interacts with a door called CellarDoor, it will call a function(named whatever you want)called SpawnGrunt, and then once it has happened, it will remove that function from the void OnStart once(true)

void OnStart()
{
SetEntityPlayerInteractCallback("CellarDoor", "SpawnGrunt", true);
}

And as for the rest of it(syntax and the Actual function that will spawn the grunt)

void SpawnGrunt(string &in asEntity)
{
SetEntityActive("Grunt", true);
}

Another example for comparison.
In this case, we have a lever named Lever somewhere on the map. If the player interacts with this Lever it will call a function called GiveSanity and that function will NOT be removed ever from the void OnStart because we have the AutoRemoval set to false.

void OnStart
{
SetEntityPlayerInteractCallback("Lever", "GiveSanity", false);
}

The rest of the function(Were using the same callback so its the same syntax, if we were using a different callback, the syntax would be different aswell.)


void GiveSanity(string &in asEntity)
{
GiveSanityBoostSmall();//THIS GIVES THE PLAYER A VERY SMALL SANITY INCREASE
}


I'm sorry if its still very difficult to understand, its not one of the simplest scripts to get around, but give it a day or two of practise and you'll start to really understand it.

Im sorry if there is a bunch of typos and errors in the HTML, thats what happens when you copy and paste from the script functions page, an write long replies
A few more useful tips, make sure you have Debug mode setup so you can reload the map ingame, without having to quit the map and play through until you got to the bit your working on.

And you may very well want to check out Apjjm's Notepad++ plugin, he's a hero.
http://www.frictionalgames.com/forum/thread-9783.html

[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
(This post was last modified: 01-23-2012, 03:39 AM by Tripication.)
01-23-2012, 03:31 AM
Find


Messages In This Thread
Help - by TheDanny942 - 01-23-2012, 02:41 AM
RE: Help - by Tripication - 01-23-2012, 02:46 AM
RE: Help - by TheDanny942 - 01-23-2012, 02:54 AM
RE: Help - by Tripication - 01-23-2012, 02:57 AM
RE: Help - by TheDanny942 - 01-23-2012, 03:07 AM
RE: Help - by Tripication - 01-23-2012, 03:31 AM



Users browsing this thread: 1 Guest(s)