Aller au contenu

Photo

Turn Based Combat mod Help


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

#1
Dorateen

Dorateen
  • Members
  • 477 messages
BartjeD,

If you see this thread, I was hoping I could get a little help here with your True Turn Based Combat mod.

I think I have everything downloaded and installed in the proper places, and the combat testing modual seems to work. There is a hang-up after the PC's turn is ended and it looks like Sydney never takes her first action. But I read through the comments and saw there might be a performance issue, and I may not have the most current version.

But that's not the main concern I have right now.

I would like to utilize this in a module I just started to put together. I have imported the conversations that seem to be related to the combat system, and 10 scripts as well. I have put the D&D.tlk file in the module properties.

What do I need to actually implement this? I checked out the combat testing mod in the toolset, thinking that "Dorateen enters the Fray" was triggered by a Speak Trigger, but evidently not. So I am wondering what I have missed, what specifically needs to be done by a builder in order to initiate the system when an enemy is spotted.

Any nudge in the right direction would be most appreciated. The concept is bloody brilliant. If I can get this working, I will intend to use this in the upcoming project.

Thanks!

Modifié par Dorateen, 27 novembre 2010 - 06:38 .


#2
BartjeD

BartjeD
  • Members
  • 249 messages
Hey Dorateen sorry for the late response I didn't get the nudge untill you PMed me. (I'll pay close attention from now on, if you need help)

Essentially you'll need to copy the scripts & most conversations from the module "com_mod".
These work in conjunction with the Spellframework from Lady D & Jaillax in the override folder.

I've modified the basic NWN2 AI scripts creatures use to handle the TbCS so if you copy all scripts to your campaign or module you won;t need to change the creatures scripts.

As PMed I was working on some issues when I had a major computer wipe which lost me the newer version(s).

If I remember correctly most if not all of the hickups are related to the AI (mage) scripts and Sydney having too many spells. (it checks for strategies using all spells available, the more she has the longer it takes.) I think this causes the AI to "timeout" whenever a creature has too many spells.

Melee creatures are far less affected and most other creatures have special AI's to exploit their abilities.

The concept is a "weighed" tally of all options in which circumstances add additional weight (multiplier) to any option that meets certain criteria. Then it randomly selects from the tally and executes the option associated with the number it draws. (so 0 to 5 = invisible, 6 to 20 = Magic Missile etc..)

The Speak trigger you refer to is actually located in the combat_nexus script. Which fires whenever someone or something is seen and checks if it should start combat.

In the beginning of this script you will also find the disguise systems.


I especially like the working Contingency spells! Posted Image 
I've used a lot of Baldurs Gate 2 inspiration for this system.

Modifié par BartjeD, 16 décembre 2010 - 11:17 .


#3
Dorateen

Dorateen
  • Members
  • 477 messages
Outstanding! If I can get this to work, it will be a centerpiece of the module I'm working on.

That looks like the one thing I did not do, placing the scripts in the campaign folder. I will try that and see if it gets the combat system firing.

About BG2, I thought the contingency spells were pretty neat. I had one charatcer who set it up so that if he was reduced below 50% hitpoints, he would cast summon spiders.

Thanks for the reply, and I'll let you know how it work out!

#4
BartjeD

BartjeD
  • Members
  • 249 messages
You can add Summoning spells and what not to the contingency by modifying the conversations. (spell_contingency and spell_chain_contingency)

Maybe you will also need to add a few lines of code in the contingency spell scripts itself to make sure that the summons are getting fed a location. (I think it's currently geared to only have affects that apply on the creature, not location) This should be easy if you qualify the spells that need locations and give them a seperate execution code. (I'll have a look at it)



[edit] Isn't contingency supposed only to have effects that apply to the character per D&D 3.5? (Was this different in AD&D per BG2?) Posted Image

Modifié par BartjeD, 17 décembre 2010 - 05:00 .


#5
BartjeD

