Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Page 4 of 4 1 2 3 4
Joined: Sep 2015
A
addict
Offline
addict
A
Joined: Sep 2015
I already posted this issue in the scripting thread but it's more related to the editor itself:

I get an error message after copying local characters of the main campaign to my own module (dependencies on Main and Shared, datapacks Main and Shared; right click on the character, copy object(s) to my module as Sniper mentioned above) next time the level gets loaded. The editor says (refering to VargoBoss, as an example):

Conflicted local template UUID 'fad3dbb1-869e-4199-84bd-37c1570c73d1' of type 'character' with name 'CYS_VargoBoss' when loading level without sublevels, this shouldn't happen?

All local characters throw this error. Global characters can be transfered to my module without any problems.

Can it be ignored?

EDIT: Copying files from Data\Mods\Main\Levels\Cyseal\Characters\ to ...\MyMod\... implies the same warnings for local characters.


Last edited by Abraxas*; 23/05/16 08:10 PM. Reason: Additions

My mods for DOS 1 EE: FasterAnimations - QuietDay - Samaritan
Joined: Sep 2015
A
addict
Offline
addict
A
Joined: Sep 2015
Some more puzzling things:

I prepared my module, all scripts, stats, roottemplates etc. in place, modul settings set. I start the game and activate my mod (as expansion of Main). I start a new game and enter the character creation. Now when I passed character creation and the game starts there should be three objects in the players' inventories: 1 book from the Player char script (added OnInit) and 2 objects from Equipment.txt file (MaleHero and FemaleHero). There are the following issues:

- the 2 objects from Equipment.txt never get added. But they get added when switching to ingame mode in the Editor (MyModule).
- 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.

I can't find a reason for that.

EDIT: I added all objects to the class entries in Equipment.txt now. That's viable. But the difference between games inside and outside the editor* (refering to FemaleHero and MaleHero from Equipment.txt) and the difference between changing class and not changing class related to CharacterAddToInventory via Player script are strange.

* there were more reports (e. g. from Sniper) about differences between the Editor game mode and the normal game mode

Last edited by Abraxas*; 24/05/16 09:24 PM. Reason: Additions

My mods for DOS 1 EE: FasterAnimations - QuietDay - Samaritan
Joined: Sep 2014
journeyman
Offline
journeyman
Joined: Sep 2014
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.
Joined: Sep 2014
journeyman
Offline
journeyman
Joined: Sep 2014
Originally Posted by Abraxas*

EDIT: I added all objects to the class entries in Equipment.txt now. That's viable. But the difference between games inside and outside the editor* (refering to FemaleHero and MaleHero from Equipment.txt) and the difference between changing class and not changing class related to CharacterAddToInventory via Player script are strange.



>I added all objects to the class entries in Equipment.txt

This is the correct solution. Alike the post above, when character creation starts, stats of player are switched from MalePlayer to class stat so the equipment changes too.

In the editor when you switch to game mod stats do not change so MalePlayer is kept, that's why you had this difference

Joined: Sep 2015
A
addict
Offline
addict
A
Joined: Sep 2015
Thank you for the good information, Cadmus!

I'm planning to offer one version (with a few restrictions) that doesn't require a new game, so I add the book via char script. I will try it with OnCharacterCreationStopped.

Do you also have an explanation for the Local Template conflict when copying local characters to a module?


My mods for DOS 1 EE: FasterAnimations - QuietDay - Samaritan
Joined: Sep 2014
journeyman
Offline
journeyman
Joined: Sep 2014
Originally Posted by Abraxas*
Thank you for the good information, Cadmus!

Do you also have an explanation for the Local Template conflict when copying local characters to a module?


The quote from tool programmer

Quote
It will probably work as expected

[12:55 PM]
the assert doesn't account for modding

Joined: Sep 2015
A
addict
Offline
addict
A
Joined: Sep 2015
Perfect. Thank you smile


My mods for DOS 1 EE: FasterAnimations - QuietDay - Samaritan
Joined: Jun 2013
old hand
OP Offline
old hand
Joined: Jun 2013
New Problem: Talent requirements do not work in mods.


So if I take a Requirements.txt file in the same structure:
Data\Public\A_Necromancer's_Crusade_7c57ebf1-6a07-47fc-99e7-8131a2d5ca05\Stats\Generated\Data

It does absolutely nothing. None of my changes take effect.


But if I place a Requirements.txt file in the Shared folder itself:
\Data\Public\Shared\Stats\Generated\Data


It works fine, the requirements change. But the mod has to inherit it from Shared which means I can't distribute it via Steam.


All of the other stat files work fine.

Joined: Jun 2015
F
enthusiast
Offline
enthusiast
F
Joined: Jun 2015
I am not sure if Osiris or general engine bugs go here as well, but I'll post one here:

I tried deleting a single previously registered item with ItemHandleDelete( _ItemHandle ) but that deletes a complete stack of items instead of only a single instance if the item with that handle is on a stack.

So either a stack 'steals' an item handle from an item when it is added to it or (more likely) an item is first placed on a stack and might even get its own handle but events like ItemTemplateAddedToCharacter() return the handle of the complete stack instead of the handle of the added item.

