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
Problem deactivating entity
DoReMiFaSoLaTi Offline
Junior Member

Posts: 2
Threads: 1
Joined: Dec 2013
Reputation: 0
#1
Problem deactivating entity

I'm working on a custom story and I've spawned the entity "Deformed Man" (Statue). The name of the entity is deformed_man_1, in my .hps-file I've deactivated this entity at the beginning:
void OnStart()
{
//Player Enviroment//
FadeOut(0);
AddTimer("", 1, "StartTheGame");
SetLightVisible("PointLight_2", false);

//Music//
PlaySoundAtEntity("", "general_rain.ogg", "Player", 3, true);
PlaySoundAtEntity("", "general_thunder.ogg", "Player", 3, true);

//Collides//
AddEntityCollideCallback("armour_rusty_head_1", "ScriptArea_1", "LevelDoorIs", true, 1);

//Interactions//
SetEntityPlayerInteractCallback("armour_rusty_head_1", "ShowStatue", true);

//Enteties//
SetEntityActive("level_wood_1", false);
SetEntityActive("deformed_man_1", false);
}

(This is only the OnStart() part of the code)
The problem is: the entity is still active when I start the map (which it should not be). I've also tried deactivating it from the Level Editor, this didn't work either. (I've looked for map cache-files, but they are removed)

Please help me
12-27-2013, 12:02 AM
Find
daortir Offline
Senior Member

Posts: 422
Threads: 9
Joined: Sep 2013
Reputation: 18
#2
RE: Problem deactivating entity

You cannot make the deformed_man entity active/inactive, I had this issue weeks ago when I tried to make a Weeping Angel-like encounter.

I solved this problem using the statues from the ptest folder, those can be de-activated.

I think you could also edit the deformed_man statue to make it de-activable, but I won't help you on that because I don't know anything about it.

(This post was last modified: 12-27-2013, 12:06 AM by daortir.)
12-27-2013, 12:06 AM
Find
DoReMiFaSoLaTi Offline
Junior Member

Posts: 2
Threads: 1
Joined: Dec 2013
Reputation: 0
#3
RE: Problem deactivating entity

(12-27-2013, 12:06 AM)daortir Wrote: You cannot make the deformed_man entity active/inactive, I had this issue weeks ago when I tried to make a Weeping Angel-like encounter.

I solved this problem using the statues from the ptest folder, those can be de-activated.

I think you could also edit the deformed_man statue to make it de-activable, but I won't help you on that because I don't know anything about it.

Thank you so much! This helped alot.
12-27-2013, 12:25 AM
Find
daortir Offline
Senior Member

Posts: 422
Threads: 9
Joined: Sep 2013
Reputation: 18
#4
RE: Problem deactivating entity

My pleasure. Here have a cookie, it improves everything : >.

12-27-2013, 12:30 AM
Find
WALP Offline
Posting Freak

Posts: 1,221
Threads: 34
Joined: Aug 2012
Reputation: 45
#5
RE: Problem deactivating entity

If you absolutely need to make the deformed man activate/deactivate-able I would probably look at making a copy of its entity file and changing its type in the model editor, as the cause of the issue is likely that it is of a type that does not support the function.
12-27-2013, 02:39 AM
Find
daortir Offline
Senior Member

Posts: 422
Threads: 9
Joined: Sep 2013
Reputation: 18
#6
RE: Problem deactivating entity

What type would you use, The Mug ? I am curious about it because I don't know how to do it and I think it might come in handy :3

12-27-2013, 01:02 PM
Find
WALP Offline
Posting Freak

Posts: 1,221
Threads: 34
Joined: Aug 2012
Reputation: 45
#7
RE: Problem deactivating entity

Well I would find another entity that works with SetEntityActive(), and has the necessary features you need for the entity that needs to be changed. Then I would open it in the modeleditor and look at what type it is.
Then I would make a copy of the problematic entity and change it to be that type and it should work, TADA!
12-27-2013, 02:25 PM
Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#8
RE: Problem deactivating entity

Object subtype static (or any other subtype under object) will allow the object to be activated/deactivated.

Having it as Staticobject - no subtype doesn't allow the entity to be activated/deactivated.

[Image: mZiYnxe.png]


(This post was last modified: 12-27-2013, 03:35 PM by Acies.)
12-27-2013, 03:34 PM
Find
Traggey Offline
is mildly amused

Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation: 185
#9
RE: Problem deactivating entity

Moved to the right section.
12-28-2013, 10:19 PM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#10
RE: Problem deactivating entity

Basically objects of the type StaticProp will always be active, no matter what. Make a copy of the entity for your custom stories folder and change it to Type:Object, SubType: Static. c:

12-29-2013, 12:47 AM
Find




Users browsing this thread: 2 Guest(s)