Quote:I am wondering how to have a monster pop up,
Monster popup needs to be triggered, for example by a script area.
Add in OnEnter of your .hps following:
AddEntityCollideCallback("Script_area_x", "Player", "function_monster", true, 1);
[if "Player" enters (definded by the 1, -1 would be leaves and 0 would be both) the "script_Area_x", the function "function_monster" gets called and the CollideCallback gets removed(defined by "true")]
and then somewhere else in the script the following:
function_monster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("monster_name", true);
}
script_Area_x is the area, which activates the Monster when the player enters.
monster name is the name of the monster which should be activated…take care of deactivating the monster in the level editor.
Quote: and then the player runs away into another script area that makes the bridge break (set inactive) and then fade the vision to black,
then teleport the player to another map, and lastly fade the vision back in. Is this too much to ask? I'm just curious and would appreciate any help.
Add another entity collide callback with the area the player runs into and replace the function_monster with another name, here function_name.
Then add, again OUTISDE OnEnter oder OnStart (and OnLeave), these functions:
void function_name(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("bridge_name", 0);
FadeOut(15);
AddTimer("", 15, "teleport");
}
void teleport(string &in asParent, string &in asChild, int alState)
{
ChangeMap("map_name.map", "start_player_1", "", "");
}
bridge_name is for sure the name of the bridge which should break(the 0 sets the bridge to a health of 0=dead)
15 is the time until screen is completely black in seconds in the FadeOut-function, and the time till teleportfunction gets called in the timer.
at changemap is map_name.map the name of the map you want to load and start_player_1 the startarea in the map where the player should spawn.
Within the last two "" you could define a sound which is played when the function gets called (in the first "") or when the new map is loaded (in the second "").
Take a look at the wiki.frictionalgames.com page…there is everything.
I'm quiet sure that it works this way, maybe some spelling errors. Or i'm wrong, no warranty^^ For example the content of the brackets behind void teleport and void function_name is just guessed, not sure.
I'm actually scripting beginner, but i thought i would know the right answer so i wrote^^
Edit: Didn't see the answer above me, but it looks more professional (but also more complicated) than mine. Wanted to delete my post, but doesn't work-.-