Frictional Games Forum (read-only)

Full Version: Help script not working.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
//===========================================
// 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?
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.
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?
Code:
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.
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?
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.
(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.
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?
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]
You didn't put in the script I had. Both the SetEntityActives are in 1 function...
Pages: 1 2