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
Problem with function activation [Script help]
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#1
Problem with function activation [Script help]

PHP Code: (Select All)
////////////////////////////
// Run first time starting map
void OnStart()
{
    
//Add the Lantern and 10 Tinderboxes when in Debug mode, always good to have light!
    
if(ScriptDebugOn())
    {
        
GiveItemFromFile("lantern", "lantern.ent");
 
        for(
int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
    }
    
    
SetEntityPlayerInteractCallback("Key_1", "HammerScare", true);
    
AddUseItemCallback("", "Key_1", "mansion_1", "UsedKeyOnDoor", true);
    
AddEntityCollideCallback("Player","script_chairscare","ChairScare", false, 1);
    
AddEntityCollideCallback("Player","script_GruntScare","GruntScare",false,1);
    for (
int x = 1; x < 23; x++) {
        
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_"+x, 0, "");
        }
    
AddEntityCollideCallback("servant_grunt_1", "ScriptArea_1", "Reverse", false, 1);
}

void Reverse() {
    for (
int x = 23; x > 1; x--) {
        
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_"+x, 0, "");
        }
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
    
SetSwingDoorLocked(asEntity,false,true);
    
PlaySoundAtEntity("","unlock_door", asEntity, 0, false);
    
RemoveItem(asItem);
}

void HammerScare(string &in entity, string &in type)
{
  
AddPropImpulse("sledge_1", 30, 5, 20, "world");
}

void ChairScare(string &in asParent, string &in asChild, int alState)
{
  
//SetEntityActive("chairscare",false);
  
AddPropImpulse("chairscare", 0, 0, -25, "world");
}

void GruntScare(string &in asParent, string &in asChild, int alState)
{
    
SetEntityActive("servant_grunt_ragdoll_1",true);
    
AddPropForce("mansion_3", 0, 0, 50, "world");
    
SetSwingDoorClosed("mansion_3",false,true);
    
PlaySoundAtEntity("","react_scare","Player",0,false);
    
AddPropImpulse("servant_grunt_ragdoll_1", 0, 0, 25, "world");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
 
}
 
////////////////////////////
// Run when leaving map
void OnLeave()
{
 
} 

The problem is that when i activate the gruntscare the door doesnt close, or the grunt doesnt appear. I cant see the error, can anyone else?

Rep if like me or im helpful or you love my stories!
Stephanos house
(This post was last modified: 10-01-2011, 06:16 AM by Gamemakingdude.)
10-01-2011, 06:15 AM
Find


Messages In This Thread
Problem with function activation [Script help] - by Gamemakingdude - 10-01-2011, 06:15 AM



Users browsing this thread: 1 Guest(s)