joebonk wrote:I want to have a creature spawn every time someone enters the area....
Unfortunately the map I want this for is a world map. In this case the floor tile could be a misc object, which I think can cover npcs. I could have a floor tile be an obstacle that is replaced by a normal floor tile when bumped. But I would like to recharge this if the bad npc dies. This npc is only one found in the game and can appear and disappear, and never dies unless a condition is finally met. When it dies it is only for now. What I really would like to know if there is a way to place an NPC on the map that is not bumping into an object, but can spawn say 4 spaces away. And only do so if aggro < 1. Preferably on a world map.
1) Create a duplicate of a common terrain tile (like grass). This will be exactly the same as grass, but will have a macro triggered by passing. If your existing grass already has such a macro, you only need to add code to it. The reason for a special "macro grass", used only where needed, is that putting a macro into regular grass (or other common terrain) will make your game very slow. Keep track of the item numbers of regular and macro grass; that is your only way of telling them apart.
2) On your world map, place macro grass only where needed. That terrain will spawn your NPC. Note that your NPC will be moving and not talking, like all Summoned creatures.
3) Edit your macro grass macro, so that it runs the following code when conditions are right for NPC spawning, including if AGGRO < 1.
Code: Select all
SET F = 1
SET X = LOC[X]
SET Y = LOC[Y]
QA 34 [npc creature number]
QA 38
For F, use any flag variable that is normally zero. "QA 34" will summon creature after the macro ends, and this will work on a terrain passing macro. "QA 38" moves player one space away from the NPC (spawned in same location.)
4) If you want the NPC to be moved somewhere else, use the following in your step macro:
Code: Select all
IF F = 0 THEN [line number after code snippet]
MAPCHKD X Y Z
MAPADD 1 1 255
MAPSETD 1 1 Z
MAPTAKE X Y 255
SET F = 0
X and Y are the former location of the NPC. Use the new location in the MAPADD and MAPSETD.
Another feature is an arena where you fight gladiator style. This would be forced challenge or even to earn money. So this arena would have to have all its conditions recharged when the experience is over.
Can a death macro allow for an exit from a room?
I think so. It can also set a flag that the step macro can check, to change LOC[RG] and LOC[RM].
Perhaps remove everything underneath. Yet I would like to have this room used again whenever the player needs it. Maybe a tile that, once passed on, will place items on the map, readying it for the next time.
You could use a spawning mechanism similar to the one I mentioned for your returnable villain. Or your arena can have a hidden space where each square has a particular wandering monster, 100% chance. Use step macro to SET LOC[X] = LOC[X] to "goose" the map into spawning them, and depending on circumstances, copy the creature from the W spaces to where you need it, and delete the original.
[quote="joebonk"]I want to have a creature spawn every time someone enters the area....
Unfortunately the map I want this for is a world map. In this case the floor tile could be a misc object, which I think can cover npcs. I could have a floor tile be an obstacle that is replaced by a normal floor tile when bumped. But I would like to recharge this if the bad npc dies. This npc is only one found in the game and can appear and disappear, and never dies unless a condition is finally met. When it dies it is only for now. What I really would like to know if there is a way to place an NPC on the map that is not bumping into an object, but can spawn say 4 spaces away. And only do so if aggro < 1. Preferably on a world map.[/quote]
1) Create a duplicate of a common terrain tile (like grass). This will be exactly the same as grass, but will have a macro triggered by passing. If your existing grass already has such a macro, you only need to add code to it. The reason for a special "macro grass", used only where needed, is that putting a macro into regular grass (or other common terrain) will make your game very slow. Keep track of the item numbers of regular and macro grass; that is your only way of telling them apart.
2) On your world map, place macro grass only where needed. That terrain will spawn your NPC. Note that your NPC will be moving and not talking, like all Summoned creatures.
3) Edit your macro grass macro, so that it runs the following code when conditions are right for NPC spawning, including if AGGRO < 1.
[code]SET F = 1
SET X = LOC[X]
SET Y = LOC[Y]
QA 34 [npc creature number]
QA 38[/code]
For F, use any flag variable that is normally zero. "QA 34" will summon creature after the macro ends, and this will work on a terrain passing macro. "QA 38" moves player one space away from the NPC (spawned in same location.)
4) If you want the NPC to be moved somewhere else, use the following in your step macro:
[code]IF F = 0 THEN [line number after code snippet]
MAPCHKD X Y Z
MAPADD 1 1 255
MAPSETD 1 1 Z
MAPTAKE X Y 255
SET F = 0[/code]
X and Y are the former location of the NPC. Use the new location in the MAPADD and MAPSETD.
[quote]Another feature is an arena where you fight gladiator style. This would be forced challenge or even to earn money. So this arena would have to have all its conditions recharged when the experience is over.
Can a death macro allow for an exit from a room?[/quote]
I think so. It can also set a flag that the step macro can check, to change LOC[RG] and LOC[RM].
[quote]Perhaps remove everything underneath. Yet I would like to have this room used again whenever the player needs it. Maybe a tile that, once passed on, will place items on the map, readying it for the next time.[/quote]
You could use a spawning mechanism similar to the one I mentioned for your returnable villain. Or your arena can have a hidden space where each square has a particular wandering monster, 100% chance. Use step macro to SET LOC[X] = LOC[X] to "goose" the map into spawning them, and depending on circumstances, copy the creature from the W spaces to where you need it, and delete the original.