Npcmove.h(comes with its own findbot!)
Posted: Mon Feb 20, 2012 3:15 am
Npcmove.h is another character movement routine for Hugo. With it you can easily implement fairly complex character movement that is either random or goal driven. Here is the link:
http://dl.dropbox.com/u/11102009/ice.zip
It includes "npcmove.h", the sample game "ice.hex" and the game's source code "ice.hug".
The random movement routine supports the ability to restrict certain rooms from wandering characters and allow characters to prefer certain locations, even those that are restricted to other npc's. This would be most helpful in situations where you have a private space like an office or apartment that you don't want characters to wander into randomly.
The goal driven routine allows a character, no matter where they are, to find and move to any object, scenery, component or room, as long as both are in a predefined set of rooms where npc movement is allowed. The routine cannot yet deal intelligently with doors or scenery items that have the found_in property. In both cases the character will move to the first defined object in the found_in or between property.
In order to use it you have to include npcmove.h before any room objects and give any room that you want characters to be able to move through the "npc_move" property. Here is an example:
room throne_room "Throne Room"
{
npc_move n_obj, e_obj
}
Each direction that you want the npc to be able to move to must have its own direction object defined in the npc_move
property. This may seem like extra work but, trust me, it works much better that using a room's n_to, s_to, ect...property for this purpose.
This comes with a sample game, "Ice Station Hippo". This extension was mostly ready a few days ago, with a very crude sample game. However, as often happens, it took on a life of its own and before I knew it, the sample game began to resemble an actual work of IF. I was compelled to get it to a playable state.
This extension is still a work in progress, so I would appreciate any input on how I could trim out any inefficiency or what attributes and properties can be safely aliased with existing attributes and properties, etc...
http://dl.dropbox.com/u/11102009/ice.zip
It includes "npcmove.h", the sample game "ice.hex" and the game's source code "ice.hug".
The random movement routine supports the ability to restrict certain rooms from wandering characters and allow characters to prefer certain locations, even those that are restricted to other npc's. This would be most helpful in situations where you have a private space like an office or apartment that you don't want characters to wander into randomly.
The goal driven routine allows a character, no matter where they are, to find and move to any object, scenery, component or room, as long as both are in a predefined set of rooms where npc movement is allowed. The routine cannot yet deal intelligently with doors or scenery items that have the found_in property. In both cases the character will move to the first defined object in the found_in or between property.
In order to use it you have to include npcmove.h before any room objects and give any room that you want characters to be able to move through the "npc_move" property. Here is an example:
room throne_room "Throne Room"
{
npc_move n_obj, e_obj
}
Each direction that you want the npc to be able to move to must have its own direction object defined in the npc_move
property. This may seem like extra work but, trust me, it works much better that using a room's n_to, s_to, ect...property for this purpose.
This comes with a sample game, "Ice Station Hippo". This extension was mostly ready a few days ago, with a very crude sample game. However, as often happens, it took on a life of its own and before I knew it, the sample game began to resemble an actual work of IF. I was compelled to get it to a playable state.
This extension is still a work in progress, so I would appreciate any input on how I could trim out any inefficiency or what attributes and properties can be safely aliased with existing attributes and properties, etc...