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
Help script not working.
slamer80 Offline
Junior Member

Posts: 13
Threads: 3
Joined: Mar 2011
Reputation: 0
#1
Help script not working.

//===========================================
// Starter's Script File!
//===========================================

//===========================================
// This runs when the map first starts


void OnStart()
{

AddEntityCollideCallback("Player" , "Scriptarea_2" , "MonsterFunc1" , true , 1);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_Brute_2" , true);
}


{

AddEntityCollideCallback("Player" , "Scriptarea_3" , "MonsterFunc1" , true , 1);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_Brute_3" , true);
}


When i enter the map, the game crashes? What am i doing wrong?
03-28-2011, 08:30 PM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#2
RE: Help script not working.

Two problems: you call MonsterFunc1 twice (make the other MonsterFunc2 or something), and AddEntityCollideCallback("Player" , "Scriptarea_3" , "MonsterFunc1" , true , 1); is not in a function, also it should be something else since you shouldn't call the function twice.
03-28-2011, 09:04 PM
Find
slamer80 Offline
Junior Member

Posts: 13
Threads: 3
Joined: Mar 2011
Reputation: 0
#3
RE: Help script not working.

Can you show me how it should be done?

I want 2 brutes to be spawned in 2 area triggers, 1 brute each area. If its possible?
03-28-2011, 09:13 PM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#4
RE: Help script not working.

void OnStart()
{

AddEntityCollideCallback("Player" , "Scriptarea_1" , "MonsterFunc1" , true , 1);
AddEntityCollideCallback("Player" , "Scriptarea_2" , "MonsterFunc2" , true , 1);
}

void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_Brute_2" , true);
}

void MonsterFunc2(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_Brute_3" , true);
}

Like that. Makes sure your areas and brutes are named properly though.
(This post was last modified: 03-28-2011, 09:19 PM by MrBigzy.)
03-28-2011, 09:18 PM
Find
slamer80 Offline
Junior Member

Posts: 13
Threads: 3
Joined: Mar 2011
Reputation: 0
#5
RE: Help script not working.

Both of the brute got activated in area trigger 1. But i need a trigger to each one, example: Areatrigger 1, activates brute 1, and areatrigger 2, activates brute2. like that i want it, can you do that?
03-28-2011, 09:32 PM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#6
RE: Help script not working.

Err, that means both those areas were in the same place, or both brutes were in the same place. The script makes one spawn when you enter Scriptarea_1 and the other spawn when you enter Scriptarea_2, so it's up to you to place the area and the brutes where you need them to be.
(This post was last modified: 03-29-2011, 12:04 AM by MrBigzy.)
03-29-2011, 12:02 AM
Find
slamer80 Offline
Junior Member

Posts: 13
Threads: 3
Joined: Mar 2011
Reputation: 0
#7
RE: Help script not working.

(03-29-2011, 12:02 AM)MrBigzy Wrote: Err, that means both those areas were in the same place, or both brutes were in the same place. The script makes one spawn when you enter Scriptarea_1 and the other spawn when you enter Scriptarea_2, so it's up to you to place the area and the brutes where you need them to be.

Yes, but they are seperate. When i enter area 2, nothing happens. After when i enter area 1 they both spawn at the same time, in 2 different locations.

I first entered area 2, THEN area 1.
(This post was last modified: 03-29-2011, 06:48 PM by slamer80.)
03-29-2011, 06:46 PM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#8
RE: Help script not working.

Won't matter what order you enter them. But the problem has something to do with the naming, unless you put the script in wrong. Can you post your script?
03-29-2011, 06:55 PM
Find
slamer80 Offline
Junior Member

Posts: 13
Threads: 3
Joined: Mar 2011
Reputation: 0
#9
RE: Help script not working.

void OnStart()
{

AddEntityCollideCallback("Player" , "Scriptarea_1" , "MonsterFunc1" , true , 1);
AddEntityCollideCallback("Player" , "Scriptarea_2" , "MonsterFunc2" , true , 1);
}

void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_Brute_2" , true);
SetEntityActive("servant_Brute_1" , true);
}

[Image: unavngivetfc.png]
03-30-2011, 04:34 PM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#10
RE: Help script not working.

You didn't put in the script I had. Both the SetEntityActives are in 1 function...
(This post was last modified: 03-30-2011, 05:11 PM by MrBigzy.)
03-30-2011, 05:10 PM
Find




Users browsing this thread: 2 Guest(s)