Re: Wargame Creation Questions
Quote:
Can units be moved by mouse rather than numeric pad control?
First you need to identify the unit you have selected, once you have that you then need to click on the tile you want it to move to. The main issue i suspect of such a system is then checking the distance to A to B.. you could then use the Wargame map object to work out the distance/path.
Re: Wargame Creation Questions
Quote:
I thought about a +1 movement to enter a river hex (unit crosses river) and a +1 defense (unit defending across river)
Until someone figures out an ingenious solution this is still going to be a problem.
Think about it. How can you specify that a unit crossing a river incurs a movement penalty, while a unit that is moving along the river does not? Likewise, a straightforward defense bonus would have to apply to any unit occupying a river hex, not just units being attacked across the river.
Re: Wargame Creation Questions
Following the examples of the book I successfully completed the tasks for moving a unit, moving multiple units, creating a group, preventing units from moving off map, and so forth.
Now that I got it I wanted to add more units…but do I really need to code each one individually?
I created additional units within a group but they all move at once when I press the directional keys rather than moving one at a time (using next unit). I could only get the units to move on their own by creating a new group and coding it as such.
I assumed, perhaps incorrectly that a group meant all units in this group would have the same characteristics, however, each unit would have a unique ID making movement take place one unit at a time within a specified grouping before moving to the next group.
Am I missing something I sure hope so, otherwise I have a hell of a lot of coding to do.
Also can units be made to move alone or as a stack?
Re: Wargame Creation Questions
I'm going to have to relook at the code. :)
In MMF you can reduce the code by using qualifier groups and object behavious, and i am pretty sure that i did use the duplicate objects which you can then assign an internal ID number which you can automatically loops stuff through.
Behaviours is probably an area where you can drastically reduce the code (but i am sure i didnt do that in the book).
Moving a stack, you would need to identify when something is in a stack, and identify that you want to move all items within the stack.
What is possible i guess, is that i make a list of some of these things and get them added to the wargame map object, this would help reduce the amount of code needed, but also means we could do even more advanced things with it.
Jason