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
Interesting question, would this work?
SLAMnesia Offline
Member

Posts: 99
Threads: 39
Joined: May 2011
Reputation: 0
#1
Interesting question, would this work?

I have an item "glass_container" that I would like to have usable on more than one entity in a level. heres the script:
void OnStart ()
{
AddUseItemCallback("", "glass_jar", "thing1", "Funk01", false);
}

void Funk01(string &in asItem, string &in asEntity)
{
RemoveItem("glass_jar");
//other stuff
}

How do I get more than one entity named "thing1" for this to work? Or, do I need to make a bunch of callbacks like:
{
AddUseItemCallback("", "glass_jar", "thing1", "Funk01", false);
AddUseItemCallback("", "glass_jar", "thing2", "Funk03", false);
AddUseItemCallback("", "glass_jar", "thing3", "Funk03", false);
}
for each entity I want usable? halp!
07-16-2011, 04:25 AM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#2
RE: Interesting question, would this work?

If every function does same thing, just call same function. If every function does different thing, you can create different functions or in one function like this:

if(asEntity == "thing1")
{
do this;
return;
}

if(asEntity == "thing2")
{
do this;
return;
}

if(asEntity == "thing3")
{
do this;
return;
}

etc.

07-16-2011, 04:32 AM
Website Find
DamnNoHtml Offline
Senior Member

Posts: 469
Threads: 34
Joined: Sep 2010
Reputation: 16
#3
RE: Interesting question, would this work?

Wouldn't putting return in a void function cause an error? Wait nvm, I'm thinking of that in reverse.

Creator of Wake, Through the Portal, Insomnia, and Cycles What to do with HPL3....
07-16-2011, 05:19 AM
Find
SLAMnesia Offline
Member

Posts: 99
Threads: 39
Joined: May 2011
Reputation: 0
#4
RE: Interesting question, would this work?

i dont think this is related to the original question, but I cant use the glass_container on an area :\
07-16-2011, 07:40 AM
Find
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
#5
RE: Interesting question, would this work?

He's not returning anything, if he placed return 1; or similar it'd give an error.

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
07-16-2011, 09:43 AM
Find




Users browsing this thread: 2 Guest(s)