First off, try this:
Download the zip here: https://1drv.ms/u/s!AqX6ORoY5-DlgmTCOHfXUAoCT37K
Extract the folder to Divinity Original Sin Enhanced Edition\Data\Mods\YOUR MOD HERE\.
Try starting up the editor and see what the stats situation is.
Also, what is the exact name of your player character in the editor? is it Player1 ? something else?
For the questions:
1. No there is not. For CharScripts this functionality exists. Usually in Osiris I just use a lot of queries and databases in IF statements to get similar results.
2. I'm not really a script guru so much as a motivated mucker so maybe someone more familiar with the term will understand what you're asking better. But If you mean what I think you mean, you can use databases.
So say you want to count how many times a character enters a trigger:
INIT SECTION:
DB_TriggerEntrances(0);
TriggerRegisterForPlayers(TRIGGER_HighwayPatrolExit1);
KB SECTION:
IF
CharacterEnteredTrigger(CHARACTER_Player1,TRIGGER_HighwayPatrolExit1)
AND
DB_TriggerEntrances(_INT)
AND
IntegerSum(_INT,1,_NewINT)
THEN
NOT DB_TriggerEntrances(_INT);
DB_TriggerEntrances(_NewINT);
IF
DB_TriggerEntrances(5)
THEN
PlayEffectAtCharacter("FX_GP_TeleportSmoke_A",CHARACTER_Player1);
TriggerUnregisterForPlayers(TRIGGER_HighwayPatrolExit1);
So here your character enters the trigger 5 times, each time that happens it takes the existing Integer (we started at 0) and adds 1. In the THEN section it removes the old number and adds the new one.
When it hits DB_TriggerEntrances(5) (you can run a statement based on a DB) the second statement goes and plays the teleport poof effect on player 1.
You could further complicate this with multiple characters (like how D:OS has two PCS) and add them to the DB as well.
I see your question #4 now that you edited though so basically you get the idea, and no there's no easier way to do it that I know of.
#3 -
3) how does the Random function work? Is there a way to pass to it a range inside which it should generate values? What does the Modulo argument do exactly?
If I understand you correctly, that's exactly what modulo does.
In my mod Dunamis I had a little control panel puzzle the player can press buttons on, but if the player didn't know how to use the panel you have the option of randomly pressing buttons. So I did that with 4 permutations like this:
IF
GlobalEventSet("RandomCheck")
AND
Random(3,_RandomFlag)
THEN
NOT DB_RandomCheck(0);
NOT DB_RandomCheck(1);
NOT DB_RandomCheck(2);
NOT DB_RandomCheck(3);
GlobalClearEvent("AssemblyStop");
GlobalClearEvent("MachineOverload");
GlobalClearEvent("ConsoleNothing");
GlobalClearEvent("IdentityChange");
TimerLaunch("RandomMachineTimer",1500);
DB_RandomCheck(_RandomFlag);So if the player activated the device with random combinations of buttons it would take the one from above once the timer was done and start the event called for:
//0
IF
TimerFinished("RandomMachineTimer")
AND
DB_RandomCheck(0)
THEN
GlobalSetEvent("ConsoleNothing");
//1
IF
TimerFinished("RandomMachineTimer")
AND
DB_RandomCheck(1)
THEN
GlobalSetEvent("MachineOverload");
//2
IF
TimerFinished("RandomMachineTimer")
AND
DB_RandomCheck(2)
THEN
GlobalSetEvent("IdentityChange");
//3
IF
TimerFinished("AssemblyStop")
AND
DB_RandomCheck(3)
THEN
GlobalSetEvent("ConsoleNothing");
I can think of a cleaner way to do it I'm sure but I wrote that like a year and a half ago.
Oh another random tip while I remember, the default search of this forum is like a week long, extend it out to 3 years if you're looking for stuff. Some of the REALLY old posts will have erroneous info but there's good stuff in there as well. I wrote a few tutorials back in the day too and I think they are still usable.
Also, since you used that old guide, make sure to go into Modding>Module Settings and ensure you have both the MAIN and Shared datapacks.