BartjeD
  • Members
  • 249 messages
Oh by the way, this is probably not worth mentioning because I think you've done this already, but to get the system to work properly you'll also need to copy a few blueprints (creatures & items which the system uses.)

The most important ones are the (by tag) "combat_state" (combat master), "action_time" (Your turn dialogue), "contingency" and "wish". The items are spell related which you can find in the category "item summons" in the combat_mod.

The heart of the system is the script "combat_nexus", from here most of the processes are triggered and tracked. It has two modes of operation: One if run by a normal creature (also PCs) and one if run by the combat_state specifically. Essentially this is the script that says: It's your turn to do something but it also decides when to start and end combat. (including disguises etc..)

Second most important is the "combat_execute_action" script, this one contains all the actions creatures can perform in combat. The AI hooks into this by selecting an action number by script and the player hooks into this by selecting an action number through conversation. (action_time & Your turn dialogue)
For magic there is a seperate extension to this script because of the additional mechanics at work there.

The most complex part you will probably find to be the AI scripting, particularly the dynamic AI's. (I suggest you leave those for last, getting to know the straight forward bits first)

Modifié par BartjeD, 17 décembre 2010 - 05:02 .


#6
Dorateen

Dorateen
  • Members
  • 477 messages
Yes, I think this is what I need to get me on the right track!

Thank you for all the information.

#7
Dorateen

Dorateen
  • Members
  • 477 messages
Hey, I was able to get the system up and running, thanks to your last few posts. Right now, I have everything copied over in the campaign folder, and I copied the necessary blueprints into the modules. I have enjoyed the first few successful battles.

Now, I have a very important question.

Will it be possible to get the other party members involved the same way as the main PC? I'm not talking about companions, but player created characters using the Storm of Zehir party creation system. This essentailly makes multiple PCs.

I was able to get the other party members to join combat in a test fight, but theay were working on auto-pilot. While this made for an interesting battle, it's not exactly what I am looking for. I would like to control the other party members individually, getting the same menu and tactical options when it is their turn.

Is there a way to add a "Get next PC" function into the appropriate scripts, so that it will cylce through all the PCs in a player's party during the combat round? If we can work this into the system, it will be a huge step forward.

Also, under the abilities submenu - divine... I did not see Smite Evil for a paladin character. Hopefully this is something that can be added in.

I do realize this is a work in progress, but it is so close to being perfection!

Thanks for creating this mod, and look forward to implementing it fully.

#8
BartjeD

BartjeD
  • Members
  • 249 messages
I was working on this before I read your message and theoretically this is possible.
What Í've coded now works a little like this:

1. Normally the system lets only the PC choose through conversation and uses AI scripts for NPC that aren't the main player character.
2. I've added a section that checks if the NPC is a roster member and if so launches a conversation for the PC in which he selects an action for the companion.
3. The variables are stored on the companion and the companion executes the scripts & moves. (also works for henchman now)

At first I tried launching conversations for party members themselves by making the PC control them but this proved a dead end so I ended up following these three steps.


What I'm wondering about is how I should identify the PC's / party members you are talking about. Are these SoZ party member characters all treated like PC's? Or  NPC's? Or Henchmen? How do I make the code treat them like I treat companions right now? How do I identify them from regular NPC's?

For companions and henchmen this is simple, I tell the code to check the companion roster as well as henchmen master. If the NPC is on the roster or has a PC master then the script fires the selection dialogue.

Does anyone know how this works with SoZ style party members? There is still only one main character right???? Do Soz Party members have a master or are they on the campaign roster? Or do they appear to be PC's in the code? (GetIsPC function for example? vs GetPrimaryPlayer)


//For easy reference here is the code that launches said conversations && AI.

   if(GetIsRosterMember(OBJECT_SELF) == TRUE && IsInConversation(OBJECT_SELF) == FALSE && iMade != 0 && iSelect == 0) //Companion 
    {//PC controls Companions
    iSelect = 1;
    ExecuteScript("combat_companion_timer", OBJECT_SELF); //--> This indirectly launches the conversation in which you can choose an action for your Companion. 
    }
   else if(GetMaster(OBJECT_SELF) == GetPrimaryPlayer() && IsInConversation(OBJECT_SELF) == FALSE && iMade != 0 && iSelect == 0) //Henchman 
    {//PC controls henchmen
    iSelect = 1;
    ExecuteScript("combat_companion_timer", OBJECT_SELF);
    }
   else if(GetIsOwnedByPlayer(OBJECT_SELF)== FALSE && GetIsPC(OBJECT_SELF)==FALSE && iMade != 0 && iSelect == 0) //I am the Computer and no one else is doing anything
    { //select action and execute!
    iSelect = 1;
    ExecuteScript("combat_comp_select_action", OBJECT_SELF); 
    }


So my question is: How do I know, codewise, if the OBJECT_SELF is party of players party? Do SoZ companions return as being PC's? Owned creatures?

In my experience there is still one main player character but what are the other created party members then?
You say it would work if I checked for PC's? (then that would be a conversation with the main character deciding for the other "PC" SoZ style party members.

This sounds incredibly complicated if you type it out, I hope I got the point across Posted Image

I hope someone can give some insight into this!

Modifié par BartjeD, 21 décembre 2010 - 04:28 .


#9
Dorateen

Dorateen
  • Members
  • 477 messages

BartjeD wrote...

Does anyone know how this works with SoZ style party members? There is still only one main character right???? Do Soz Party members have a master or are they on the campaign roster? Or do they appear to be PC's in the code? (GetIsPC function for example? vs GetPrimaryPlayer)


I will have to look closer at this, but I believe the SoZ style party members are treated as additional PCs. Yes, there is a main PC that is selected at the beginning of the campaign, but then the palyer uses the Party Editor to add these additional characters either stored on their local vault, or create new ones right at the menu. In a sense, these player-created characters would be like other players in a multi-player session.

I would hope GetIsPC would work, perhaps searching for additional PCs after the Primary Player. I'm not sure.

There sounds like the possibilty on the Your Turn, to allow the PC to select options for the other players. But in an ideal turn-based situation all the characters should be acting independently. So for example, and of course decided by initiative,

PC takes action
Enemy takes action
Next Party member takes action

And so on, until all the combatants have acted in that turn.

It will probably be a challenge to set up this way, but I will see what I can find out.

#10
BartjeD

BartjeD
  • Members
  • 249 messages
You mentioned an occasional bug that caused the system to stop working. I think it had to do with several combat state variables that were being applied too early that made the system think the player was choosing an action while actually he wasn't. (thereby you ended up waiting forever)
The code has been cleaned up and I'm hunting for other bugs.

I Think the system should be more reliable now but I'm looking at looking at possibilities to rebuild it into a more centralized structure. Right now all creatures figure out for themselves whether or not they can do something. It might be possible to have this regulated from one creature who then tells the others when their turn is. Sort of a combat stage director.

I've added in the code for companions, henchmen & SoZ PC-NPC's as well as various other things.

Before the crash I had a system that allowed casters to summon more than one creature, with the possibility of a summoning spell resulting in several lower level creatures. There was also a strong random element to the creatures you got. For druids there was a seperate list of creatures which were somewhat stronger though nature oriented. Do you feel this would suit your adventure? If so I can recode it once I get back to having fun making spells.

I'll hold off on uploading it until I have tested it more thoroughly but I'll give a heads up when it's out. Should be sometime this week still. Posted Image

Modifié par BartjeD, 22 décembre 2010 - 03:57 .


#11
Dorateen

Dorateen
  • Members
  • 477 messages

BartjeD wrote...

Before the crash I had a system that allowed casters to summon more than one creature, with the possibility of a summoning spell resulting in several lower level creatures. There was also a strong random element to the creatures you got. For druids there was a seperate list of creatures which were somewhat stronger though nature oriented. Do you feel this would suit your adventure? If so I can recode it once I get back to having fun making spells.

I'll hold off on uploading it until I have tested it more thoroughly but I'll give a heads up when it's out. Should be sometime this week still. Posted Image


This is great news! I like the idea of themed-summons. There is a druid NPC I am planning, and strong nature orientated summons could work well.

I ran through another test battle, and did not have any hang-ups. System seems to be running bug free. The one thing I missed was under the divine abilities for a paladin character, he could not smite evil. He was able to lay on hands, so that worked perfectly.

Looking forward to the update!

#12
BartjeD

BartjeD
  • Members
  • 249 messages
Well we've had a major breakthrough there, it appears that for whatever reason I included the unfinished script I mentioned into the current build so its already there! (The nw_s0_summon script)
I've made some minor tweaks and finished it up by making sure that the creatures can be dispelled and banished or dismissed. Essentially they function like henchmen, you can't control them but they are your allies.
 
As a test I've run a battle with Sydney which ended up being a major battle with five or six summons on either side . I used Summon Creature V (I think) and got 3 Eath Elementals while Sydney used IX and got two greater? Water Elementals. After that I got a Nishruu and the battle escalated Posted Image Posted Image


Now I'm left with a question concerning the Nishruu, their attacks dispell things but if they attack a summoned creature then it gets sent back to wherever it came from right? Do you happen to know what the dispel check would be for that? What would be the Nishruu's caster level?

I'l go do some research. I can't find too much on the internet about Nishruu so far. maybe I'll just put it down for 13 + Nishruu's level instead of 11 + casterlevel to give it a slight bonus.


Oh, and I'll add Smite Evil to the list! Smite Good still exists as well doesn't it? Perhaps I linked it to the wrong feats? I'll have a look!

Modifié par BartjeD, 22 décembre 2010 - 06:34 .


#13
Dorateen

Dorateen
  • Members
  • 477 messages

BartjeD wrote...
 
As a test I've run a battle with Sydney which ended up being a major battle with five or six summons on either side . I used Summon Creature V (I think) and got 3 Eath Elementals while Sydney used IX and got two greater? Water Elementals. After that I got a Nishruu and the battle escalated Posted Image Posted Image


Ha! That sounds like quite a fight. When I first got the combat mod up and running, I took on Sydney with a17th level fighter, so I had no summoned allies. But she summoned a Greater Earth Elemental and a Celestial Bear. I let them beat on me for a while while I concentrated on taking down Sydney as quick as possible.

The Nishruu... I think I remember them from BG2. I would have to dig up some resources to see what caster level would apply. I would think they only dispel magic on buffing spells and such. If they could also dispel summoned creatures, now that would be interesting.

#14
BartjeD

BartjeD
  • Members
  • 249 messages
Imagine your all-powerful army of summons vanishing before the Nishruu like a knife through hot butter, now that would make a wizard put on his grumpy hat!
Posted Image

#15
BartjeD

BartjeD
  • Members
  • 249 messages
I'm putting on the finishing touches now before the update, I expect it will be out today.
I've put everything in place to use SoZ companions and choose their actions, it's still untested though. It should work the same with normal companions.

Henchmen aren't controllable mainly because then I'd have to make custom menu's for all the summons and their special abilities. Maybe later though.

There are also several new spells:
-Protection from Normal Weapons (+0, level 5)
-Protection from Magical Weapons (+3, level 6)
-Absolute Immunity (+5, level 9)
-Dorateen's Dynamic Disguise (DDD :D, a disguise to bypass hostile creatures, self only. level 4)

I'm also going to update several Summon undead scripts to work with the system and I'll add in a few Necromancy and Blood Magic bits. Oh, and repulsion but that will all be in the next update.

