Lua gadget example: Turn based play

Lua gadget example: Turn based play

Resources to get you going on your new project, or to help you over some emergent problems during your development cycle.

Moderator: Moderators

Post Reply
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Lua gadget example: Turn based play

Post by TheFatController »

I had an idea of how to implement turn based play using a mix of Wait commands and the AllowCommand function, here's the results:

Download: http://pw3n.net/gadgets/turn_based.lua

It does seem to work (aside from small problems like landing aircraft in the orders phase and losing the ability to control firestate) if you drop it into any mod.

There's also a table which can be used to end the orders phase early, if finishedOrders[teamId] is 'true' for every team then the orders phase will end, I imagine this would be best done with a GUI button.

I'm not too keen on taking this much further myself but wanted to see if it would work and am releasing it for modders to have a go with and hopefully improve.
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Re: Lua gadget example: Turn based play

Post by TheFatController »

Todo list:
- Freeze resource gain/loss during order mode.
- Freeze reload times during order mode.
- Freeze unit movement during order mode.
- Hide Firestate and add a fake Firestate option that can be used to toggle how the unit works in action mode.
- Add a 'DONE' button to unsynced so teams can declare their ordermode finished (and set finishedOrders to true).
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: Lua gadget example: Turn based play

Post by SpliFF »

I'm very interested in this. It has potential.

I will finish it off and make it an alternate game mode for Metalstorm. Metalstorm has a strong focus on strategic planning so this is a perfect compliment to the mod. I'll probably implement it as a limited "pause" resource that players can activate a limited number of times.

Thanks for the release. You rock!
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Re: Lua gadget example: Turn based play

Post by TheFatController »

Thinking about it, if you were able to send a pause from Synced and prevent any players from unpausing that would be a lot better than using Wait, but I don't believe you can currently.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Lua gadget example: Turn based play

Post by jK »

... deploy gadget?
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Re: Lua gadget example: Turn based play

Post by TheFatController »

Oh yes, that worked didn't it..

The gadget in this post was a quick job I really just wanted to start a discussion with the example.

That'll be something to look into.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Lua gadget example: Turn based play

Post by imbaczek »

planes landing and stuff could be taken care of with movectrl, right?
R-TEAM
Posts: 177
Joined: 22 Jan 2009, 19:25

Re: Lua gadget example: Turn based play

Post by R-TEAM »

Hi,

nice idea.
But i have the best (and most realistic)turn based Wargame (ATM WW2 only)already here
and have tryed Spring because i searched a good RTS .......
[and spring is a realy good RTS ;) ]
So for me -> thanks, but dont need it.
Maybe other like it - best wishes for it ;)

R-TEAM
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Re: Lua gadget example: Turn based play

Post by SpikedHelmet »

Despite the fact that I absolutely abhor turn-based games, this seems like a very cool idea, for a computer-game version of turn-based TT games like Warhammer, Warmachine, even *shudder* D&D.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Lua gadget example: Turn based play

Post by imbaczek »

gimme nethack
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Re: Lua gadget example: Turn based play

Post by Pendrokar »

...M.A.X. 3D...
Avatar
Posts: 3
Joined: 27 Jul 2009, 15:09

Re: Lua gadget example: Turn based play

Post by Avatar »

The above link seems to be broken. Any alternative location? tia


ps: M.A.X. was G.R.E.A.T. but way too unstable :(
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Re: Lua gadget example: Turn based play

Post by Pendrokar »

Avatar wrote: ps: M.A.X. was G.R.E.A.T. but way too unstable :(
That's for sure...
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: Lua gadget example: Turn based play

Post by yuritch »

Not that unstable with 1.04 patch btw. Too bad MAX 2 was a whole different game.
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Re: Lua gadget example: Turn based play

Post by Guessmyname »

I still say you'd be better off doing this by actually pausing the game during the orders phase.
Avatar
Posts: 3
Joined: 27 Jul 2009, 15:09

Re: Lua gadget example: Turn based play

Post by Avatar »

btw: there is a M.A.X. remake in development -> http://www.maxr.org

Turn based play would be great in combination with buying/deploying units instead of building an infrastructure for production and with objectives that the players have to take. Spring 1944 has both options (buy/deploy and objectives).

Would this be possible for other mods (with LUA)? (i really like EE and NOTA).
I┬┤m not into programming and LUA, so i can┬┤t imagine if this is possible and how long it would take to do it...
D3monic
Posts: 4
Joined: 23 Sep 2009, 20:22

Re: Lua gadget example: Turn based play

Post by D3monic »

Avatar wrote:The above link seems to be broken. Any alternative location? tia
It's still broken.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2700
Joined: 25 Aug 2004, 13:31

Re: Lua gadget example: Turn based play

Post by bobthedinosaur »

can you pause via lua and have a sync timer to unpause?
8611
XTA Developer
Posts: 242
Joined: 29 Dec 2014, 08:22

Re: Lua gadget example: Turn based play

Post by 8611 »

TheFatController wrote:Download: http://pw3n.net/gadgets/turn_based.lua
dead link
Post Reply

Return to “Game Development Tutorials & Resources”