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
Custom Stories I want to do but unable to
The Rock Worm Offline
Senior Member

Posts: 714
Threads: 83
Joined: Nov 2011
Reputation: 16
#8
RE: Custom Stories I want to do but unable to

(02-05-2013, 04:46 PM)Adrianis Wrote:
(02-05-2013, 04:11 PM)The Rock Worm Wrote: Now let's see if I understand this correctly. Let's say we have a script coding called "RandomNotes". I then make a the script area in the LevelEditor (represented by a red box) also called "RandomNotes". Would this mean the coding knows to start once you enter the script area of the same name?

Ohhh, thats what you meant by script box Tongue Ignore what I said then.

There are two ways of 'connecting' a script area to a piece of code.
Lets say you have a function called 'RandomNotes', and the script area called 'SA_RandomNotes' (the SA stands for 'script area', to make it obvious what it is)
For me, the simplest way to connect these two is like this...

void OnStart()
{
AddEntityCollideCallback("Player", "SA_RandomNotes", "RandomNotes", true, 0);
}

void RandomNotes(string &in strParent, string &in strChild, int inState)
{
// stuff happens when you go into script area
}

The line in OnStart, 'AddEntityCollideCallback', basically means that when the first item on the list ("Player") comes into contact with the second ("SA_RandomNotes"), it 'activates' (or, 'calls') the function named in the third ("RandomNotes").

The other way of doing it is within the level editor, if you select the script area and go to the 'Area' tab (think its called area, sorry at work at the moment so can't check!), you can add the collide callback by writing the function name that you want to activate into the appropriate box. This I don't personally like, as it makes things more complicated if you want to change the function names (you'll need to remember to change them in the level editor too, rather than just the hps)

Wow! Thank you! This really helps in explaining how to 'connect' the two together! Big Grin

Whenever you're not busy, maybe we can work on this (if you need help with the game your working on, let me know and I can see what I can do.)
02-05-2013, 04:58 PM
Find


Messages In This Thread
RE: Custom Stories I want to do but unable to - by The Rock Worm - 02-05-2013, 04:58 PM



Users browsing this thread: 1 Guest(s)