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
Why wouldn't this script work?
Battlefield3142 Offline
Junior Member

Posts: 13
Threads: 3
Joined: May 2012
Reputation: 0
#1
Why wouldn't this script work?

(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.
05-29-2012, 07:18 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: Why wouldn't this script work?

You can't overload a function with the same return type and parameters. Also, function headers don't end with a semi-colon.

Tutorials: From Noob to Pro
(This post was last modified: 05-29-2012, 07:54 PM by Your Computer.)
05-29-2012, 07:53 PM
Website Find
Battlefield3142 Offline
Junior Member

Posts: 13
Threads: 3
Joined: May 2012
Reputation: 0
#3
RE: Why wouldn't this script work?

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");
}
(This post was last modified: 05-29-2012, 08:12 PM by Battlefield3142.)
05-29-2012, 08:04 PM
Find
Prelauncher Offline
Senior Member

Posts: 451
Threads: 11
Joined: May 2011
Reputation: 13
#4
RE: Why wouldn't this script work?

You know, you don't have to make a new thread for every question

Socialism (noun): A great way to run out of other people's money.
05-29-2012, 08:39 PM
Find
Battlefield3142 Offline
Junior Member

Posts: 13
Threads: 3
Joined: May 2012
Reputation: 0
#5
RE: Why wouldn't this script work?

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.
(This post was last modified: 05-29-2012, 08:51 PM by Battlefield3142.)
05-29-2012, 08:44 PM
Find
Prelauncher Offline
Senior Member

Posts: 451
Threads: 11
Joined: May 2011
Reputation: 13
#6
RE: Why wouldn't this script work?

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)

Socialism (noun): A great way to run out of other people's money.
(This post was last modified: 05-29-2012, 09:22 PM by Prelauncher.)
05-29-2012, 09:11 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#7
RE: Why wouldn't this script work?

SetEntityActive(string) does not exist. You're missing the second argument next to "jesus".

Tutorials: From Noob to Pro
05-29-2012, 09:19 PM
Website Find
Battlefield3142 Offline
Junior Member

Posts: 13
Threads: 3
Joined: May 2012
Reputation: 0
#8
RE: Why wouldn't this script work?

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!
05-29-2012, 09:26 PM
Find
Prelauncher Offline
Senior Member

Posts: 451
Threads: 11
Joined: May 2011
Reputation: 13
#9
RE: Why wouldn't this script work?

SetEntityActive("jesus", true);

Socialism (noun): A great way to run out of other people's money.
05-29-2012, 09:27 PM
Find
Battlefield3142 Offline
Junior Member

Posts: 13
Threads: 3
Joined: May 2012
Reputation: 0
#10
RE: Why wouldn't this script work?

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.
(This post was last modified: 05-30-2012, 04:27 AM by Battlefield3142.)
05-30-2012, 04:24 AM
Find




Users browsing this thread: 4 Guest(s)