Page 1 of 3

Turn-based script possible?

Posted: Sun Dec 09, 2012 12:46 am
by Rook
I'm curious if it may be possible to write a script for turn based combat. If it is possible, it would be a nice addition if somebody could write a Might & Magic-esq turn based toggle.

Here is my vision of how it would work.

Pressing enter begins turn-based combat. A sound signals begin of turn-based.

Rules -
Player may move two squares before ending turn (no attacking).
or Player may move one square and attack before ending turn.
or Player may attack before ending turn.

Same rules apply to enemies.


Any thoughts?

Re: Turn-based script possible?

Posted: Sun Dec 09, 2012 1:02 am
by JKos
I have done it and it works pretty nicely but it's still in WIP/experimental stage.

If you want to try it you should install my framework and enable the turn_based module. Link is in my signature.

Re: Turn-based script possible?

Posted: Sun Dec 09, 2012 1:10 am
by JKos
And the documentation is here https://sites.google.com/site/jkosgrimr ... turn_based

WIP as well like almost all my stuff :D

Re: Turn-based script possible?

Posted: Sun Dec 09, 2012 1:15 am
by Rook
I've been having a look at your stuff. I'm not sure if I have the turn-based system working properly or not, because combat still seems normal. Is there a certain way it needs to be implemented, except for pasting into init?

Nice work btw. :)

Re: Turn-based script possible?

Posted: Sun Dec 09, 2012 1:23 am
by Merethif
Rook wrote:(...)
Rules -
Player may move two squares before ending turn (no attacking).
or Player may move one square and attack before ending turn.
or Player may attack before ending turn.

Same rules apply to enemies.


Any thoughts?
Most likely Assassination skill becomes obsolete because backstabbing would be impossible.

Re: Turn-based script possible?

Posted: Sun Dec 09, 2012 1:25 am
by Rook
Merethif wrote: Most likely Assassination skill becomes obsolete because backstabbing would be impossible.
If turn-based was toggle-based. What is stopping you from backstabbing then entering turn-based mode?

Re: Turn-based script possible?

Posted: Sun Dec 09, 2012 1:27 am
by JKos
If you have successfully installed the framework (you can test it for example by adding print('ok') to logfw_init.main function) then you have to add this line to your init.lua
fw_loadModule('turn_based')

reload your dungeon.
Now there should be a scroll spawned to your 1st champions inventory which can be used to enable or disable the turn based mode.

Re: Turn-based script possible?

Posted: Sun Dec 09, 2012 1:42 am
by Rook
Ah, I didn't notice the scroll. I got it working and it's pretty nice.

One thing I noticed right away was the little delay between turns. For example, When it was my turn, I could easily backstep 10 spaces. Only when I stopped, did the enemy's turn begin. Is there a way to restrict movement to one or two steps? Either block movement completely after second step, or end turn for player on third step.

Also, is there a way to begin turn-based with a key press? If you are familiar with Might & Magic, you'll know exactly what I mean. :)

Re: Turn-based script possible?

Posted: Sun Dec 09, 2012 1:58 am
by Komag
well this is quite the development :o

Re: Turn-based script possible?

Posted: Sun Dec 09, 2012 2:53 am
by flatline
I thought Jkos posted the turn-based version some time ago? Or I'm just following these forums too closely... :)