I am programming an rts myself currently. And i was thinking about orders. What bugs me is how far to go into the 'language of orders'. I thought in terms of how i would like to see springs orders here are some:
- Repeat. AFAIK currently it is not an order. Why not make it an order, and allow shift+repeat to initiate repeat when the order comes.
- There is the minelayers script i saw on youtube. How would we do this in orders? Well, if we could code orders, we could say:
This is a stack language, (Improvised a little, sorry should have learned forth more thurroughly.) (Whitespace does nothing, of course.) While recognizes the else and end-while to decide what to put on the stack. Randomize-order executes each of its entries randomizing the order it is done.(Dont get all the minelayers do the same spot.) Here i assume that the building orders would not be (attempted to be) executed when there is already a mine. (Also assumes that move will only transmit if unit is not already there/ can do better getting there/memoizes previous move order.)
Code: Select all
poll-pos radius area-safe while randomize-order do position1 build-mine do position2 build-mine end-randomize-order else safe-position move end-while
I guess you could say: area-safe, repeat may only be done automatically once in 5 seconds(waiting until then), move once in 0.2 seconds, etcetera. And all commands are cleared when the stack is overflowed; users should prevent that. Perhaps stack languages is what we are lead too here, but it is not really the language we should choose.(Well since it is already there Lua would be the first choice.) In that case this post becomes a orders feature request for if-area-clear, fixing build-order when building can not be build anyway.
One thing does push us in the direction of Lua, people probably won't think of this code during the game, and because it would probably mean a lot of work. In my project, there is another even stronger thing pushing me away from stack languages; it is written in common lisp


I feel the need to add another example:
Code: Select all
combat-group mean-pos-group combat-group radius-group area-safe
while
combat-group repair combat-group mean-pos-group
combat-group radius-group area-reclaim
else
safe-position move end-while