Turn-based script possible?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Rook
Posts: 71
Joined: Thu Dec 06, 2012 5:48 pm
Location: Belfast, UK

Turn-based script possible?

Post 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?
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Turn-based script possible?

Post 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.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Turn-based script possible?

Post by JKos »

And the documentation is here https://sites.google.com/site/jkosgrimr ... turn_based

WIP as well like almost all my stuff :D
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
User avatar
Rook
Posts: 71
Joined: Thu Dec 06, 2012 5:48 pm
Location: Belfast, UK

Re: Turn-based script possible?

Post 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. :)
User avatar
Merethif
Posts: 274
Joined: Tue Apr 24, 2012 1:58 pm
Location: Poland

Re: Turn-based script possible?

Post 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.
User avatar
Rook
Posts: 71
Joined: Thu Dec 06, 2012 5:48 pm
Location: Belfast, UK

Re: Turn-based script possible?

Post 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?
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Turn-based script possible?

Post 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.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
User avatar
Rook
Posts: 71
Joined: Thu Dec 06, 2012 5:48 pm
Location: Belfast, UK

Re: Turn-based script possible?

Post 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. :)
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Turn-based script possible?

Post by Komag »

well this is quite the development :o
Finished Dungeons - complete mods to play
flatline

Re: Turn-based script possible?

Post by flatline »

I thought Jkos posted the turn-based version some time ago? Or I'm just following these forums too closely... :)
Post Reply