Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
#594401 23/10/16 12:05 PM
Joined: Sep 2016
stranger
OP Offline
stranger
Joined: Sep 2016
Hey guys,
It's NuclearToast again. I'm still working on my last era mod and encountered some things now that i couldn't find out how to get them to work by myself, maybe some of you can help.

1. How do you apply that "wet" effect when it's raining at the atmosphere? Thought of creating a trigger around the atmosphere region and applying that effect when the player enters this trigger, but: Does the effect renew when it ticked trough? And is there maybe a much simpler method?

2. How do i get NPCs to equip any weapon or shield, like some of the premade already have(e.g. the guards)?

3. How do i set up a player on player dialog with that exclamation mark thingy?

4. I got the waypoint system to work. But there's the problem that you can only use it by using the shrines, the icon on the right border does not work. How do you fix this?

So i hope you can answer my questions and i thought it's better to first let them stack up and then ask in one thread than open a hundred for all.


Cheers NuclearToast
Joined: Sep 2015
A
addict
Offline
addict
A
Joined: Sep 2015
Hey,

I'll answer 1. and 2. (3 and 4 is for SniperHF who got through all these things):

1. Larian uses Event triggers to define status areas. The effect gets applied via character script as status influence (permanent status with certain strength until completely removed by script or temporarily replaced by a contrary status with higher status strength; will be re-applied after resurrection). Look at Hunter's Edge as an example:

There is the huge 'DAF_VIllageRain' event trigger that throws the event 'RainEventOn' on a character that enters the trigger and the event 'RainEventOff' when he leaves (you fill in the event names in the sidebar of the trigger). The two events are catched in the 'Base' character script:

Code
EVENT RainEnter
ON 
	OnTriggerEnter(__Me,"RainEventOn")
ACTIONS
	AddStatusInfluence(__Me, WET, 20)
	
EVENT RainLeave
ON 
	OnTriggerLeave(__Me,"RainEventOff")
ACTIONS
	RemoveStatusInfluence(__Me, WET, 20)


So the character gets the WET status with a strength of 20 (strength can sum up). Every house of Hunter's Edge has another event trigger ('DAF_NoRain1', 'DAF_NoRain2'...) that throws the events 'NoRainEventOn' (trigger enter) and 'NoRainEventOff' (trigger leave).

The character script adds the status influence WARM (same strength):

Code
EVENT NoRainEnter
ON 
	OnTriggerEnter(__Me,"NoRainEventOn")
ACTIONS
	AddStatusInfluence(__Me, WARM, 20)
	
EVENT NoRainLeave
ON 
	OnTriggerLeave(__Me,"NoRainEventOff")
ACTIONS
	RemoveStatusInfluence(__Me, WARM, 20)

The reason for not just removing the WET status influence is that you don't leave the WET trigger. Warm and wet influence 20 will result in zero status (I noticed a short warm period when entering a house sometimes; it doesn't seem to be 100% accurate here). When you leave the no rain trigger (i. e. the house) the warm influence gets removed, so you have WET 20 vs WARM 0 again.
There's a location with three fireplaces in Hunter's Edge; they have the 'PUZZLE_StatusApplier' that adds another 20 warm strength in a radius of 10. So only when you stand in the range of several fireplaces you'll get the warm status (40 or 60 warm vs 20 wet), otherwise it's par to par (20 vs 20).

That's how it works. It would be great if we could add a status influence to an atmosphere (not just a visual effect). But currently there is no actual weather system in D:OS.

2. In the sidebar you can fill in equipment. There's no script command to let non-global characters equip a certain weapon, as far as I know. There's only 'CharacterSwitchWeaponType' but it seems to have hardcoded conditions (range? AP?) and doesn't allow to define a specific weapon from inventory.

Last edited by Abraxas*; 23/10/16 08:33 PM. Reason: Correction --> 'WET 20 vs WARM 0' of course

My mods for DOS 1 EE: FasterAnimations - QuietDay - Samaritan
Joined: Jun 2015
F
enthusiast
Offline
enthusiast
F
Joined: Jun 2015
2. Characters auto-equip stuff assigned by Equipment.txt. I think they do it in a first-come-first-server order. Best look at Wolgraff's entry, because he is the only one of the companions who has a spare bow and he has his two daggers equipped when you hire him.
(When I undressed and redressed him via script, he had the bow equipped, so order matters.)

For 3 and 4 look into the Osiris scripts. The whole exclamation marker thing must be somewhere in the Osiris scripts.

_Global_AffinitySystem.txt has

