Originally Posted by Abraxas*
Some more puzzling things:

- the book gets added if I pass character creation without changing or switching the preselected preset class. But it doesn't appear in inventory if I switch the class or change a class. But the modified player script (which adds the book) is definitely added to the players: it also contains the Healing AI which always works.



Yeah, I think I can explain that. So your OnInit() event triggers first time when character creation screen is loaded, at that moment you book is added to inventory. But when you switch presets, the inventory probably is destroyed so at the moment the actual game starts, you already don't have it.

In the editor you have it because OnInit() is triggered when you switch to game mode and inventory is not destroyed.

Could you try use different event to add your item.

Ideally will be to use Osiris to do that. But if you do it in scripts you can try this

Code
CHARACTER:__Me
INT:%BookGiven = 0

EVENTS

EVENT GiveBook

ON
	OnCharacterCreationStopped(__Me)
ACTIONS
	IF "c1"
		IsEqual(%BookGiven, 0)
	THEN
		Set(%BookGiven, 1)
		CharacterAddToInventory(Your_Stuff)
	ENDIF


Happy modding!

Last edited by Cadmus88; 25/05/16 01:57 PM.