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
CathTool / Omnitool scripting error
Abion47 Offline
Senior Member

Posts: 369
Threads: 22
Joined: Oct 2015
Reputation: 46
#6
RE: CathTool / Omnitool scripting error

I never did any coding for TDD (much to my regret), so I can't say how the system for SOMA compares. For trigger functions though, you want to put the name of the entity/entities that will be triggering collisions for the trigger areas in the CC_Entities field. Either put the name of a specific entity, like "meat_bag", or use a wildcard (*) to specify any entity whose name follows the pattern. For example, putting "ball*" in the CC_Entities field will cause it to trigger off of any entity whose name starts with "ball", like "ball_01", "ball_glass", or "ball_avalanche". (If you want it to trigger with the player, put "player".)

Next, you put the name of your function that will handle the collision in the CC_Funcs field, such as "ExitLevelArea_OnCollide". When you put a name, you can press the copy button to automatically put the necessary code in your clipboard, which you can then paste into your script file. The code will look like this:

bool ExitLevelArea_OnCollide(const tString &in asParent, const tString &in asChild, int alState)
{
    return true;
}
  • asParent: The name of the area that was collided with.
  • asChild: The name of the colliding entity.
  • alState: The state of the collision. (1 means the entity entered the area; -1 means the entity left the area)
  • return true: If the function returns false, the area will remove this callback, meaning this function will not be triggered by any future collisions.

You had the right idea with your SlideDoor_SetClosed, but your function call syntax is off. When you call a function, you need only the name of the functions and the values that you wish to be passed. In this case, you want to pass two things - the name of the door you want to change, and whether you want it to be closed or open. The syntax would look like this:

bool ExitLevelArea_OnCollide(const tString &in asParent, const tString &in asChild, int alState)
{
    SlideDoor_SetClosed("finaldoor", true);
    return true;
}

(In case you were wondering, SlideDoor_SetClosed does have a third parameter, but by default it is set to false, which makes it into what is known as an optional parameter. This parameter "abInstant" is whether you want the door to play its closing animation [false] or if you want it to instead immediately change to its closed state [true].)
11-02-2015, 09:05 PM
Find


Messages In This Thread
RE: CathTool / Omnitool scripting error - by Abion47 - 11-02-2015, 09:05 PM



Users browsing this thread: 1 Guest(s)