Larian Banner
Previous Thread
Next Thread
Print Thread
#640046 03/01/18 02:11 PM
Joined: Dec 2017
Location: Mexico
B
apprentice
OP Offline
apprentice
B
Joined: Dec 2017
Location: Mexico
Morning people, adventurers and fellow Sourcerers!

I edited this topic because I managed to set xp gains on the characters I killed (For reference, go to the STATS editor. You will need to modify the Act Part (level) and Gain (%of Xp for that level) to make a character reward you. However, since it is still an XP issue, I am trying to make a trigger fire when I enter it so it gives me XP. Right now, I'm using the _GLO_ExplorationBonus template:

IF
DB_ExplorationZones((TRIGGERGUID)_Trigger,(INTEGER)_Act,(INTEGER)_ActPArt,(INTEGER)_Gain)
AND
NOT DB_Subregion(_Trigger,_,_) //Subregions can give XP without being Oneshot
THEN
ProcTriggerRegisterForPlayers(_Trigger);

IF
CharacterEnteredTrigger((CHARACTERGUID)_Player,(TRIGGERGUID)_Trigger)
AND
DB_ExplorationZones(_Trigger,(INTEGER)_Act,(INTEGER)_ActPart,(INTEGER)_Gain)
THEN
ProcAddXPToParty(_Player,_Trigger);
ProcCheckRemoveExplorationZone(_Trigger);


PROC
ProcAddXPToParty((CHARACTERGUID)_Player,(TRIGGERGUID)_Trigger)
AND
DB_ExplorationZones(_Trigger,_Act,_ActPart,_Gain)
AND
DB_IsPlayer(_OtherPlayer)
AND
NOT DB_ExplorationXPGiven(_OtherPlayer,_Trigger)
AND
CharacterIsInPartyWith(_OtherPlayer,_Player,1)
THEN
DB_ExplorationXPGiven(_OtherPlayer,_Trigger);
CharacterAddExplorationExperience(_OtherPlayer,_Act,_ActPart,_Gain);

Right now, nothing is happening. I tried a shorter version:

IF
CharacterEnteredTrigger((CHARACTERGUID)_Player,TRIGGERGUID_LeaveFlodsvidXP_5baf32e7-5877-4707-92ca-1e738934bc27)
THEN
PartyAddExperience((CHARACTERGUID)_Player,1,1,50);

And this one does give me the requested XP (Half of the level 1) but it's firing multiple times (EventTrigger, I don't know how to set OneShotTriggers or DB_ExplorationZones), so I can lvl to 30 in the first door. Any ideas, suggestions?

Last edited by BaltasarNecros; 04/01/18 03:59 AM. Reason: Changed Topic, first issue got resolved.
Joined: Dec 2017
Location: Mexico
B
apprentice
OP Offline
apprentice
B
Joined: Dec 2017
Location: Mexico
Never mind. I saw that there is a column called "Gain" which is supossed to award xp. I'll try that :p

EDIT: Changed topic and this information was added to the main body of the post.

