Frictional Games Forum (read-only)
Setting an Entity Active - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Setting an Entity Active (/thread-15772.html)

Pages: 1 2 3


RE: Setting an Entity Active - TheIcyPickle - 06-02-2012

Maybe the T in just type is capitol?

Anyway I've tried what you said beecake, but no luck. Is there anything I should put in the "entity" tab in my level editor that I have not done? because as of now, I only have the name of the object filled in.

Most likely thats not it. Its gotta be the script!


RE: Setting an Entity Active - Putmalk - 06-02-2012

(06-02-2012, 07:54 PM)TheIcyPickle Wrote: Maybe the T in just type is capitol?

Anyway I've tried what you said beecake, but no luck. Is there anything I should put in the "entity" tab in my level editor that I have not done? because as of now, I only have the name of the object filled in.

Most likely thats not it. Its gotta be the script!
Have a map_cache? Delete it.

Check to make sure the names of the entities match.

Enable DebugMenu + activate debug messages.

Add this line to your callback function:

AddDebugMessage("Firing function!", false);


RE: Setting an Entity Active - TheIcyPickle - 06-02-2012

I do not have a map_cache

Entities match

Debug Menu? Is there a line of script I have type for that?

and this is what it looks like now


void PickLantern(string &in asEntity, string &in asType)
{
SetEntityActive("servant_grunt_1", true);
SetEntityActive("servant_grunt_2", true);
AddDebugMessage("Firing function!", false);
}


RE: Setting an Entity Active - Putmalk - 06-02-2012

(06-02-2012, 08:11 PM)TheIcyPickle Wrote: I do not have a map_cache

Entities match

Debug Menu? Is there a line of script I have type for that?

and this is what it looks like now


void PickLantern(string &in asEntity, string &in asType)
{
SetEntityActive("servant_grunt_1", true);
SetEntityActive("servant_grunt_2", true);
AddDebugMessage("Firing function!", false);
}
http://wiki.frictionalgames.com/hpl2/amnesia/devenvguide

Enable a development profile (just do steps 1-5, ignore the others).

That way, you can see debug messages when you load up the map in that profile.

If you see the debug message (appears in bottom left) then your function is firing and something else is wrong. If you do not see the debug message, then your function is NOT firing and we know that we have to fix the callback.

Otherwise we can keep throwing guesses around the wall and nothing will happen.


RE: Setting an Entity Active - TheIcyPickle - 06-02-2012

I all see it it loading music in the bottom left. not debug message or anything.

(06-02-2012, 08:51 PM)TheIcyPickle Wrote: I all see it it loading music in the bottom left. not debug message or anything.
All I*


RE: Setting an Entity Active - Putmalk - 06-02-2012

That means the function isn't calling. (which is good).

Wait a second...hm...is your script even calling at all? Do you have anything else in your script? Can you link the full thing?


RE: Setting an Entity Active - TheIcyPickle - 06-02-2012

yeah sure its


void OnStart()
{
AddUseItemCallback("", "ClosetKey", "door", "KeyOnDoor", true);

AddEntityCollideCallback("Player", "script1", "GetWalkQuest", true, 1);
AddEntityCollideCallback("Player", "script1c", "FinishWalkQuest", true, 1);
AddEntityCollideCallback("Player", "script2", "StartMusic", true, 1);
AddUseItemCallback("OpenDoor", "key2", "door2", "UnlockLevelDoor", true);
AddEntityCollideCallback("Player", "script4", "PlaySoundAtEntity", true, 1);
SetEntityCallbackFunc("lantern_1", "PickLantern");
}

then


void PickLantern(string &in asEntity, string &in asType)
{
SetEntityActive("servant_grunt_1", true);
SetEntityActive("servant_grunt_2", true);
AddDebugMessage("Firing function!", false);
}

Oh and if this means anything it's true, then I deserve 10 slaps to the face...

do I need another .hps file for this new map?

The playsoundatentity lines and also this line we are working now, is on a new map.

if this is the reason. then fuck, *facepalm*

full thing here

http://www.mediafire.com/?83j8bsj42rmb03v


RE: Setting an Entity Active - Putmalk - 06-03-2012

?

You only need one .hps for each map...

Are the other callbacks working just fine?

If not, then the issue is with the parameters, which with CallbackFunc is very weird. >.> Sometimes one works, sometimes the other works, I don't really understand why it's different?

Other than that, I have no other ideas as to why the callbackfunc is not working. Sad Sorry.


RE: Setting an Entity Active - TheIcyPickle - 06-03-2012

just a quick question, just for explaining, Do I need multiple .hps files if I have a story that starts on "map1.map" and has a level door for map2.map?


So would map2.map need a new hps file?


RE: Setting an Entity Active - Putmalk - 06-03-2012

(06-03-2012, 12:58 AM)TheIcyPickle Wrote: just a quick question, just for explaining, Do I need multiple .hps files if I have a story that starts on "map1.map" and has a level door for map2.map?


So would map2.map need a new hps file?
Yup.