I have many spells and due to the design of the game it doesn't make sense to use the command box as they are constantly changing and being re-ordered. I'm looking for a solution that just involves dialogs.
I'm thinking that perhaps I may need to look at the game-link types, which I currently don't understand. I suppose using game-link ability commands might (??) be similar behavior to using the command card, and perhaps I will be forced to do that. I was hoping this was a solved problem with a straightforward solution though.
In the map I'm making, each player has a hero, and the hero's spells are shown on dialog boxes at the bottom of the screen.
Note that there will be many different kinds of spells - for instance a targeted fireball, a non-targeted cone of fire, a teleport spell that teleports the hero to a location on the map, a buff that can be applied to self or others, etc.
My question is, what general solution can I use for 'casting' a spell when a dialog box is clicked. The issue I'm having is that some 'spells' are effects, some are scripts, some require targets, some need to know the casting player as a parameter, etc. My initial thought was to use triggers - so that when a dialog box for a spell is clicked, it runs a trigger corresponding to that spell; however, the issue there is that I can't pass parameters to the trigger, so I can't specify the target, etc.
My next thought was, 'well, I'll just use a function or action definition instead of a trigger'. However, I can't figure out how to have a specific function run with dynamic parameters upon a dialog click. There are built-in functions for triggers based on a parameter ("Run Trigger (trigger name parameter)"), but none for running functions or action definitions...
EDIT: To clarify, I am using a single trigger to detect dialog clicks, which then has a single function that runs the proper spell trigger (as all the spell triggers are stored in an array). I can't seem to store action definitions or functions in an array as I can with triggers, so my current fix, which seems a bit messy (I swear I know exactly how I'd do this in Python) is to have a switch statement with a different action for each spell.
0
I have many spells and due to the design of the game it doesn't make sense to use the command box as they are constantly changing and being re-ordered. I'm looking for a solution that just involves dialogs.
I'm thinking that perhaps I may need to look at the game-link types, which I currently don't understand. I suppose using game-link ability commands might (??) be similar behavior to using the command card, and perhaps I will be forced to do that. I was hoping this was a solved problem with a straightforward solution though.
0
In the map I'm making, each player has a hero, and the hero's spells are shown on dialog boxes at the bottom of the screen.
Note that there will be many different kinds of spells - for instance a targeted fireball, a non-targeted cone of fire, a teleport spell that teleports the hero to a location on the map, a buff that can be applied to self or others, etc.
My question is, what general solution can I use for 'casting' a spell when a dialog box is clicked. The issue I'm having is that some 'spells' are effects, some are scripts, some require targets, some need to know the casting player as a parameter, etc. My initial thought was to use triggers - so that when a dialog box for a spell is clicked, it runs a trigger corresponding to that spell; however, the issue there is that I can't pass parameters to the trigger, so I can't specify the target, etc.
My next thought was, 'well, I'll just use a function or action definition instead of a trigger'. However, I can't figure out how to have a specific function run with dynamic parameters upon a dialog click. There are built-in functions for triggers based on a parameter ("Run Trigger (trigger name parameter)"), but none for running functions or action definitions...
EDIT: To clarify, I am using a single trigger to detect dialog clicks, which then has a single function that runs the proper spell trigger (as all the spell triggers are stored in an array). I can't seem to store action definitions or functions in an array as I can with triggers, so my current fix, which seems a bit messy (I swear I know exactly how I'd do this in Python) is to have a switch statement with a different action for each spell.