Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Setting an Entity Active
TheIcyPickle Offline
Member

Posts: 80
Threads: 16
Joined: Feb 2011
Reputation: 0
#11
RE: Setting an Entity Active

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!
06-02-2012, 07:54 PM
Find
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#12
RE: Setting an Entity Active

(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);

(This post was last modified: 06-02-2012, 08:05 PM by Putmalk.)
06-02-2012, 08:05 PM
Find
TheIcyPickle Offline
Member

Posts: 80
Threads: 16
Joined: Feb 2011
Reputation: 0
#13
RE: Setting an Entity Active

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);
}
06-02-2012, 08:11 PM
Find
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#14
RE: Setting an Entity Active

(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/amn...evenvguide

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.

(This post was last modified: 06-02-2012, 08:18 PM by Putmalk.)
06-02-2012, 08:18 PM
Find
TheIcyPickle Offline
Member

Posts: 80
Threads: 16
Joined: Feb 2011
Reputation: 0
#15
RE: Setting an Entity Active

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*
(This post was last modified: 06-02-2012, 08:51 PM by TheIcyPickle.)
06-02-2012, 08:51 PM
Find
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#16
RE: Setting an Entity Active

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?

06-02-2012, 09:02 PM
Find
TheIcyPickle Offline
Member

Posts: 80
Threads: 16
Joined: Feb 2011
Reputation: 0
#17
RE: Setting an Entity Active

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
(This post was last modified: 06-02-2012, 09:22 PM by TheIcyPickle.)
06-02-2012, 09:09 PM
Find
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#18
RE: Setting an Entity Active

?

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.

06-03-2012, 12:15 AM
Find
TheIcyPickle Offline
Member

Posts: 80
Threads: 16
Joined: Feb 2011
Reputation: 0
#19
RE: Setting an Entity Active

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?
06-03-2012, 12:58 AM
Find
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#20
RE: Setting an Entity Active

(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.

06-03-2012, 04:10 AM
Find




Users browsing this thread: 1 Guest(s)