Code
PROC
  ProcDefineAffectionDialog((CHARACTER)_SrcChar,(STRING)_Dialog)
  AND
  NOT DB_DualDialogsDisabled(1)
  AND
  _Player.DB_IsPlayer()
  AND
  NOT DB_Companion(_Player)
  AND
  _Player!=_SrcChar
  AND
  NOT DB_AffectionDialog(_Dialog,_SrcChar,_)
THEN
  PROC_CheckPlayTutWithDelay("TUT_DualDialog",500);
  PROC_LoopEffectAtCharacter("FX_GP_ExclamationMark_A",_Player,"AffectionExclamationMark","__ANY__");
  PROC_LoopEffectAtCharacter("FX_GP_ExclamationMark_A",_SrcChar,"AffectionExclamationMark","__ANY__");
  CharacterSetHasDialog(_Player,1);
  CharacterSetHasDialog(_SrcChar,1);
  DB_AffectionDialog(_Dialog,_SrcChar,_Player);

You probably do not want to show tutorial messages in your mod so you can skip the first call.
(... and you have to look up how the procedures work)
You can play loop effects with character scripts too if you wish.


I just quickly looked over some scripts and I believe, the Rift Travel button is shown with the call SetHomesteadKeyState(<INT>) like in HOM_Key.txt

Code
IF
  DB_GlobalEvent("CYS_HomesteadKeyGiven")
THEN
  DB_FirstTimeUse(1);
  SetHomesteadKeyState(2);
  UnlockWaypoint("WAYP_Homestead",TRIGGER_CentralRoomEntry);
  UnlockWaypoint("WAYP_Cyseal_NorthGate",TRIGGER_WAYP_Cyseal_NorthGate_Pos);


with parameter 1 being enabled and 2 being enabled and blinking, and 0 being disabled (used in the Luculla Mines I think).

Rift Travel is disabled in the endgame

Code
PROC
  Proc_Endgame_Dreamsequence_Start()
THEN
  SetHomesteadKeyState(0);
  EnableSendToHomestead(0);
  PROC_TeleportingRegionBlockOn();
  CharacterTeleportPartyToTrigger(TRIGGER_END_RoomA_Entrance,"");
  DB_AD_Dialog(CHARACTER_Zandalor,"HOM_AD_Zandalor_PortalWait");
  CharacterSetOnStage(CHARACTER_Zandalor,1);
  ProcRemoveAllDialogEntriesForSpeaker(CHARACTER_Zandalor);
  Proc_END_PrepRoomB();
  IgnoreOnlyCompanionDialogs(1);
  ProcCancelAllCompanionDialogs(CHARACTER_Madoc);
  ProcCancelAllCompanionDialogs(CHARACTER_Jahan);
  ProcCancelAllCompanionDialogs(CHARACTER_Wolgraff);
  ProcCancelAllCompanionDialogs(CHARACTER_Bairdotr);
  ProcRemoveAllDialogEntriesForSpeaker(CHARACTER_Madoc);
  ProcRemoveAllDialogEntriesForSpeaker(CHARACTER_Jahan);
  ProcRemoveAllDialogEntriesForSpeaker(CHARACTER_Wolgraff);
  ProcRemoveAllDialogEntriesForSpeaker(CHARACTER_Bairdotr);
  DB_AD_Dialog(CHARACTER_Madoc,"END_AD_Madora");
  DB_AD_Dialog(CHARACTER_Jahan,"END_AD_Jahan");
  DB_AD_Dialog(CHARACTER_Wolgraff,"END_AD_Wolgraff");
  DB_AD_Dialog(CHARACTER_Bairdotr,"END_AD_Bairdotr");
  DB_EndLevelStarted(1);


If you want to know, why the button is not shown at all in the beginning, you have to ask Larian ... hmm, don't even bother ;-)
All we can do is guess that it's only shown when it's activated once and then never removed again.
(A reason not to remove it with parameter 0 could be to have an event to catch to display a auto-dialog and diaog in the mines.)


Last edited by FrauBlake; 23/10/16 03:03 PM.
Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
Originally Posted by NuclearToast

2. How do i get NPCs to equip any weapon or shield, like some of the premade already have(e.g. the guards)?


Custom equipment file entries (or just find ones that already exist that have shields)

Quote

3. How do i set up a player on player dialog with that exclamation mark thingy?


Assuming you have all the usual main scripts, this should work:
INIT:
DB_PartyDialogs(CHARACTER_Player1,"RUI_RightStatus_DD_Trait");
DB_PartyDialogs(CHARACTER_Player2,"RUI_RightStatus_DD_Trait");

KB:
IF
CharacterEnteredTrigger(_Player,TRIGGER_RUI_RightStatusTrig)
AND
_Player.DB_IsPlayer()
THEN
ProcDefinePartyDialog("RUI_RightStatus_DD_Trait");


