Aller au contenu

Photo

Hypothetical: Turn-based combat?


  • Veuillez vous connecter pour répondre
11 réponses à ce sujet

#1
Primogenitor

Primogenitor
  • Members
  • 24 messages
Would it be possible to implement fake-turn based combat? Similar to Dragon Age: Journeys / Heros of Might & Magic / jRPGs. Every time someone/thing in the playable party has no actions, pause is activated and that character is selected.

#2
Tenjac

Tenjac
  • Members
  • 48 messages
I'd think you could script that. How's it going Primo?

#3
fluffyamoeba

fluffyamoeba
  • Members
  • 264 messages
Well, everything just stands around if it has nothing in its action queue. All combat is script based. Pause is controlable by scripting. You can fire animations off the scripting, so you can make the characters freeze rather than just stand around. Or assign actions then execute the animations. Also welcome back :D

#4
Primogenitor

Primogenitor
  • Members
  • 24 messages
So it could be as an on-heartbeat script; see if anyone in the players party has an empty action queue and is in combat, and if so select them and pause.



Any more elegant ideas? I havn't had time to properly poke around yet, need the Christmas holidays!



(And Thank You both :D )

#5
Mountainlake

Mountainlake
  • Members
  • 26 messages
I don't know if it is possible, but perhaps it could be integrated as a custom tactics option? That would make it easy to turn off and on and it would also make it possible to use turn-based only for some characters, not all.



I would be very interested in something like that, so if you get into it please let me know! I might be able to help with the coding, but right now I don't have much time.

#6
fluffyamoeba

fluffyamoeba
  • Members
  • 264 messages
Well, the AI must know when an action is finished in order to add another (as you can only queue one action at a time). So it must be possible to do the same but just pause instead of adding another.

#7
Mountainlake

Mountainlake
  • Members
  • 26 messages
Depends, if you look at NWN some parts were native code that could not be changed. I don't know how much of this game that runs in overridable scripts and how much (if any) that is compiled and fixed. In addition it must be a relatively minor change or it is not worth the maintenance when new patches are released - so far fairly often.

#8
fluffyamoeba

fluffyamoeba
  • Members
  • 264 messages
It's done entirely by 2das and scripting.

#9
Primogenitor

Primogenitor
  • Members
  • 24 messages
Compared to NWN, DA scripting seems a lot more flexible; clearly, BioWare learnt a lot from how/what the community did/tried.

Looking through the code is certainly instructive & entertaining. "Generate SkyNet Position Tracking Event" is my favourite so far...

I think Ive found where to start. In player_core.nss theres a bit:
[dascript]
        // -----------------------------------------------------------------
        // Legacy Heartbeat event. Left for the consumption of modders.
        // Be careful with it, it's not nice to run on a lot of creatures...
        // -----------------------------------------------------------------
        case EVENT_TYPE_HEARTBEAT:
        {
             bEventHandled = TRUE;
             break;
        }
[/dascript]

So I guess a script can be assinged (SetEventScript function?) to the player that can detect this event and respond accordingly? I guess ToggleGamePause is the other function to use.

#10
Challseus

Challseus
  • Members
  • 1 032 messages

Primogenitor wrote...

So I guess a script can be assinged (SetEventScript function?) to the player that can detect this event and respond accordingly?


Just make sure to use EnablevEvent with it. From the description:

Description:

Enables or disables the specified event for the target object. It should be noted that this function can be used on player characters to enable events that by default do not fire for players. By default, events fire all the time for NPC's and not at all for PC's.

Modifié par Challseus, 17 décembre 2009 - 09:25 .


#11
fluffyamoeba

fluffyamoeba
  • Members
  • 264 messages
You'd probably not want to use the heartbeat, maybe command complete event instead?

Modifié par fluffyamoeba, 18 décembre 2009 - 01:42 .


#12
Primogenitor

Primogenitor
  • Members
  • 24 messages
*kisses flufflyamoeba & BioWare*



Perfect! That should do nicely.



So it would be in the module load script to assign an "command complete event" to the player, and in that assigned event script pause the game when executed.