Full Version : Possible use of waypoints?
xmlspawner >>Q&A >>Possible use of waypoints?
<< Prev | Next >>
slida- 04-30-2006
I'm getting a bit ahead of myself as usual, but I'm trying to figure out a way for this to happen:
I have a little mini group of ratmen guarding a chest, which will, among other things, contain an as-yet-unimagined item that is needed for later on in the dungeon. The chest will be locked, but pickable, and if you don't happen to have a thief then you need to kill the ratman mage that is guarding it, or perhaps some other creature in the dungeon and it will have a key on him that will open it(I have a mini-question right here, could you direct me to a post that explains how to create a specific key that can unlock a specific chest? It seems easy but I haven't found anything. Would I just use a switch for this?). What I want is there to be an effect on already spawned creatures, like an alarm being raised, when the chest is opened or looted, for instance having patroling ratmen within a range moving towards the area of the chest as a reaction, among other things. In my imagination I think you could perhaps spawn a waypoint in the location when the chest is looted and have certain fairly nearby sentries move towards it. The mechanics are a bit over my head right now.
I desire to add some strategy to a game that is not so strategic in its mechanics, and give choices to the players that will have different consequences. The dungeon I am working in gives you more than one way to go, and you can quickly go to this area, if you choose, and try to get what's in the chest, but if you don't go directly for the chest things could turn out to be easier as you could take down the nearby reinforcements, and when you finally looted the chest, you would have some time before the smackdown reaches you.
I guess in general, my question is, can you change properties of multiple mobs, such that when a certain event happens, the mobs behaviour changes, and perhaps even the props of the mob itself? It seems theoretically possible, but I need a point in the right direction here.TIA
ArteGordon- 05-01-2006
yes, you can do all of those things.
The easiest way to set properties on groups of mobs that you have spawned is to use the SETONSPAWN keyword. Just put them into a subgroup when you spawn them and then you can refer to that subgroup with SETONSPAWN to set or change their properties on all of them at once.
You can set the CurrentWayPoint property on the mobs to an existing or spawned waypoint to direct them toward a waypoint. Take a look at the waypoint.xml example in xmlextras.zip.
You can also just set the Home property on the mobs to get them to go to a certain location without having to put down a waypoint.
Look at the rovingband.xml example.
Take a look at the masterhelper.xml example for activating a bunch of mobs to attack when you do something to a trigger mob. It is similar to what you are thinking.
Also the chestguardian.xml, chestguardian2.xml , and chestguardian3.xml examples that spawn or activate mobs when things are removed from chests would probably be useful.
To make keys that open certain doors, just match the KeyValue property on both the door/chest and key
metalchest,0/keyvalue/5789
key/keyvalue/5789
slida- 05-01-2006
Thanks for your help yet again Arte. I have an additional question that is unrelated. I have been unable to use the simpleartifact using the ADD command
metalchest/ADD/<simpleartifact/itemid/0x20D3>, it says no such item, what am I doing wrong here? I've got the script and it compiled.
ArteGordon- 05-02-2006

QUOTE (slida @ May 01, 2006 10:12 pm)
Thanks for your help yet again Arte. I have an additional question that is unrelated. I have been unable to use the simpleartifact using the ADD command metalchest/ADD/<simpleartifact/itemid/0x20D3>, it says no such item, what am I doing wrong here? I've got the script and it compiled.

there is no zero-argument constructor for simpleartifact. You need to construct it with an itemid argument. Like this
metalchest/ADD/simpleartifact,0x20D3
You will get a similar error if you try to add one like
[add simpleartifact
You would need to pass it the itemid arg like
[add simpleartifact 0x20D3
slida- 05-03-2006

QUOTE
there is no zero-argument constructor for simpleartifact. You need to construct it with an itemid argument. Like this metalchest/ADD/simpleartifact,0x20D3

Well, duh. *looks embarassed* This is what happens when I work on something after I've had a few pints. Thanks again.