Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Jun 2013
addict
OP Offline
addict
Joined: Jun 2013
Hi all, I am quite stuck ATM

These teleports works fine when tried from the editor:
Code
DB_teleport_Triggers_From_To(from_fort_hope_to_forest_1_areatrigger_7fa8bd16-d447-4872-abc5-7cb1c132fd0e,from_forthope_to_forest1_point_trigger_284bc9fb-6244-4ea2-a7a4-8e793ce046d2);
DB_teleport_Triggers_From_To(from_forest1_to_forthope_area_trigger002_72a36ea1-982d-4260-aedc-055a37480fb4,from_forest1_to_forthope_point_trigger_5ae63bbe-0a64-4395-bc05-05a20c3a2369);


IF
DB_teleport_Triggers_From_To(_FromAreaTrigger,_ToPointTrigger)
THEN
TriggerRegisterForPlayers((TRIGGERGUID)_FromAreaTrigger);
TriggerRegisterForPlayers((TRIGGERGUID)_ToPointTrigger);

IF
DB_teleport_Triggers_From_To(_FromAreaTrigger,_ToPointTrigger)
AND
CharacterEnteredTrigger(_Player,(TRIGGERGUID)_FromAreaTrigger)
//AND
//GetPosition((TRIGGERGUID)_ToPointTrigger,(REAL)_x,(REAL)_y,(REAL)_z)
THEN
PROC_Helper_SafeTeleportTo(_Player,(TRIGGERGUID)_ToPointTrigger,"",0);
//CharacterTeleportPartiesToTrigger((TRIGGERGUID)_ToPointTrigger,"");
//TeleportToPosition(_Player,(REAL)_x,(REAL)_y,(REAL)_z,"",0);


but when I upload the mod in local, launch a game, my PC won't teleport.
All commented lines work in the editor, but none in the game.
Any idea, tips, links, please ?

This is on of the last burden preventing me from releasing my mod...


Un chemin de 1000 lieues commence par un premier pas.

Project:
Steam workshop Frontiere
Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
Hmm ... are the triggers in different levels or the same level?

I take it this is something the player actively walks into at some point after the game has been loaded for some time? In other words, you aren't trying to catch the player being loaded into a level by detecting that they spawn within a trigger or something like that are you?

It might be insightful to look at the osirislog.log file when this executes successfully in the editor. Then you can look at all the queries that the game makes once the player enters your trigger and start thinking about what could be different between the two modes. Is the game looking for specific tags or other values associated with the player? We already found one bewildering difference between client and game mode where the characters seem to be missing their faction when created through real character creation in the game and I'm wondering if there may be additional differences like missing tags, etc.




DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
Is the goal with this code a subgoal of one that only activates once your level loads? If this is in a top level goal, then you will try to register the triggers for the players before your level gets loaded. If they are local triggers, they won't even exist yet. If they are global triggers, it might work, but I'm not sure (because this will still be called before the game has fully initialised).

Have a look at https://docs.larian.game/Osiris_Design_Patterns#Program_Initialisation for how to ensure that your goal only initialises once your level has loaded.

Joined: Jun 2013
addict
OP Offline
addict
Joined: Jun 2013
Thanks for your replies and concerns, really. I found a workaround, that is not a workaround, actually. I used the Larian teleport system. Define a on use teleport interactable item, put a teleport trigger, link both, and it works. Took me 5 minutes for it to work, and hours with "my" system, not working. This is the issue of having some modding experience, and trying to reproduce old behaviours.
Cheers.


Un chemin de 1000 lieues commence par un premier pas.

Project:
Steam workshop Frontiere

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