I think the short answer is, there's no way to add experience in charscripts directly.


Did you test how you have it set up in the OP? Does it work? If so I'd just leave it alone. Unless you're worried about having to do this sort of thing a lot. But given that you're trying to do something unusual like randomized experience, that's probably going to come with the territory.



I think I'm misunderstanding the term function (I'm not a scripter, I'm a mucker) As far as I understand the CallFunction command in charscripts, it will only refer to something within a charscript.




I would probably remove everything from that charscript possible and try and do it in Osiris. The only thing you'd probably need to leave in the charscript is the tracks stuff and a flag for failure and success. You can do the randomizing in Osiris.


I could see maybe writing a generalist Osiris script if you feel you must continue with charscripts. Most likely you'd have to separate the success/fail flag from the experience one to do it though so you could reuse the experience event for any quest. Similar to what Amer did.

But you'd also have to account for level and a way to increase the general script based on that. So you could throw in a CharacterGetLevel() query in the general statement and pull that to follow along the player's progress. The best way to do that would be with the PartyAddExperience experience call, not the "ACTUAL" experience ones.




EDIT: Oh and for the 0 being used in the random query in Osiris. You could just add 1 to it via IntegerSum
IF
ObjectFlagSet("ExperienceReward",_Source,_)
AND
Random(4,_Random) // Random in Osiris uses 0, must add 1
AND
IntegerSum(_Random,1,_RandomEXP) //0-3 is now 1-4


Then pass all that stuff to the PartyAddExperience call like:
PartyAddExperience(_Source,1,1,_RandomEXP);


Last edited by SniperHF; 24/09/17 10:06 PM.