Tripication
Member
Posts: 172
Threads: 19
Joined: Dec 2011
Reputation:
6
|
Make Entities Appear?
Hiya, I was wondering if it's at all possible to make multiple body piles appear on a trigger like a pickup event.
E.g. Walk downstairs and pick up a key, then walk back upstairs and see a bunch of bodies lying in a pile in the middle of a hallway. I can get it to work with the lamp but when I deactivate the Body piles, they're still active when i run a test just to make sure they're not there...
(This post was last modified: 12-28-2011, 05:59 AM by Tripication.)
|
|
12-27-2011, 11:50 AM |
|
Tanshaydar
From Beyond
Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation:
67
|
RE: Make Entities Appear?
SetEntityActive true and false will help you, but that works only on non-static entities. I mean, if an entity is a StaticProp then you can't use those functions, you need to create a custom entity for that.
Also, CreateEntityAtArea function might come in handy.
|
|
12-27-2011, 11:54 AM |
|
Tripication
Member
Posts: 172
Threads: 19
Joined: Dec 2011
Reputation:
6
|
RE: Make Entities Appear?
(12-27-2011, 11:54 AM)Tanshaydar Wrote: SetEntityActive true and false will help you, but that works only on non-static entities. I mean, if an entity is a StaticProp then you can't use those functions, you need to create a custom entity for that.
Also, CreateEntityAtArea function might come in handy. Ok, is there any way to make a custom entity short of having to model it, sorry im kinda new to this so im just trying to figure some stuff out on a quick map before i start to build it seriously and fix up the fine details.
|
|
12-27-2011, 12:36 PM |
|
Unearthlybrutal
Posting Freak
Posts: 775
Threads: 12
Joined: May 2011
Reputation:
26
|
RE: Make Entities Appear?
There is "corpse_pile1_object"... you can deactivate and activate it with SetEntityActive, because of that it's not static
|
|
12-27-2011, 12:47 PM |
|
Tripication
Member
Posts: 172
Threads: 19
Joined: Dec 2011
Reputation:
6
|
RE: Make Entities Appear?
Ok, this is becoming a mess now. I've just tried my original problem and it hasnt worked out well...
Im going to start from scratch kinda.
Hello, i was wondering why when i make these objects (Bodies and LightBodies) active on collision with this area(BodiesArea), it doesnt work.
Here is my code.
____________________________________________________________________
void OnStart()
{
AddEntityCollideCallback("Player", "BodiesArea", "BodiesAppear", true, 1);
}
void BodiesAppear(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Bodies", true);
SetEntityActive("LightBodies", true);
}
____________________________________________________________________
Im not sure weather it is a stupid mistake or just something that doesnt work together but there it is.
NOTE: The bodies are INACTIVE but when i collide with the area, they STAY INACTIVE and dont become ACTIVE.
Also, i was wondering if i could get the following code updated so that when you start the map, it is on 0% oil.
____________________________________________________________________
void OnStart()
{
AddEntityCollideCallback("Player", "DoorSlam", "CollideDoorSlam", true, 1);
AddEntityCollideCallback("Player", "DoorBang", "CollideDoorSound", true, 1);
}
void CollideDoorSlam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("Door001", true, true);
StartPlayerLookAt("Door001", 20.0f, 20.0f, "");
AddTimer("", 1.0f, "StopLook");
}
void StopLook(string &in asTimer)
{
StopPlayerLookAt();
}
void CollideDoorSound(string &in asParent, string &in asChild, int alState)
{
PlayMusic("19_event_brute.ogg", false, 0.8, 2, 0, true);
if(GetPlayerSanity() < 30) return;
GiveSanityDamage(30, true);
}
____________________________________________________________________
Much Appreciated
(This post was last modified: 12-27-2011, 01:37 PM by Tripication.)
|
|
12-27-2011, 12:51 PM |
|
Tripication
Member
Posts: 172
Threads: 19
Joined: Dec 2011
Reputation:
6
|
RE: Make Entities Appear?
If i could have someone walk me through how to do this through steam i would be highly appreciative, it would be better than me not really learning how to do it and having someone else do it for me i guess. But it's up to whoever.
Steam = Tripication #TH
ID = STEAM_0:1:34797132
(This post was last modified: 12-28-2011, 04:35 AM by Tripication.)
|
|
12-28-2011, 04:34 AM |
|
Tripication
Member
Posts: 172
Threads: 19
Joined: Dec 2011
Reputation:
6
|
RE: Make Entities Appear?
Nevermind, ive taken a different and better approach to my cheap scare and i will figure the oil out by looking at the original game .hps file. Thanks for the help
|
|
12-28-2011, 05:59 AM |
|
|