The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Script/area problem.
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#1
RE: Script/area problem.

Are you sure there isn't a bug in the script itself? The fact that AddPropForce() works only means that OnStart() get's called, it doesn't tell you anything about the other functions. There could be other subtle errors.

For example, here:
PHP Code: (Select All)
AddEntityCollideCallback("Player""area""cake"false0); 

Are you sure that the first script area is named "area" in the editor?

You can use AddDebugMessage() to check which functions get called when. If a callback should be called but isn't, then it means that it wasn't hooked up correctly. Something along these lines:

PHP Code: (Select All)
// Debugging using AddDebugMessage()

void OnStart()
{
    
AddDebugMessage("In OnStart()."false);   // The message will be displayed in the lower left corner
   
    
AddPropForce ("rope_beam02_Body_1"50000"world");  
    
PlayMusic("12_amb.ogg"true0.811true);   
    
AddEntityCollideCallback("Player""area""cake"false0);
}

void cake(string &in asParentstring &in asChildint alState)
{
    
AddDebugMessage("In cake()."false);

    
SetEntityActive("suitor"true);   
    
AddEnemyPatrolNode("suitor""PathNode1"0"");   
    
AddEnemyPatrolNode("suitor""PathNode2"0""); 
    
AddEntityCollideCallback("suitor""ScriptArea_1""cake1"false1);
}

void cake1(string &in asParentstring &in asChildint alState)
{
    
AddDebugMessage("In cake1()."false);
    
SetEntityActive("suitor"false);

(This post was last modified: 01-07-2013, 02:30 PM by TheGreatCthulhu.)
01-07-2013, 02:28 PM
Find


Messages In This Thread



Users browsing this thread: 1 Guest(s)