Quote

4. I got the waypoint system to work. But there's the problem that you can only use it by using the shrines, the icon on the right border does not work. How do you fix this?




In the init section toss this somewhere if you haven't already:
SetHomesteadKeyState(1);

Or you could put it in a statement if you want it to unlock later like how Larian gives it to you once you first reach the homestead.


In the KB section of your script somewhere, put this:
IF
CharacterRequestsHomestead(_Player)
AND
NOT TeleportingRegionBlock(1)
THEN
OpenWaypointUI(_Player,"",ITEM_NULL);


Last edited by SniperHF; 23/10/16 08:25 PM.
Joined: Sep 2016
stranger
OP Offline
stranger
Joined: Sep 2016
Thanks for your answers guys. Got the dialog and rain thing now.
For the equpiment: I got an "NPC_Cultist_Warrior" which i want to equip an axe and a shield. I also wrote that in the equipment.txt since i already figured that out, the problem now is that he just doesn't equip it...no matter what i do.
Here's his entry:
Quote
new equipment "NPC_Jared_UNIQUE"
add equipmentgroup
add equipment entry "WPN_Axe_A"
add equipmentgroup
add equipment entry "WPN_Wood_Shield_A_B"
add equipmentgroup
add equipment entry "POTION_Large_Healing_Potion"
add equipmentgroup
add equipment entry "POTION_Large_Healing_Potion"

I'm right if i assume the entrys need to have the RootTemplate name?

Last edited by NuclearToast; 24/10/16 06:28 PM. Reason: Didn't read the whole thing about WPs, works now ;)

Cheers NuclearToast
Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
It doesn't need the root template name, it needs the stats file entry name. Sometimes they are the same and sometimes they aren't.

I took a quick look and the stats entry for "WPN_Wood_Shield_A_B" is just "WPN_Wood_Shield_A". So you need to use WPN_Wood_Shield_A



Also that WPN_Axe_A is a pretty high level axe if you didn't notice. It should scale anyway but I usually try and get them to match if I'm writing a custom entry. Unless of course it's a high level NPC in which case ignore me :P

Joined: Sep 2016
stranger
OP Offline
stranger
Joined: Sep 2016
Well, thank you guys, everything works now. But i ran into another problem and thought i'll just ask here to not spam everything with my threads: So i got into quest scripting and stuff...now i want to add a new quest, i figured everything out by myself and also checked out some tutorials and threads about it now since i can really not get it to work.

I added it in the quest_prototypes.lsx, made up all the TranslatedStringKey entry and also wrote a script to add it. But it just does not work, i tried it via seperate story goal as well as directly via dialog action but nothing gets added to the Journal and i really can't figure out what the problem is...i also double checked my node structure in the .lsx. And this is the case with all quests. Below the script i used and my quest_prototypes.lsx

Quote
IF
DialogEnded("TWL_StartDialog",_)
THEN
TriggerUnregisterForPlayers(TRIGGER_DIALOG_StartPartyDialog);
QuestAdd("TWL_MainQuest");
QuestUpdate("TWL_MainQuest","Update1");


