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
Short question: SetEntityActive for ScriptAreas?
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#1
Short question: SetEntityActive for ScriptAreas?

As the title says, is there any kind of similar function like "SetEntityActive" but for ScriptAreas? I would like the player to walk down a corridor, go into a room, pick something up and then walk back and he hears a sound. Is this possible?
(This post was last modified: 02-03-2013, 09:47 PM by Tiger.)
02-03-2013, 09:21 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: Short question: SetEntityActive for ScriptAreas?

SetEntityActive works for areas too.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
02-03-2013, 09:24 PM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#3
RE: Short question: SetEntityActive for ScriptAreas?

ok, thanks ^^
02-03-2013, 09:46 PM
Find
GoranGaming Offline
Member

Posts: 183
Threads: 30
Joined: Feb 2012
Reputation: 7
#4
RE: Short question: SetEntityActive for ScriptAreas?

You could also use Variabels:

void OnStart()
{
SetEntityCallbackFunc("ItemYouWantToPickUp", "PickupItem");
AddEntityCollideCallback("Player", "CollideArea", "CollideArea", false, 0);
SetLocalVarInt("RandomName", 0);
}

void PickupItem(string &in asEntity, string &in OnPickup)
{
SetLocalVarInt("RandomName", 1);
}

void CollideArea(string &in asEntity, string &in asChild, int alState)
{
if(GetLocalVarInt("RandomName")==1)
{
PlaySoundAtEntity(blablabla);
}
else if(GetLocalVarInt("RandomName")==0)
{    //Do nothing
}
}

What it basicly does is that when you pick up the item, it adds a number to the variable. When you walk into the area, you can now hear the sound.

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
(This post was last modified: 02-03-2013, 09:53 PM by GoranGaming.)
02-03-2013, 09:51 PM
Website Find




Users browsing this thread: 1 Guest(s)