Frictional Games Forum (read-only)

Full Version: Why wouldn't this script work?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(in OnStart)
AddEntityCollideCallback("Player", "popout1", "SetEntityActive", false, 0); (When player crosses a script box called popout1, an entity is set active.

then


void SetEntityActive(string& jesus, bool abActive);
{
if(HasItem("scarykey_1") == false) return;
SetEntityActive("jesus");
}

if a player has an item called scarykey_1, this wont happen and it will return to unactive
make entity (a rag doll called jesus) active.

for some reason I receive an error when launching the map.

not sure why.
You can't overload a function with the same return type and parameters. Also, function headers don't end with a semi-colon.
There we go! Thanks! Stupid typing mistakes...

Smile

wait.. still something came up.. sorry

is this what you were saying?

AddEntityCollideCallback("Player", "popout1", "SetEntityActive", false, 0);



void SetEntityActive(string &in Player, string &in popout1, int alState)
{
if(HasItem("scarykey_1");
SetEntityActive("jesus");
}
You know, you don't have to make a new thread for every question
Oh, sorry. I didnt mean to upset anyone. Sad Yeah. I wont do that unless I have to.

but still, yes I have read the tutorial, I am still not to sure what the problem is. I know, I probably seem like the biggest retard on the forum, but when I don't know I'm not sure where else to turn besides here or the script functions page. But even then, sometimes I don't get exactly want to put in the
parameters.
Don't worry man, we've seen the retards on the forum and you're not one of them Wink you're just new to this stuff, and belive me, everybody had trouble getting the scripts to work in the beginning.

(string &in asParent, string &in asChild, int alState)
SetEntityActive(string) does not exist. You're missing the second argument next to "jesus".
ok, so i put that for the void part, but in the {} I have


{
if(HasItem("scarykey_1");
SetEntityActive("jesus");
}

so that if player has a key, then the weird figure will appear (named jesus) I don't see any other way to say that in the callback besides that. Unless theres some weird formula of words lol. I cant find them on the SF page.

Again, thanks for still helping!
SetEntityActive("jesus", true);
ok so, my script now looks like this




AddEntityCollideCallback("Player", "popout2", "SetEntityActive", false, 0); //(this is my second collide callback if that means something. But "SetEntityActive" is only used once.)



void SetEntityActive(string &in asParent, string &in asChild, int alState)
{
if(HasItem("scarykey_1") == false) return;
SetEntityActive("jesus", true);
}


I've looked over this like 9 times now, both on the script functions page and feedback from you guys. And Computer, what do you mean SetEntityAcitve has no (string) it does in the functions page.

(05-30-2012, 04:24 AM)Battlefield3142 Wrote: [ -> ]ok so, my script now looks like this




AddEntityCollideCallback("Player", "popout2", "SetEntityActive", false, 0); //(this is my second collide callback if that means something. But "SetEntityActive" is only used once.)



void SetEntityActive(string &in asParent, string &in asChild, int alState)
{
if(HasItem("scarykey_1") == false) return;
SetEntityActive("jesus", true);
}


I've looked over this like 9 times now, both on the script functions page and feedback from you guys. And Computer, what do you mean SetEntityAcitve has no (string) it does in the functions page.
I made a new script box btw called popout2, thats why thats different.
Pages: 1 2