Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Jun 2013
old hand
OP Offline
old hand
Joined: Jun 2013
Larian uses Exploration Zones and Exploration Events to grant additional experience to the party.



Exploration Zones
Larian uses these a lot to encourage exploration and provide the player immediate feedback upon finding interesting locations. They also use the experience granted as a way to balance player progression.

Step 1.
Create a new goal file under __Start called _GLOBAL_ExplorationBonus. If you are using the Standalone Project Template skip to step 3.

Step 2.
Paste the following script into the file.
INIT section:
Code
DB_ExplorationZones(TRIGGER_XP_MY_TRIGGER,1,1,10);  //this will grant 300 experience.
DB_ExplorationEvents("MY_EVENT",1,1,10);  //300 experience.


[Linked Image]

KB Section:
Code
IF
DB_ExplorationZones((TRIGGER)_Trigger,(INTEGER)_Act,(INTEGER)_ActPArt,(INTEGER)_Gain)
THEN
OneShotPlayerTrigger(_Trigger);

PROC
ProcOneShotTriggerEntered((CHARACTER)_Player,(TRIGGER)_Trigger)
AND
DB_ExplorationZones((TRIGGER)_Trigger,(INTEGER)_Act,(INTEGER)_ActPart,(INTEGER)_Gain)
THEN
NOT DB_ExplorationZones(_Trigger,_Act,_ActPart,_Gain);
PartyAddExplorationExperience(_Act,_ActPart,_Gain);



PROC
Proc_AddExplorationEvent((STRING)_String)
AND
DB_ExplorationEvents((STRING)_String,(INTEGER)_Act,(INTEGER)_ActPart,(INTEGER)_Gain)
THEN
PartyAddExplorationExperience(_Act,_ActPart,_Gain);

PROC
Proc_AddExplorationEvent("GLO_Starstone")
AND
CharacterGetLevel(CHARACTER_Player1, _Lvl)
AND
CharacterGetLevel(CHARACTER_Player2, _Lvl2)
AND
IntegerSum(_Lvl, _Lvl, _LvlSum)
AND
Real(_LvlSum, _LvlSumReal)
AND
RealDivide(_LvlSumReal, 2.0, _LvlMedReal)
AND
Integer(_LvlMedReal, _LvlMed)
THEN
PartyAddExplorationExperience(1,_LvlMed,1);

PROC
Proc_AddExplorationEvent("GLO_Waypoint")
AND
CharacterGetLevel(CHARACTER_Player1, _Lvl)
AND
CharacterGetLevel(CHARACTER_Player2, _Lvl2)
AND
IntegerSum(_Lvl, _Lvl, _LvlSum)
AND
Real(_LvlSum, _LvlSumReal)
AND
RealDivide(_LvlSumReal, 2.0, _LvlMedReal)
AND
Integer(_LvlMedReal, _LvlMed)
THEN
PartyAddExplorationExperience(1,_LvlMed,1);


Download this file and place it in the folder:
Divinity - Original Sin\Data\Mods\YOUR MOD HERE\Story\RawFiles

Do not place it under __Start.


Step 3:
Place a trigger, name it, and make it global. Then generate definitions in the story editor.

Step 4:
Define your Exploration Zone in the INIT section.

[Linked Image]

In the above example when the player enters the trigger XP_Camp the party will gain 900 exploration XP. This is based on what you select to be the "act part" and "gain" numbers. Place your trigger from step 3 in the script.

Step 5:
Build the story (F7) and now your exploration triggers should be working!

Notes and tips for Exploration Zones:

1. Exploration Zones can be a good way to tweak balance by granting more or less experience as required. They also provides immediate feedback and encourage explroation.

2. Defininng Exploration Zones automatically registers the trigger AND unregisters it once you enter it. So don't repurpose other triggers for exploration experience or you will introduce bugs. Make a new trigger for each exploration zone.

3. Larian names their exploration triggers with a prefix XP_.
Example "TRIGGER_XP_Town"



Exploration Events:
Exploration Events are a very specific type of event only generated from Item Scripts or by a proceedure. If you want to grant experience for a player manipulating an item for example this is a good way to do it.

Step 1.
Using the script previously added in the Zones tutorial, define an exploration event in the INIT section. Example:
Code
DB_ExplorationEvents("MY_EVENT",1,1,10);  //300 experience.


Step 2.
Add a conditional statement to your mod based on what event you want the experience to be granted from.
Code
IF
CharacterMovedItem(_Player,ITEM_MY_ITEM)
AND
_Player.isPlayer()
THEN
Proc_AddExplorationEvent("MY_EVENT");


Step 3:
Build (F7) your story script and now when a player moves the item you defined experience will be granted.

Step 4:
If the experience should be granted one time only, you also need to remove the database entry for the event by adding the line to your statement:
Code
NOT DB_ExplorationEvents("MovedCarpet",1,1,10);



Notes and Tips for Exploration Events:

1. Larian doesn't seem to use Exploration Events often. Mainly they use them for waypoints and other systemic items like star stones.

2. The "event" needed for waypoint discovery experience comes from the item script "WaypointShrine". So make sure that ItemScript is attached to your waypoints.

3. Under most circumstances, for a single event it is simpler to just use the call "PartyAddExperience". Exploration Events are far more useful for repeatable actions.

4. Be mindful of potentially creating infinite experience bugs. Unlike Exploration Zones, Events will repeat as many times as possible.

Last edited by SniperHF; 06/08/15 10:10 PM.
Joined: Aug 2014
old hand
Offline
old hand
Joined: Aug 2014
Noice, as always. Mad spoilers for your mod though :O First thing I'll do is check all the planters.

Joined: Jun 2013
old hand
OP Offline
old hand
Joined: Jun 2013
Originally Posted by Baardvark
Noice, as always. Mad spoilers for your mod though :O First thing I'll do is check all the planters.


That was one of the first areas I did in the editor. Was doing some cleanup on it yesterday and saw the file dates were just about exactly a year old.

Basically it's the intro area to the game. I was initially planning on having a pretty obvious hint as to where the key is. Haven't decided yet. There are a few ways to get into the cave without using the key. You can just destroy the hatch, or walk around and find the cave exit.


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