So one call is definitely buggy and more are very likely buggy:

1. ItemHandleDelete() is buggy because it can delete complete stacks when this should be impossible
2. ItemTemplateAddedToCharacter and ...AddedToContainer are probably buggy, because they return a stack handle instead of an item handle
3. all ItemHandleMoveTo... can be called buggy, because they most likely only move the top of the stack instead of one specific item (what else could they do if they don't get correct data ?)
4. All item functions that have to do with handles are probably buggy because they treat stacks as if those were single entities instead of entity arrays. (but as said above, what else could they do if the information aquisition functions are buggy already ?)

Other bugs I found:
1. missing documentation and support
2. missing documentation and support
3. DOS/2
4. DOS/2
...
9. DOS/2 blocking any bugfixes and support
10. sometimes, the editor does NOT crash ;-)

Joined: Sep 2015
A
addict
Offline
addict
A
Joined: Sep 2015
I don't know if that's already reported: one of my story scripts became 'read only' for no apparent reasons. I created it in a module with datapacks and dependencies Main and Shared, edited and saved (and built story with it) several times without problems. It's not a big problem, I edit the lsx file, but the editor behaves strange here.

Quote
10. sometimes, the editor does NOT crash ;-)

I noticed that there are several situations that highly increase chance for a crash when closing the editor:
- a game object is selected
- a window/bar is open (inspector, resource manager etc.)
- unsaved changes

If I close all windows, save changes and don't have an object selected I can close without crashes. But there are more ways to crash the editor and more reasons to be discovered.

Another issue related to char scripting: I really don't understand the logic of script changes applying or not applying without level reload, story reload or editor reload. Sometimes (but I can't see a rule here) only restarting the editor helps. And this doesn't only happen for OnInit actions (which at least require reloading the level to initialize the script again) but also for simple reaction changes.


My mods for DOS 1 EE: FasterAnimations - QuietDay - Samaritan
Joined: Jun 2013
old hand
OP Offline
old hand
Joined: Jun 2013
So I've noticed that a lot of the animal root templates have no sight at all. I don't think it's a stats issue because I can assign them stats entries that do for sure have sight and no vision cone comes up.

None of the cows and most of the dogs are the ones I can think of right now.


This is kind of annoying since I had a cool script where my farmers went around feeding the animals, but they can't see the food so they won't eat it......

Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
If you don't mind that they go to food that is merely nearby rather than to food that they can see, you may be able to use something like the following, but with ItemGet() instead:

Code
REACTION PlayerDetected,500
USAGE ALL
VARS
	CHARACTER:_Char
CHECK "c1&c2"
	CharacterGet(_Char,__Me,3.0,Lowest,Distance,null,null,null,null,null)
	CharacterIsPlayer(_Char)
ACTIONS
	GlobalSetEvent("LEP_HitPlayer")


After you assign this reaction to an animal, it definitely triggers when a player character moves into range. I only tested it with both the animal and the player moving though, and I don't know whose movement triggers the re-evaluation of the CharacterGet() condition. If it's the player, then this probably won't help.

If the above reaction does not trigger automatically, a more complicated workaround could be to detect when food is dropped, and in that case move the animals to the food if it's nearby. There are some caveats with this though:
1) a "food has been dropped" event can only be detected from Osiris, so you then have to broadcast an event to your charScripts (which then can use ItemGet())
2) don't use ItemHandleDropped() in combination with ItemGet() in a charScript, because when ItemHandleDropped() fires, ItemGet() won't be able to find it yet. Instead, use ItemTemplateMoved(), which triggers after the item has in fact been dropped. This event will obviously trigger in more situations, but given that you just use it trigger ItemGet(), that's not really a problem.

