- Joined
- Aug 7, 2013
- Messages
- 1,338
Hi,
I'm having a bit of trouble setting up an object based interaction system for dealing with NPCs. What's impeding my progress the most is that apparently you can't use struct methods to create trigger conditions (I don't see why this should be a limitation) and also coming up with a way to dynamically create dialog-based triggers and then remove these. I wrote up an outline of how I wanted to design the NPC system--reading it will help explain what my JASS code attempts to do.
Ultimately I'd like to avoid hardcoding in dealing with each individual NPC and rather create different objects that represent each one (Merchant, Priest, Inn Keeper, etc.) and then when a player interacts with an NPC unit, I would just make a simple call like "NPC.interact(playerId)" and then the rest would be specific to that NPC.
if the player selects reviveBttn, it will create a new dialog that lists out the player's current party members (each as a dialog button), and then the player selects one. This one gets revived (assuming the player has adequate gold). I have already handled creating this second dialog in another object, but the problem is assigning each of those buttons a meaning, because sometimes they will be involved in other interactions which aren't reviving.
Please advise.
I'm having a bit of trouble setting up an object based interaction system for dealing with NPCs. What's impeding my progress the most is that apparently you can't use struct methods to create trigger conditions (I don't see why this should be a limitation) and also coming up with a way to dynamically create dialog-based triggers and then remove these. I wrote up an outline of how I wanted to design the NPC system--reading it will help explain what my JASS code attempts to do.
Ultimately I'd like to avoid hardcoding in dealing with each individual NPC and rather create different objects that represent each one (Merchant, Priest, Inn Keeper, etc.) and then when a player interacts with an NPC unit, I would just make a simple call like "NPC.interact(playerId)" and then the rest would be specific to that NPC.
if the player selects reviveBttn, it will create a new dialog that lists out the player's current party members (each as a dialog button), and then the player selects one. This one gets revived (assuming the player has adequate gold). I have already handled creating this second dialog in another object, but the problem is assigning each of those buttons a meaning, because sometimes they will be involved in other interactions which aren't reviving.
Please advise.
Last edited: