Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Page 1 of 3 1 2 3
#561135 10/01/15 04:06 AM
Joined: Dec 2014
journeyman
OP Offline
journeyman
Joined: Dec 2014
I have been talking to Baardvaark lately and he wanted a basic project setup. I've made a simple one that includes the MAIN scripts ( Affinity, attitude, stats etc etc...).

Here it is!
Nexus Mod Link



Last edited by TheMasterRat; 12/01/15 12:40 AM.
Joined: Oct 2014
B
enthusiast
Offline
enthusiast
B
Joined: Oct 2014
Definitely a good idea. A lot of my trip ups early were getting things set up.

Joined: Aug 2014
old hand
Offline
old hand
Joined: Aug 2014
So far the template will contain:

Basic story script systems like start goals, attitude and ownership so that if you attack or steal from people, they'll respond.

Basic default dialogs when you attack people and the like.

The translated key string localizations files (so that books have their text, for example)

The alignment folder so combat functions properly

The character creation level and class templates

Stats folder with excels and text files so you don't have to unpack main to mod characters and items.


And probably some other stuff I'm forgetting. I hope this helps some people out. Thanks to The_Master_Rat for putting most of it together (especially the scripts)!

Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
Nice idea, thanks for working on this.


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Joined: Aug 2014
old hand
Offline
old hand
Joined: Aug 2014
Another cool thing we'll be including is an awesome script that TheMasterRat developed which generates flags according to your attributes. So if you have 8 strength, it'll generate the flag "Strength8" as well all the preceding Strengths down to Strength5. This code works for attributes up to 20, and could easily expand by adding more numbers in the AttributeValues database. So in the dialog of a global character you could make the flag "Strength8" a condition for a certain keyword (such as a "Flex" keyword where you try to impress or intimidate someone with a show of strength).

Here's the code. There might still be some bugs, but it seems to work well. Note that in this current iteration, it will check for both players when you enter a dialog. So even if player1 initiates a dialog across the map from player2, player1 will benefit from player2's attributes for generating strings.

TheMasterRat also has code for traits so that if you have certain traits, a string will generate and you'll be able to use those in dialog. E.G., you're spiritual so you'll have more dialog options when talking to someone religious. We're going to bug test that a bit more and then we'll post the code for that.

Code
INIT

DB_CharacterToCount(CHARACTER_Player1);
DB_CharacterToCount(CHARACTER_Player2);

DB_AttributeNames("Strength");
DB_AttributeNames("Intelligence");
DB_AttributeNames("Constitution");
DB_AttributeNames("Speed");
DB_AttributeNames("Perception");
DB_AttributeNames("Dexterity");

DB_AttributeValues(5,"5");
DB_AttributeValues(6,"6");
DB_AttributeValues(7,"7");
DB_AttributeValues(8,"8");
DB_AttributeValues(9,"9");
DB_AttributeValues(10,"10");
DB_AttributeValues(11,"11");
DB_AttributeValues(12,"12");
DB_AttributeValues(13,"13");
DB_AttributeValues(14,"14");
DB_AttributeValues(15,"15");
DB_AttributeValues(16,"16");
DB_AttributeValues(17,"17");
DB_AttributeValues(18,"18");
DB_AttributeValues(19,"19");
DB_AttributeValues(20,"20");

KB

IF 
DialogStarted(_DialogName,_InstanceID)
THEN
ProcTriggerAttributeCheck();

IF
DialogStartRequested(_Character1,_Character2)
THEN
ProcTriggerAttributeCheck();

PROC
ProcTriggerAttributeCheck()
AND
DB_AttributeNames(_AttributeName)
AND
DB_CharacterToCount(_Character)
AND
CharacterGetAttribute(_Character,_AttributeName,_AttributeValue)
THEN
SetAttributeFlag(_AttributeName,_AttributeValue);


PROC
SetAttributeFlag((STRING)_Attribute,(INTEGER)_Value)
THEN
ProcGetValueAsString(_Attribute,_Value);

//This part generates a string and then subtracts 1 from the attribute value
 so that it will then generate all the appropriate strings down to 5. So if you have Strength8, it will generate "Strength8,"
 then "Strenth7," then "Strength6," etc.

PROC
ProcGetValueAsString((STRING)_Attribute,(INTEGER)_Value)
AND
DB_AttributeValues(_Value,_ValueAsString)
AND
StringConcatenate(_Attribute,_ValueAsString,_StringResult)
AND
NOT DB_EventSet(_StringResult)
AND
IntegerSubtract(_Value,1,_ValueMinusOne)
THEN
GlobalSetEvent(_StringResult);
DB_EventSet(_StringResult);
ProcGetValueAsString(_Attribute,_ValueMinusOne);


Ability code:

Code
DB_Abilities("WarriorLore");
DB_Abilities("RangerLore");
DB_Abilities("SingleHanded");
DB_Abilities("TwoHanded");
DB_Abilities("Blackrock");
DB_Abilities("Bow");
DB_Abilities("Crossbow");
DB_Abilities("Shield");
DB_Abilities("Reflexes");
DB_Abilities("ArmorMastery");
DB_Abilities("Sourcery");
DB_Abilities("Telekinesis");
DB_Abilities("Willpower");
DB_Abilities("FireSpecialist");
DB_Abilities("WaterSpecialist");
DB_Abilities("AirSpecialist");
DB_Abilities("EarthSpecialist");
DB_Abilities("Repair");
DB_Abilities("Sneaking");
DB_Abilities("Pickpocket");
DB_Abilities("Lockpicking");
DB_Abilities("Loremaster");
DB_Abilities("Crafting");
DB_Abilities("Barter");
DB_Abilities("Charm");
DB_Abilities("Intimidate");
DB_Abilities("Reason");
DB_Abilities("Charisma");
DB_Abilities("Leadership");
DB_Abilities("Luck");
DB_Abilities("DualWielding");

DB_AbilityLevel(0,"0");
DB_AbilityLevel(1,"1");
DB_AbilityLevel(2,"2");
DB_AbilityLevel(3,"3");
DB_AbilityLevel(4,"4");
DB_AbilityLevel(5,"5");


DB_CharacterToCount(CHARACTER_Player1);
DB_CharacterToCount(CHARACTER_Player2);

IF 
	DialogStarted(_DialogName,_InstanceID)
THEN
	ProcTriggerAbilityCheck();

IF
	DialogStartRequested(_Character1,_Character2)
THEN
	ProcTriggerAbilityCheck();

PROC
	ProcTriggerAbilityCheck()
AND
	DB_Abilities(_Ability)
AND
	DB_CharacterToCount(_Character)
AND
	CharacterGetAbility(_Character,_Ability,_AbilityLevel)
THEN
	ProcSetAbilityFlag(_Ability,_AbilityLevel);


PROC
	ProcSetAbilityFlag((STRING)_Ability,(INTEGER)_AbilityLevel)
AND
	DB_AbilityLevel(_AbilityLevel,_AbilityLevelAsString)
AND
	StringConcatenate(_Ability,_AbilityLevelAsString,_StringResult)
AND
	IntegerSubtract(_AbilityLevel,1,_AbilityLevelMinusOne)
AND
	NOT DB_AbilitySet(_StringResult)
THEN
	GlobalSetEvent(_StringResult);
	DB_AbilitySet(_StringResult);
	ProcSetAbilityFlag(_Ability,_AbilityLevelMinusOne);














Last edited by Baardvark; 29/08/15 11:47 PM.
Joined: Dec 2014
journeyman
OP Offline
journeyman
Joined: Dec 2014
This is work in progress, I'll include this script with the template project. It will also include two similar scripts for Abilities and Traits that will work the same way.

I just want to make sure it works properly before sending it to sea :P

Joined: Dec 2014
journeyman
OP Offline
journeyman
Joined: Dec 2014
I have added a link to the mod, I've edited the first post to add the link.

Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
Hi, I have a question about the Attribute check script.

I was looking at making one of these and see you already have one but just want to understand how it works before using it. Does this run every time you initiate a dialog?

Joined: Aug 2014
old hand
Offline
old hand
Joined: Aug 2014
Yes, it just checks Player1 and Player2's stats and generates global flags every time dialog is either initiated (from a trigger, for example) or requested, like when you click on someone. Probably unnecessary redundancy, because presumably initiated dialog covers all the possibilities, but I'd keep both to be safe.