Modifié par BartjeD, 23 décembre 2010 - 04:25 .


#16
Dorateen

Dorateen
  • Members
  • 477 messages
This is very exciting! I have just voted on your mod on the Vault, because at this stage, it is already a brilliant addition to the building community.

I had seen the comments about a disguise system. Now I will have to set up some encounters that can make use of the DDD.

I'm posting a direct link to the Vault page here, for any curious players or builders that want to learn more about the system.

http://nwvault.ign.c...h.Detail&id=417

As soon as I get to try the updated version, I'll let you know how it goes.

Modifié par Dorateen, 23 décembre 2010 - 07:06 .


#17
BartjeD

BartjeD
  • Members
  • 249 messages
Thanks for the vote!  Posted Image

I've updated the Vault files with the new version and cleaned up the description a little to make it look friendlier.

In this new build several changes were made in both the Overide files as well as the test module ittself. To update your version you should copy all the scripts from the module section again.
The Overide section can easily be replaced as a whole I think unless you've got other files mixed in there. The new TbCS overide is less messy and has more folders so it's easier to keep track of what's what.

There's also a new system for weapon sheathing that I'm experimenting with, in this version creatures will put their weapons away until they enter combat. No dual weapon functionality yet though. (Oh, and wizards don't put staff's on their backs -- I don't have an effect for display for that)


One other thing,
the summoning system I mentioned earlier uses a lot of custom blueprints, most of them, if not all found in the "summons" creature category within the combat testing module. Your summoning spells won't work part of the time without these!

Modifié par BartjeD, 23 décembre 2010 - 08:12 .


#18
BartjeD

BartjeD
  • Members
  • 249 messages
I've tested the hotfix version of december 24th and can report that I can positively control my summoned Simulacrum. It's actually really weird to see and control another character just like your main. Therefore I added: "the other " + [Name here] to keep them apart. B)

The variable "com_controllable" can be set on a creature to indicate that the player should be able to control them in combat. I haven't yet implemented a check to prevent it from being used only by NPC's friendly to the PC, so beware Posted Image.

You probably won't need to use it, but it's there just in case the system still doesn't recognise your companion SoZ PCs.

Happy Christmas!

Modifié par BartjeD, 24 décembre 2010 - 09:08 .


#19
Dorateen

Dorateen
  • Members
  • 477 messages
BartjeD, I just sent you an e-mail about the latest version. However, you can disregard the last comment abut the combat mod crashing. I was able to load in a character and fight Sydney. So it does appear to be working.



That must mean the issue is with me, and I did not import everything I need. I'm going to start fresh, and make sure the module I am working on is set up exactly as your combat mod, with regard to scripts, blueprints, etc.



I'll let you know how it goes.

#20
BartjeD

BartjeD
  • Members
  • 249 messages
What I did was to save the "combat_mod" to a directory and then copy the contents of that directory over to the Campaign folder. Delete a few items and it's done. (worldmap script, Lance's readable books, Cypher UI, those artifacts as well as the module .ifo)

I suppose there are a number of things that could be wrong, you say you copied everything into the overide directory?
There are a few folders that were renamed to make it more orderly. Maybe that's where the problem is?

If you've replaced all the old scripts in your campaign folder then I can't imagine the problem being on that side.
I have to say that I did have mysterious crashes myself until I found out that they were related to the script that manages weapon sheathing.
You can disable that script, called "inc_immersion_item_carriage" and "include_itemsets" by commenting out everything but the functions themselves. (so the scripts that call them are still valid, but they simply don't do anything)

In your case this is unlikely to be the culprit because they were linked to the "module_onequip" script which I don't assume you've hooked up in your campaign / module.

Modifié par BartjeD, 26 décembre 2010 - 07:35 .


#21
BartjeD

BartjeD
  • Members
  • 249 messages
The Issue is solved and companions are finally working!



I'll be releasing another update soon, before my examination period in Januari.