This is the story handler for 2) from my ReSource mod (which has been dormant for quite a while now because I've been busy with other things, but one day...)
Quote

//REGION Detect new items available in/on loading/unloading platforms
// Don't use ItemHandleDropped(): charScript's ItemGet() only finds items
// after the subsequent ItemTemplateMoved() event has fired, and we also
// want to detect items that were only moved and not necessarily picked up
// and dropped.
//
// Note: this will also be triggered when a harvester or player picks up
// such an item, and there is no way to know who did it...
IF
ItemTemplateMoved(_ItemTemplate,_)
AND
DB_RESOURCE_TransportLoadingPlatformTrigger(_,_Platform,_)
AND
ItemGetVarFixedString(_Platform,"LoadItemTemplateGUID1",_GUID)
AND
StringContains(_ItemTemplate,_GUID,1)
THEN
ItemSetEvent(_Platform,"RESOURCE_ResourceCollectionPlaceNewItemAvailable");

Joined: Sep 2015
A
addict
Offline
addict
A
Joined: Sep 2015
Quote
So I've noticed that a lot of the animal root templates have no sight at all. I don't think it's a stats issue because I can assign them stats entries that do for sure have sight and no vision cone comes up.

Animals not having vision cones depends on SpotSneakers (sidebar) which is set false by default for them. Or did I get you wrong?

ItemGet, as Tinkerer suggests, works fine for animals. I've rewritten the animal script a while ago; they react on food as expected:

Code
INIT
CHARACTER:__Me
EXTERN FIXEDSTRING:%FoodTemplate1 = "DONTEAT"
EXTERN FIXEDSTRING:%FoodTemplate2 = "DONTEAT"
EXTERN FIXEDSTRING:%FoodTemplate3 = "DONTEAT"
EXTERN FIXEDSTRING:%FoodTemplate4 = "DONTEAT"
EXTERN FIXEDSTRING:%FoodTemplate5 = "DONTEAT"
EXTERN FIXEDSTRING:%FoodTemplate6 = "DONTEAT"
EXTERN FLOAT:%CombatDist = 7
EXTERN FLOAT:%PeaceDist = 12
FLOAT:%Distance = 12

BEHAVIOUR

REACTION ReactOnFood, 1200
USAGE ALL
VARS	
	INT:_WalkOrRun
	ITEM:_ClosestFood
	FLOAT:_Time
	FLOAT:_Wait
CHECK "!c1&(c2|c3|c4|c5|c6|c7)&!c8"
	IsInDialog(__Me)
	ItemGet(_ClosestFood,__Me,%Distance,Lowest,Distance,%FoodTemplate1) 
	ItemGet(_ClosestFood,__Me,%Distance,Lowest,Distance,%FoodTemplate2)
	ItemGet(_ClosestFood,__Me,%Distance,Lowest,Distance,%FoodTemplate3)
	ItemGet(_ClosestFood,__Me,%Distance,Lowest,Distance,%FoodTemplate4)
	ItemGet(_ClosestFood,__Me,%Distance,Lowest,Distance,%FoodTemplate5)
	ItemGet(_ClosestFood,__Me,%Distance,Lowest,Distance,%FoodTemplate6)	
	IsInDangerousSurface(_ClosestFood)
ACTIONS
	GetRandom(_WalkOrRun,0,1)
	CharacterMoveTo(_ClosestFood,_WalkOrRun)
	CharacterUseItem(_ClosestFood)
	GetRandomBetween(_Wait,0,3)
	Sleep(_Wait)
	GetRandom(_Time,1,3,5,15,60)
	StartTimer("HungryAgain",_Time,0)
	SetPriority("ReactOnFood",0)
INTERRUPT
	Reset()
	GetRandomBetween(_Time,1,60)
	StartTimer("HungryAgain",_Time,0)
	SetPriority("ReactOnFood",0)
	
	
EVENTS

EVENT SetDistanceCombat
ON
	OnCombatStarted()
ACTIONS
	Set(%Distance,%CombatDist)
	
EVENT SetDistancePeace
ON
	OnCombatEnded()
ACTIONS
	Set(%Distance,%PeaceDist)
	
EVENT PeaceHungry
ON
	OnTimer("HungryAgain")
ACTIONS
	SetPriority("ReactOnFood",1200)		
	

Take care that animals move to the object first and then use the item. Otherwise they will get stuck if the item gets removed before they used it.

Last edited by Abraxas*; 12/10/16 09:25 AM. Reason: Corrected vision cones information

My mods for DOS 1 EE: FasterAnimations - QuietDay - Samaritan
Joined: Jul 2017
stranger
Offline
stranger
Joined: Jul 2017
Originally Posted by Tinkerer
Originally Posted by Baardvark
[quote=Cadmus88]
I tried to use that lsb maker thing in the root templates but didn't have too much luck.


Yes, there are a few gotchas. Here's how it works for me (text based on Cadmus88's explanation, but with some additions in bold):

1. Find the root in the Create and View templates tool
2. Right click on it and select Create new from selected
3. https://monosnap.com/file/UYzYOe5AXB1Xye3S4jnlvm0astRGVj

--Select your mod in drop down (1)
--Insert the name for file your want to store it in (Name.lsb) (2)
--Click Add (3)
-- Click "continue" in the exception dialog box that appears
--Select that lsb in the drop down (4)
-- Click on the"FileName" field in the "Base" section (different from the "FileName" field at the bottom of the dialog), click on the button with the three dots at the end, navigate to Public\YourMod\RootTemplates (create that folder if it doesn't exist), and enter a name for the lsb file you want to use (Name.lsb). Only do that now, because selecting the lsb from the drop down resets this field back to its value from the original template
--Enter the name for your root (5)
(next time you just select lsb, don't need to create it)
-- If the lsb does not appear in the pop-up menu the next time for some reason, add it again. You also always have to change the FileName under Base for every new RootTemplate you add
-- If you forgot to change the FileName under Base before entering a name in step (5), you have to change the name from step (5) again (if only by deleting and adding the same character) after correcting the FileName under Base before you can continue.


So i can`t add new root. I done all, but after reload Editor, it can not find new object in root viewer ( but LSB 2kb in RootTemplate was created)

Joined: Jun 2015
F
enthusiast
Offline
enthusiast
F
Joined: Jun 2015
Aaaaah, a dead thread brought back to life by a skilled necromancer ... ;-)

As I mentioned in your own thread, rename the folder you use for root templates from 'RootTemplate' to 'RootTemplates' and see if that works.

Page 4 of 4 1 2 3 4

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