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
aBadScripter Offline
Junior Member

Posts: 4
Threads: 1
Joined: Oct 2015
Reputation: 0
#7
RE: CathTool / Omnitool scripting error

(11-02-2015, 09:05 PM)Abion47 Wrote: 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].)

TDD scripting was a much more... Simplified version of what SOMA's scripting is. At least at the time I had started scripting for TDD, the game had been out for a year already; so there were many tutorials on how to do pretty much everything, whereas with SOMA and this much more of a complex coding with little to no tutorials, I've been struggling quite a bit. I had many, many things down with TDD within' a few weeks. I've been looking in the game coding and I'm trying to learn some of the stuff, but there's so much code to look at that I tend to get lost. But I feel with over time, I'll get the hang of this coding.

It's really nice seeing all of this described to me in such a way that I can understand it perfectly. This test map I'm doing had been really bugging me because I couldn't find out how to do anything. I had originally protested on posting on the forums because I wanted to figure it out by myself, but eventually I gave in.

I can't thank you enough for your help, and with your amazing explanations. Thank you so much! Big Grin Big Grin
11-05-2015, 06:19 AM
Find


Messages In This Thread
RE: CathTool / Omnitool scripting error - by aBadScripter - 11-05-2015, 06:19 AM



Users browsing this thread: 1 Guest(s)