Last edited by BaltasarNecros; 04/01/18 04:00 AM.
Joined: Nov 2017
L
member
Offline
member
L
Joined: Nov 2017
You can just use a regular box or polygon trigger. The DB_ExplorationZones logic will register the trigger for all players (that's what the first rule in the code you copied does).
In general, event triggers are only useful if you either need an event for every single character that ever enters it, or if you need an event thrown to behaviour script.
In other cases, it's usually better to use a box or polygon trigger and register it for the characters relevant to avoid having too many unnecessary events.

It is, none the less, odd that you're getting that XP multiple times.
Code
PROC
ProcAddXPToParty((CHARACTERGUID)_Player,(TRIGGERGUID)_Trigger)
AND
DB_ExplorationZones(_Trigger,_Act,_ActPart,_Gain)
AND
DB_IsPlayer(_OtherPlayer)
AND
NOT DB_ExplorationXPGiven(_OtherPlayer,_Trigger)
AND
CharacterIsInPartyWith(_OtherPlayer,_Player,1)
THEN
DB_ExplorationXPGiven(_OtherPlayer,_Trigger);
CharacterAddExplorationExperience(_OtherPlayer,_Act,_ActPart,_Gain);

should block that.

Is the character with which you're testing correctly added to DB_IsPlayer?

Joined: Dec 2017
Location: Mexico
B
apprentice
OP Offline
apprentice
B
Joined: Dec 2017
Location: Mexico
Thank you!
I will try this right now and update should anyone need it.

Yes, all characters are added to DB_IsPlayer smile

Joined: Nov 2017
L
member
Offline
member
L
Joined: Nov 2017
Never mind, I was mistaken about what that part of code does, so that looks like it should work if you switch to normal triggers.

Joined: Dec 2017
Location: Mexico
B
apprentice
OP Offline
apprentice
B
Joined: Dec 2017
Location: Mexico
Ok, just to update: The code you provided is working 100% fine, trigger was changed from Event to Box and renamed to XPExplore_NameOfPlace. My INIT section looks like this:

INIT
DB_IsPlayer(CHARACTERGUID_S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406);
DB_IsPlayer(CHARACTERGUID_S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406);
DB_IsPlayer(CHARACTERGUID_S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406);
DB_IsPlayer(CHARACTERGUID_S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406);
DB_IsPlayer(CHARACTERGUID_S_Player_GenericOrigin_7b6c1f26-fe4e-40bd-a5d0-e6ff58cef4fe);
DB_IsPlayer(CHARACTERGUID_S_Player_GenericOrigin2_c451954c-73bf-46ce-a1d1-caa9bbdc3cfd);
DB_IsPlayer(CHARACTERGUID_S_Player_GenericOrigin3_41a06985-7851-4c29-8a78-398ccb313f39);
DB_IsPlayer(CHARACTERGUID_S_Player_GenericOrigin4_41a594ed-b768-4289-9f17-59f701cc6910);

DB_ExplorationZones(TRIGGERGUID_XPExplore_BreweryBackyard_329e6c7e-fec8-427d-8cc2-7b8a2d2b816f,1,1,5);
DB_ExplorationZones(TRIGGERGUID_XPExplore_LeaveFlodsvid_6c53695c-3841-4d9c-82dd-eda5ea947c7c,1,1,50);

---Then, the KB---

KB
PROC
ProcAddXPToParty((CHARACTERGUID)_Player,(TRIGGERGUID)_Trigger)
AND
DB_ExplorationZones(_Trigger,_Act,_ActPart,_Gain)
AND
DB_IsPlayer(_OtherPlayer)
AND
NOT DB_ExplorationXPGiven(_OtherPlayer,_Trigger)
AND
CharacterIsInPartyWith(_OtherPlayer,_Player,1)
THEN
DB_ExplorationXPGiven(_OtherPlayer,_Trigger);
CharacterAddExplorationExperience(_OtherPlayer,_Act,_ActPart,_Gain);


NOTE and EDIT:

For some reason, if I registered my companions as IsPlayer, I couldn't recruit them. They displayed generic barks saying "Not the appropriate time" or something. So I deleted those lines and all is working as intended.

DB_IsPlayer(CHARACTERGUID_Companion_Egil_Geomancer_000_7a55c525-9870-4be9-aa0c-3f4ef2c3affa);
DB_IsPlayer(CHARACTERGUID_Companion_Ivar_000_bc0be57a-4739-48d9-bbbb-3e2f7760eb5f);
DB_IsPlayer(CHARACTERGUID_Companion_Gunn_000_01879328-5d14-458d-9551-cc9a408b62e4);

Last edited by BaltasarNecros; 04/01/18 05:47 PM.
Joined: Nov 2017
L
member
Offline
member
L
Joined: Nov 2017
DB_IsPlayer is the database of all the current player characters, not all the potential player characters.
In other words, characters should only be in DB_IsPlayer as long as they are recruited by someone.

So, your companions Ivar and Gunn aren't recruited because adding them to the database manually makes Osiris behave as though they'd already been recruited by someone.


Moderated by  Larian_Koala 

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