See the medieval demo, when you kill the wyvern you get thanked by the princess and then and only then does she appear in town,
variables hold a value, to change their value u use a change global action.
the engine has built in variables some of which u can use attribute wizard to change them.
The point of variables is to test them, to make certain outcomes occur when they have certain values.
lets say you have a variable
gb_health
(take heed you can negate the stamina variable and its outcomes like so, simply refill the stamina to an insane value and refill it regularly to prevent bottoming out)
and you define that;
5 equals great
4=good
3=fair
2=poor
1=deathly ill
0=dead
well you use conditional actions to test these and based on what conditions you set a linked action fires.
for instance when gb_health equals 0 you want to change the player's appearance to being semi transparent with a halo over head.
then you'd test (using a conditional) and use a player map icon as the linked action fro it being true, and an end event action to kill it....etc its all in the manual, and experience through trial and error is golden and saves me from typing.
this is accomplished using a global and using a conditional to check the global,
ie conditional if monster_0075 = 1 then npc control place monster_0075 at coord's (x,y) else end event
1 here means that the creature is alive, 0 means dead. (true/compliment form)
note: the actual setting of the variable should be done with a change global action in the NPCs death event.
note: this can be thoroughly expanded to spawn artifical populations, ie you kill off an NPC in its death event it spawns more of a random kind at random locations of random types in the map, great for ...well you figure it out these ideas aren't free! I require emeralds,silver and amber.
this event is best called during the given location's local initialization event.
this may require substantial variables if you plan on killing off massive amount of NPCs/entities but if its integral to the game play then it is indeed worthwhile.
------------------
... That staples it.