Quote
^<?xml version="1.0" encoding="UTF-8" ?>
<save>
<region id="Quests">
<node id="root">
<children>
<node id ="Quest">
<attribute id="QuestID" value="TWL_DeadWife" type="22"/>
<attribute id="MainQuest" value="0" type="19"/>
<attribute id="QuestTitle" value="TWL_DeadWife_Title" type="22"/>
<children>
<node id ="QuestState">
<attribute id="Status" value="Update1" type="22"/>
<attribute id="Description" value="TWL_DeadWife_Update1_Descr" type="22"/>
<attribute id="Rewards" value="" type="22"/>
<attribute id="Marker" value="" type="22"/>
<attribute id="Achievement" value="quest1" type="22"/>
<attribute id="Act" value="" type="4"/>
<attribute id="Gain" value="" type="4"/>
<attribute id="ReputationGain" value="" type="4"/>
<attribute id="StatStrongOverLevel" value="" type="22"/>
<attribute id="StatSlightOverLevel" value="" type="22"/>
<attribute id="StatIntendedLevel" value="" type="22"/>
<attribute id="StatUnderLevel" value="" type="22"/>
</node>
<node id ="QuestState">
<attribute id="Status" value="Update2" type="22"/>
<attribute id="Description" value="TWL_DeadWife_Update2_Descr" type="22"/>
<attribute id="Rewards" value="" type="22"/>
<attribute id="Marker" value="" type="22"/>
<attribute id="Achievement" value="" type="22"/>
<attribute id="Act" value="1" type="4"/>
<attribute id="Gain" value="8" type="4"/>
<attribute id="ReputationGain" value="" type="4"/>
<attribute id="StatStrongOverLevel" value="" type="22"/>
<attribute id="StatSlightOverLevel" value="" type="22"/>
<attribute id="StatIntendedLevel" value="" type="22"/>
<attribute id="StatUnderLevel" value="" type="22"/>
</node>
<node id ="QuestState">
<attribute id="Status" value="Update3" type="22"/>
<attribute id="Description" value="TWL_DeadWife_Update3_Descr" type="22"/>
<attribute id="Rewards" value="" type="22"/>
<attribute id="Marker" value="" type="22"/>
<attribute id="Achievement" value="" type="22"/>
<attribute id="Act" value="1" type="4"/>
<attribute id="Gain" value="8" type="4"/>
<attribute id="ReputationGain" value="" type="4"/>
<attribute id="StatStrongOverLevel" value="" type="22"/>
<attribute id="StatSlightOverLevel" value="" type="22"/>
<attribute id="StatIntendedLevel" value="" type="22"/>
<attribute id="StatUnderLevel" value="" type="22"/>
</node>
</children>
</node>
<node id ="Quest">
<attribute id="QuestID" value="TWL_MainQuest" type="22"/>
<attribute id="MainQuest" value="0" type="19"/>
<attribute id="QuestTitle" value="TWL_MainQuest_Title" type="22"/>
<children>
<node id ="QuestState">
<attribute id="Status" value="Update1" type="22"/>
<attribute id="Description" value="TWL_MainQuest_U1" type="22"/>
<attribute id="Rewards" value="" type="22"/>
<attribute id="Marker" value="" type="22"/>
<attribute id="RemoveMarker" value="" type="23"/>
<attribute id="Achievement" value="quest1" type="22"/>
<attribute id="Act" value="" type="4"/>
<attribute id="Gain" value="" type="4"/>
<attribute id="ReputationGain" value="" type="4"/>
<attribute id="StatStrongOverLevel" value="" type="22"/>
<attribute id="StatSlightOverLevel" value="" type="22"/>
<attribute id="StatIntendedLevel" value="" type="22"/>
<attribute id="StatUnderLevel" value="" type="22"/>
</node>
<node id ="QuestState">
<attribute id="Status" value="Update2" type="22"/>
<attribute id="Description" value="TWL_MainQuest_U2" type="22"/>
<attribute id="Rewards" value="" type="22"/>
<attribute id="Marker" value="" type="22"/>
<attribute id="RemoveMarker" value="" type="23"/>
<attribute id="Achievement" value="" type="22"/>
<attribute id="Act" value="" type="4"/>
<attribute id="Gain" value="" type="4"/>
<attribute id="ReputationGain" value="" type="4"/>
<attribute id="StatStrongOverLevel" value="" type="22"/>
<attribute id="StatSlightOverLevel" value="" type="22"/>
<attribute id="StatIntendedLevel" value="" type="22"/>
<attribute id="StatUnderLevel" value="" type="22"/>
</node>
</children>
</node>
</children>
</node>
</region>
</save>



Cheers NuclearToast
Joined: Jun 2015
F
enthusiast
Offline
enthusiast
F
Joined: Jun 2015
Do you really have the caret (^) as the very first character in the XML or did that only creep in when copy & pasting here ?
Would be an invalid XML if it was in the file and the game would probably ignore the file ...

Joined: Sep 2016
stranger
OP Offline
stranger
Joined: Sep 2016
That just sneaked in at the quote


Cheers NuclearToast
Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
Is it a file location issue?

Data\Mods\YOUR MOD\Story\Journal

Joined: Sep 2016
stranger
OP Offline
stranger
Joined: Sep 2016
Also not the problem sadly..
May there be certain scripts that i need? (As far as i know i got all Main Scripts, including the Journal Helper one)

Last edited by NuclearToast; 25/10/16 09:37 PM.

Cheers NuclearToast
Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
No, I don't think you need any scripts to make it work anyway other than the calls you have.

I'll poke at the issue tomorrow when I get a chance.

Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
So I copy/pasted your file, added a couple calls and it worked fine.

Not sure what is causing your issue. If you want you can upload your mod as it currently stands to a cloud storage(dropbox,onedrive,etc) and I can try and mess with it directly.

Joined: Sep 2016
stranger
OP Offline
stranger
Joined: Sep 2016
So i tried it with a completely new module now, added just some basic things to make everything work but the journal still won't...i really don't get what i'm doing wrong, sent you a PM with a dropbox link. And thanks for your help so far.


Cheers NuclearToast

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