Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Problem. Please help.
mitkovarn Offline
Junior Member

Posts: 9
Threads: 2
Joined: Apr 2013
Reputation: 0
#1
Script Problem. Please help.

So hello guys i write few scripts for kind of func wich when the player enter in a script area he will become inactive and the enemy(inactive) will became active (following one path node) (with disabled triggers) and when it get to this path node it will be disabled and the player will become active. so the problem is this: at the start everything works fine (the cs is starting normaly)but when i enter in the script area it does not activate the script to set me inactive and set active the enemy } everything is good in the editor (the name of the script area is same with the name in the script file and the area is set to "active".So here are the codes : Huh you can see on the picture that i am in the zone but i dont actualy work Sad

void OnStart()
{
AddEntityCollideCallback("Player", "Scripts1", "Scripts1", true, 1);
}

void Scripts1(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
SetEntityActive("brute1", true);
PlaySoundAtEntity("", "amb_idle01", "brute1", 0, false);
AddEnemyPatrolNode("brute1", "PathNode1", 1, "");
SetEntityActive("brute1", false);
SetPlayerActive(true);
}
void OnLeave()
{
}

please help ill be very happy Smile


Attached Files
.png   Untitled.png (Size: 319.2 KB / Downloads: 99)
(This post was last modified: 01-09-2014, 06:21 PM by mitkovarn.)
01-09-2014, 06:19 PM
Find
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#2
RE: Script Problem. Please help.

the script does work, but when you make something active and inactive in the same function, it will look like nothing happened.

try adding another area for the monster to collide with, on the pathnode that the monster reaches

void OnStart()
{
AddEntityCollideCallback("Player", "Scripts1", "Scripts1", true, 1);
AddEntityCollideCallback("monster_name", "are_name", "func", true, 1);
}

void Scripts1(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
SetEntityActive("brute1", true);
PlaySoundAtEntity("", "amb_idle01", "brute1", 0, false);
AddEnemyPatrolNode("brute1", "PathNode1", 1, "");
}

void func(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("brute1", false);
SetPlayerActive(true);
}

CURRENT PROJECT:
A Fathers Secret == Just started
(This post was last modified: 01-09-2014, 06:39 PM by Lizard.)
01-09-2014, 06:39 PM
Find
mitkovarn Offline
Junior Member

Posts: 9
Threads: 2
Joined: Apr 2013
Reputation: 0
#3
RE: Script Problem. Please help.

Thank you soo much i really appreciate it Tongue
01-09-2014, 07:01 PM
Find




Users browsing this thread: 1 Guest(s)