If you want to make companion stats to count, you'll probably have to add some code like:

IF
DB_Companion(_Companion)
THEN
DB_CharacterToCount(_Companion)

And also the NOT version for when you dismiss a companion. We don't have companions count because it feels like it'd be too easy for people to access essentially every dialog option by spreading skills and attributes across the four characters.

Joined: Oct 2008
A
ALF Offline
journeyman
Offline
journeyman
A
Joined: Oct 2008
You could modify the script to iterate over the isPlayer database. Companions that are inside your party are also added to that database.

Good job, otherwise!

Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
Originally Posted by Baardvark
Yes, it just checks Player1 and Player2's stats and generates global flags every time dialog is either initiated (from a trigger, for example) or requested, like when you click on someone. Probably unnecessary redundancy, because presumably initiated dialog covers all the possibilities, but I'd keep both to be safe.


Since I already had some dialogs mapped out for future stat checks I plugged it in. Worked instantly.

Highly recommended. Good work guys.

Last edited by SniperHF; 07/03/15 02:26 AM.
Joined: Aug 2014
old hand
Offline
old hand
Joined: Aug 2014
Glad it's useful. We also have code for detecting abilities for dialog options if you want that. For example, a nice way to make pickpocket useful is to give scenarios where you can steal something from someone or do a sleight of hand maneuver in certain situations.

Last edited by Baardvark; 07/03/15 04:46 AM.
Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
_GLOBAL_Abilities.txt from the template?

Joined: Sep 2014
Z
apprentice
Offline
apprentice
Z
Joined: Sep 2014
I would suggest adding HOM_Waypoints.txt to your story scripts (from main story). It handles the way point menu and system.

Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
Originally Posted by Baardvark
Another cool thing we'll be including is an awesome script that TheMasterRat developed which generates flags according to your attributes. So if you have 8 strength, it'll generate the flag "Strength8" as well all the preceding Strengths down to Strength5. This code works for attributes up to 20, and could easily expand by adding more numbers in the AttributeValues database. So in the dialog of a global character you could make the flag "Strength8" a condition for a certain keyword (such as a "Flex" keyword where you try to impress or intimidate someone with a show of strength).


Currently having a problem with this attribute script. It works but seems to generate attributes 1 level above where you should be. My character with 5 intelligence is getting the flag for 6.

Have you run into this?

Joined: Dec 2014
journeyman
OP Offline
journeyman
Joined: Dec 2014
Quote
Currently having a problem with this attribute script. It works but seems to generate attributes 1 level above where you should be. My character with 5 intelligence is getting the flag for 6.

Have you run into this?


Te script takes both players into consideration. Check if your second player has 6 Intel.

Last edited by TheMasterRat; 10/03/15 10:20 PM.
Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
Originally Posted by TheMasterRat

The script takes both players into consideration. Check if your second player has 6 Intel.


I actually took out the 2nd player since it's a 1 player mod.

Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
Did some more testing today and found that the issue is only present at exactly attribute level 5. If I have Strength5 the script spits out Strength6 flag. But if I actually have Strength6 I only get 6 (and not 7). So it's only giving me an extra flag on level 5.

I tried this up to level 10 and got the same results.
5=6
6=6
7=7
8=8
etc.

Joined: Dec 2014
journeyman
OP Offline
journeyman
Joined: Dec 2014
Originally Posted by SniperHF
Did some more testing today and found that the issue is only present at exactly attribute level 5. If I have Strength5 the script spits out Strength6 flag. But if I actually have Strength6 I only get 6 (and not 7). So it's only giving me an extra flag on level 5.

I tried this up to level 10 and got the same results.
5=6
6=6
7=7
8=8
etc.


hoho nice catch!

Thanks for letting me know, I'll figure this issue out and post a fix.

Joined: Jan 2015
K
journeyman
Offline
journeyman
K
Joined: Jan 2015
Is it possible to add this stuff to a mod that's already been made or is it only possible to use if you start from scratch?

Page 1 of 3 1 2 3

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5