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
How to activate entities ??
FinBanana Offline
Junior Member

Posts: 29
Threads: 4
Joined: Jan 2012
Reputation: 0
#1
Sad  How to activate entities ??

I have a problem. Again.. lol : D
But yeah, about the problem:
I have a room that has a key in it. When I pick up the key, the script is supposed to create a couple of those knight armours in the hallway outside the room. They just don't appear when I pick up the key.
I wish someone could tell how to make entities appear when a specific action is done.

Thanks.
01-31-2012, 07:51 PM
Find
Prelauncher Offline
Senior Member

Posts: 451
Threads: 11
Joined: May 2011
Reputation: 13
#2
RE: How to activate entities ??

Are you using: SetEntityActive(string& asName, bool abActive);

Socialism (noun): A great way to run out of other people's money.
01-31-2012, 07:53 PM
Find
FinBanana Offline
Junior Member

Posts: 29
Threads: 4
Joined: Jan 2012
Reputation: 0
#3
RE: How to activate entities ??

(01-31-2012, 07:53 PM)Prelauncher Wrote: Are you using: SetEntityActive(string& asName, bool abActive);
Yeah.
01-31-2012, 08:06 PM
Find
Prelauncher Offline
Senior Member

Posts: 451
Threads: 11
Joined: May 2011
Reputation: 13
#4
RE: How to activate entities ??

Ok. would be a bit easier if I could see your script Wink but are you using this line for when the player pick up the key: SetEntityCallbackFunc(string& asName, string& asCallback);
Calls a function when the player interacts with a certain entity.
Callback syntax: void MyFunc(string &in asEntity, string &in type)
Type depends on entity type and includes: “OnPickup”, “Break”, “OnIgnite”, etc

Socialism (noun): A great way to run out of other people's money.
(This post was last modified: 01-31-2012, 08:19 PM by Prelauncher.)
01-31-2012, 08:19 PM
Find
FinBanana Offline
Junior Member

Posts: 29
Threads: 4
Joined: Jan 2012
Reputation: 0
#5
RE: How to activate entities ??

(01-31-2012, 08:19 PM)Prelauncher Wrote: Ok. would be a bit easier if I could see your script Wink but are you using this line for when the player pick up the key: SetEntityCallbackFunc(string& asName, string& asCallback);
Calls a function when the player interacts with a certain entity.
Callback syntax: void MyFunc(string &in asEntity, string &in type)
Type depends on entity type and includes: “OnPickup”, “Break”, “OnIgnite”, etc
Here it is:
The bolded lines are the ones that should create the armors.
Lines 1-23


void OnStart()
{
AddUseItemCallback("", "key_study_1", "castle_7", "UsedKeyOnDoor2", true);
AddUseItemCallback("", "KeyOH", "castle_4", "UsedKeyOnDoor1", true);
AddUseItemCallback("", "KeyOH", "castle_6", "UsedKeyOnDoor1", true);
AddUseItemCallback("", "key_study_2", "castle_8", "UsedKeyOnDoor3", true);
AddUseItemCallback("", "key_study_3", "castle_9", "UsedKeyOnDoor4", true);
AddUseItemCallback("", "key_study_3", "castle_10", "UsedKeyOnDoor5", true);
AddUseItemCallback("", "key_study_4", "castle_12", "UsedKeyOnDoor6", true);
AddUseItemCallback("", "key_laboratory_1", "castle_11", "UsedKeyOnDoor7", true);
AddUseItemCallback("", "key_1tohall", "1tohall_1", "UsedKeyOnLevelDoor1", true);
SetEntityPlayerInteractCallback("key_study_2", "Pickup1", true);
SetEntityPlayerInteractCallback("key_study_3", "Scare3", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "Scare1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Scare2", true, 1);
}

void Pickup1(string& asName, bool abActive)
{
SetEntityActive("armor1", true);
SetEntityActive("armor2", true);
SetEntityActive("armor3", true);
}


(This post was last modified: 01-31-2012, 08:29 PM by FinBanana.)
01-31-2012, 08:28 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#6
RE: How to activate entities ??

Im not 100% sure,but try putting each of them into their own voids.
01-31-2012, 08:29 PM
Find
FinBanana Offline
Junior Member

Posts: 29
Threads: 4
Joined: Jan 2012
Reputation: 0
#7
RE: How to activate entities ??

(01-31-2012, 08:29 PM)Datguy5 Wrote: Im not 100% sure,but try putting each of them into their own voids.
you mean like having 3 different 'SetEntityPlayerInteractCallback' lines
and then the first one calls for void Pickup1 and the second one Pickup2 and so on?
01-31-2012, 08:37 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: How to activate entities ??

Pickup1 has the wrong callback syntax.

Tutorials: From Noob to Pro
01-31-2012, 08:43 PM
Website Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#9
RE: How to activate entities ??

(01-31-2012, 08:37 PM)FinBanana Wrote:
(01-31-2012, 08:29 PM)Datguy5 Wrote: Im not 100% sure,but try putting each of them into their own voids.
you mean like having 3 different 'SetEntityPlayerInteractCallback' lines
and then the first one calls for void Pickup1 and the second one Pickup2 and so on?
I don't think that will help, Try first with only armor1 and see if it appears. And btw have you renamed the armor to armor1 armor2 etc?

EDIT: As YourComputer said

(This post was last modified: 01-31-2012, 08:49 PM by SilentStriker.)
01-31-2012, 08:43 PM
Find
FinBanana Offline
Junior Member

Posts: 29
Threads: 4
Joined: Jan 2012
Reputation: 0
#10
RE: How to activate entities ??

(01-31-2012, 08:43 PM)Your Computer Wrote: Pickup1 has the wrong callback syntax.
What it should be then ?
(01-31-2012, 08:43 PM)SilentStriker Wrote:
(01-31-2012, 08:37 PM)FinBanana Wrote:
(01-31-2012, 08:29 PM)Datguy5 Wrote: Im not 100% sure,but try putting each of them into their own voids.
you mean like having 3 different 'SetEntityPlayerInteractCallback' lines
and then the first one calls for void Pickup1 and the second one Pickup2 and so on?
I don't think that will help, Try first with only armor1 and see if it appears. And btw have you renamed the armor to armor1 armor2 etc?
Yeah, when I put them in the map they were something like "armour_nice_complete1" so I changed their names to only "armor1" and 2 and 3

(This post was last modified: 01-31-2012, 08:46 PM by FinBanana.)
01-31-2012, 08:44 PM
Find




Users browsing this thread: 2 Guest(s)