|
apprentice
|
OP
apprentice
Joined: Jun 2014
|
I tried with a new ability spawning a new summon, but nothing drops. This is going to a bit long but bear with it for a while. Be warned that i don't have the editor (i'm using linux and it doesn't work in wine, and i'm using the linux version of DOS EE besides). I added this new entity (with a new map key) to one of the mod i'm altering (xc_encounters with the samaritan patch) roottemplates files: <node id="GameObjects">
<attribute id="Alignment" value="Good NPC" type="22" />
<attribute id="BloodSurfaceType" value="1" type="1" />
<attribute id="DisplayName" value="Undead Source Hunter" type="28" handle="" />
<attribute id="Equipment" value="Summon_Source_GreaterUndead" type="22" />
<attribute id="ExplodedResourceID" value="cd1918b9-f5fe-41f8-be10-7a5285d0e001" type="22" />
<attribute id="ExplosionFX" value="FX_GP_CorpseExplosion_Skeleton_A" type="22" />
<attribute id="Flag" value="0" type="4" />
<attribute id="GroupID" value="0" type="5" />
<attribute id="HitFX" value="FX_GP_Hit_Bone_A_Medium" type="22" />
<attribute id="Icon" value="Portrait_Undead_Skeleton_Grunt_A" type="22" />
<attribute id="LevelName" value="" type="22" />
<attribute id="MapKey" value="12c5957b-4e9c-4482-a1c4-bf20aae39d43" type="22" />
<attribute id="Name" value="Summon_UndeadSourceHunter" type="23" />
<attribute id="PhysicsTemplate" value="78b438db-e742-4301-aa71-79508187c581" type="22" />
<attribute id="Random" value="9223372036854788929" type="24" />
<attribute id="RunSpeed" value="3.3" type="6" />
<attribute id="Scale" value="1" type="6" />
<attribute id="SkillSet" value="Summon_GreaterUndead" type="22" />
<attribute id="SoundSwitch" value="Skel_Grunt" type="22" />
<attribute id="Speaker" value="CYS_Undead_AggroSkeleton_Undead_M" type="22" />
<attribute id="Stats" value="Summon_Source_GreaterUndead" type="22" />
<attribute id="Type" value="character" type="22" />
<attribute id="VisualTemplate" value="680fc263-8144-4eb7-82c5-1ef11a8a689e" type="22" />
<attribute id="WalkSpeed" value="1.5" type="6" />
<children>
<node id="AIBounds">
<attribute id="AIType" value="2" type="1" />
<attribute id="Height" value="2" type="6" />
<attribute id="Radius" value="0.5" type="6" />
</node>
<node id="Arms">
<attribute id="Object" value="1c6ce0db-5ce1-4280-91af-8a58901e5858" type="22" />
</node>
<node id="Arms">
<attribute id="Object" value="dca9b86e-499d-4622-bcbf-92fb412a5677" type="22" />
</node>
<node id="Arms">
<attribute id="Object" value="24a201fe-8eab-40bf-9493-fcb153af9c62" type="22" />
</node>
<node id="Arms">
<attribute id="Object" value="906a8859-008c-4f6e-8e94-b57aaa1f9b30" type="22" />
</node>
<node id="Arms">
<attribute id="Object" value="e06c069b-9e30-4601-ac82-1561d0be0662" type="22" />
</node>
<node id="Arms">
<attribute id="Object" value="a49a3a1b-acb0-414a-858f-bf0fe9287112" type="22" />
</node>
<node id="Bodies">
<attribute id="Object" value="a8674e5e-a3a2-4e0f-a99b-614754462a16" type="22" />
</node>
<node id="Bodies">
<attribute id="Object" value="53d25c2b-b1d0-43a3-a25b-e353891dd48d" type="22" />
</node>
<node id="Bodies">
<attribute id="Object" value="58442bde-4efd-4eb2-b7ab-ae91158ff478" type="22" />
</node>
<node id="Bodies">
<attribute id="Object" value="716f959a-3834-4e58-b135-26239d8356aa" type="22" />
</node>
<node id="Bodies">
<attribute id="Object" value="09ff47b2-bae4-4b8e-afef-dfe89dcd2ca5" type="22" />
</node>
<node id="Heads">
<attribute id="Object" value="c3af157f-f902-41bb-a4ec-e2013f9727c8" type="22" />
</node>
<node id="Heads">
<attribute id="Object" value="a379d764-c03a-49ba-aff5-631adf93fda0" type="22" />
</node>
<node id="Legs">
<attribute id="Object" value="c5f0fb4c-12ed-4c9d-9bd7-bcf9dfa3168e" type="22" />
</node>
<node id="Legs">
<attribute id="Object" value="194eb12e-2d68-4475-85aa-49183998109e" type="22" />
</node>
<node id="Legs">
<attribute id="Object" value="40d705df-b460-42f3-b3de-e0c5da762cd1" type="22" />
</node>
<node id="Legs">
<attribute id="Object" value="a5f50696-9072-4d39-8627-1926973730fb" type="22" />
</node>
<node id="Legs">
<attribute id="Object" value="2fe2d152-5b9d-4963-a6eb-3033700b44d0" type="22" />
</node>
<node id="OnDeathActions">
<children>
<node id="Action">
<attribute id="ActionType" value="5" type="4" />
<children>
<node id="Attributes">
<attribute id="templateAfterDestruction" value="" type="22" />
<attribute id="visualDestruction" value="d77a175e-1c38-4fcc-8744-b40fc08341dd" type="22" />
</node>
</children>
</node>
</children>
</node>
<node id="Scripts">
<children>
<node id="Script">
<attribute id="UUID" value="5bc80992-a7f6-4da6-83e2-3d276384d8f7" type="22" />
<children>
<node id="Parameters">
<children>
<node id="Parameter">
<attribute id="MapKey" value="HardcoreOnly" type="22" />
<attribute id="Type" value="1" type="4" />
<attribute id="Value" value="0" type="23" />
</node>
<node id="Parameter">
<attribute id="MapKey" value="SayBlindedText" type="22" />
<attribute id="Type" value="1" type="4" />
<attribute id="Value" value="1" type="23" />
</node>
</children>
</node>
</children>
</node>
<node id="Script">
<attribute id="UUID" value="5f6440b3-51dd-42ab-9432-f9a94e4af403" type="22" />
<children>
<node id="Parameters">
<children>
<node id="Parameter">
<attribute id="MapKey" value="HardcoreOnly" type="22" />
<attribute id="Type" value="1" type="4" />
<attribute id="Value" value="0" type="23" />
</node>
</children>
</node>
</children>
</node>
</children>
</node>
<node id="Treasures">
<attribute id="TreasureItem" value="Magic_Loot" type="22" />
</node>
</children>
</node> Notice the new TreasureItem loot table: And i added this new ability to SkillData.txt - a aside, i'm also asking what is the purpose of the second entry there. I'm just copying the pattern from the XC_Encounters skeleton summon where it has that second entry with _13 suffix, but i don't know what it's for, is it some kind of level scaling?:
new entry "Summon_UndeadSourceHunter"
type "SkillData"
data "SkillType" "Summon"
data "Ability" "Summon"
data "Element" "None"
data "ActionPoints" "6"
data "Cooldown" "8"
data "CooldownReduction" "30"
data "ChargeDuration" "0"
data "Lifetime" "-1"
data "SummonLevel" "-1"
data "Magic Cost" "1"
data "Template" "12c5957b-4e9c-4482-a1c4-bf20aae39d43"
data "TargetRadius" "12"
data "Icon" "Skill_Source_CreateUndeadGreater"
data "DisplayName" "Summon_UndeadSourceHunter_DisplayName"
data "DisplayNameRef" "Summon Undead Source Hunter"
data "Description" "Summon_UndeadSourceHunter_Description"
data "DescriptionRef" "Summon an skeletal source hunter that serves beyond death."
data "StatsDescription" "Summon_UndeadSourceHunter_StatsDescription"
data "StatsDescriptionRef" "<p align="left"><font color="ff9500" size=19 face="Copperplate Gothic Light"> RECOMMENDED</font><br><font color=cc7700" face="Copperplate Gothic Light"> • Scales with level<br></font><br><br><font face="Copperplate Gothic Bold">Range: [2]</font><br><br>A ghoulish invention of a borderline heretic of the order, this spell allows the summoning of source hunters that agree to fight after death. The hunter may drop broken magic loot they wore in their ill fated last journey.<br><br>You can only have one summon at a time.</p>"
data "StatsDescriptionParams" "SummonLevel;TargetRadius;Lifetime"
data "FXScale" "100"
data "PrepareAnimationInit" "skill_summon_earth_start"
data "PrepareAnimationLoop" "skill_summon_earth_loop"
data "PrepareEffect" "FX_Skills_WitchCraft_Summon_Prepare_A;FX_Skills_WitchCraft_Generic_A_Prepare_Hands:Bip001 R Forearm:Bip001 L Forearm"
data "CastAnimation" "skill_summon_earth_cast"
data "CastTextEvent" "cast"
data "CastEffect" "FX_Skills_WitchCraft_Summon_Cast_A"
data "CastEffectTextEvent" "cast"
data "TargetCastEffect" "FX_Skills_WitchCraft_Summon_Summon_A"
data "TargetEffect" "FX_GP_Target_WitchCraft_A"
new entry "Summon_UndeadSourceHunter_13"
type "SkillData"
using "Summon_UndeadSourceHunter"
data "Level" "13"
I added a loot to TreasureTable.txt at the end of the file:
new treasuretable "Magic_Loot"
IgnoreLevelDiff 1
new subtable "-1"
object category "I_LOOT_Paw_A_Rabbit_A_Lucky",100,100,0,0,0,0,0,0
object category "I_LOOT_Claw_A_Sharp",100,100,0,0,0,0,0,0
object category "I_LOOT_Antler_A_Adult",100,100,0,0,0,0,0,0
object category "I_LOOT_Tusk_A_Large",100,100,0,0,0,0,0,0
object category "I_LOOT_Tail_A_Rat_A_Long",100,100,0,0,0,0,0,0
object category "I_LOOT_Foot_Chicken_A_Big",100,100,0,0,0,0,0,0
object category "I_LOOT_Eye_A_Creepy",100,100,0,0,0,0,0,0
object category "I_LOOT_Tooth_A_Sharp",100,100,0,0,0,0,0,0
object category "I_LOOT_Skull_Human_A_Ancient",100,100,0,0,0,0,0,0
object category "I_LOOT_Scraps_Metal_A",100,100,0,0,0,0,0,0
object category "I_LOOT_Scraps_Plate_A",100,100,0,0,0,0,0,0
object category "I_LOOT_Scraps_Scale_A",100,100,0,0,0,0,0,0
And i added new localization for the name of the summon and ability on the localization folder of the mod (which is how i know i'm summoning the right npc). I also used the samaritan mod on new game event to add the ability like it adds a bunch of others so that works. Anyway, what doesn't work is the new loot table. In fact any loot table i add doesn't work. Is this normal? Does the game hardcode summons to erase their loot table before creating them? Is there a workaround using the 'ondeath' triggers to spawn items? (Ideally making it so that only deaths created by enemies not pcs or henchmen create the item?=
|
|
|
|
addict
|
addict
Joined: Sep 2015
|
Hey, sorry for the rather late reply, I hope you're still around: I did a quick test in the Editor, added a treasure to Summons_Earth_Spider, summoned it with a scroll and killed it. The engine indeed doesn't seem to generate treasure for skill-summoned characters, nothing was dropped. I can think of two solutions (the first being the viable one, the second only for 'theory'): 1. We spawn a container from a script when the summon dies. For this, an item template for this container must be created and the appropriate 'inventory' (= treasure table name) must be added to this template. A pouch-like item, as used in the script example below, might be a good base for such a treasure container template. We need a container to generate the treasure (and can't spawn the treasure directly), because scripts aren't able to level-scale items and apply modifiers to it. The script code could look like this:
EVENT Spawn_Summon_Treasure
VARS
CHARACTER:_char
CHARACTER:_killer
CHARACTERTEMPLATE:_temp
FLOAT3:_pos
ITEM:_item
ON
OnDie(_char,_,_killer,_)
ACTIONS
IF "c1&c2&c3&c4&!c5&!c6"
IsEqual(__Me, Player1_dac1443f-a866-4ab3-b240-e705c0b20ec5) //Player 1 will be our secret treasure spawner
CharacterGetTemplate(_char,_temp)
IsEqual(_temp,12c5957b-4e9c-4482-a1c4-bf20aae39d43) //the summon's template GUID, taken from the template you posted
GetPosition(_char,_pos)
CharacterIsPlayer(_killer) //only kills by npcs will spawn the treasure, as you requested
IsEqual(_killer,null) //only when the summon dies an unnatural death (by a character) the item will spawn
THEN
Add(_pos,{1;0;1}) //a small offset for the spawn position to avoid clipping with the corpse
IF "c1"
FindValidPosition(_pos,5,_char)
THEN
SpawnItem(LOOT_Pouch_A_244deb74-a42b-44b3-94b1-a7fe3620b98e,_pos,_item) //the template must be replaced with your custom treasure container template
PlayEffectAt(_item,"FX_Env_Sparkles_A")
ENDIF
ENDIF
The code must be added to the EVENTS section of a player script. The 'Player.charScript', the Samaritan 'Player_AI.charScript' or any other player script of XC_Encounters can be used for this. Our spawn mechanic will be handled by Player 1, he's the character to observe the summon's death and to spawn the treasure. 2. Creating a pseudo-skill instead of a proper summon skill and summon the character from a player script instead (this skill is for player characters only, I suppose?), something like:
EVENT Fake_Summon
VARS
FLOAT:_stat
INT:_level
ON
OnSkillCast(__Me,[Skill Name]) //side note: first parameter can only be __Me, although the API suggests otherwise
ACTIONS
IF "c1"
CharacterGetStat(_stat,__Me,Level) //get summoner level
THEN
Cast(_level,_stat) //cast float to integer
SpawnCharacter(_,12c5957b-4e9c-4482-a1c4-bf20aae39d43,__Me,1,1,__Me,_level)
ENDIF
//Param 1: character variable to store the resulting character (here left empty with an underscore)
//Param 2: Character Template of the character to spawn
//Param 3: Position to summon the character at (here it's just the position of the summoner)
//Param 4: 1 = Play spawn animation, 0 = do not play spawn animation
//Param 5: 1 = is summon, 0 = is not summon
//Param 6: Owner of the Summon
//Param 7: Level of the spawned character (here the same level as the summoner)
Script-summoned characters generate treasure, so this should work. Cons of solution 2: - the summon exists until it's killed - the summon isn't displayed next to the summoner's character portrait - the summon destination cannot be taken from the skill itself but must be chosen by the script (here it's just the position of the summoner, i. e. __Me) Tell me if this works for you and if you need further help.
Last edited by Abraxas*; 24/06/21 05:20 PM.
|
|
|
|
enthusiast
|
enthusiast
Joined: Jun 2015
|
I don't have any source files on this computer, so I can't check myself.
Isn't there a field for a treasure table entry in the root templates or is it only in the actual objects ?
If the field were in the root template, one could generate a root template with such an entry and check if that worked.
However, a summon might despawn instead of getting killed, so it might not work.
The game engine has enough 'black boxes' that can neither be queried nor influenced. (The henchmen hiring code or the treasure generation code comes to my mind .... ;-)
|
|
|
|
apprentice
|
OP
apprentice
Joined: Jun 2014
|
I moved on from this idea, but i'm certainly not adverse to people trying it out. I've been modding XC_Encounters and it's a neat base for gameplay changes (and i fixed a crash on reload inside of the game caused by BurningItem.itemScript - the mod says it's fixed, but it isn't really. It seems easy to trigger by collecting more than one lit candle as a low cost 2 AP DIY flame for oil or poison explosions). Even if i can't use the story editor (crashes in wine) and thus can't access some events like OnEquipped and OnUnequip. Forced me to think of other ways to add a permanent effect in combat, which was kind of interesting. Now i have a random unique that adds haste for the whole combat with it just in inventory and another that makes critical hits into backstabs for any character (so if you want a sneaky rogue kill eglander, cause it's in his treasure drop), as long as it's done in combat (unfortunately not from ambush)-the alternative was to use a CONSUME potion on every hit and that would not work for every first hit, which is even worse. I also got the idea (from frustration of trying to make a Ego Draconis style 'equip set' without access to OnEquip) of instead using the craft system to 'pair up' items to boost them, so now finding a new unique wand and shield allows you to upgrade them with item skills (overcharge and melee defensive stance). I could use those skills further by making them 'unique' (wand overcharge already needs to be unique) and use the 'cancastskill' to add a bonus equipped at the start of combat, but decided not to, both because the 2 items already have that, and because that hack is unreliable (and XC_Encounters used it previously and had a lot of trouble disabling the buffs if the user switches equipment mid combat). Similarly and after adding Samaritan buffs that were missing, i realized both the belt and Sarongs/Garments had no uniques, so i decided to turn Trethon's robes into a sarong with sheers (or maybe the magic needle I forget). That sarong can be boosted with magic books to get a item skill and you can change them around. The craft system is more mechanically powerful than most expect. I had fun making new icons by messing around with XnView. If you want a link to this version here it is: https://drive.google.com/file/d/1BhHLb3BdgHKecIV867wo2z7fvBooDb_h/view?usp=sharingCurrent attempts to messing around is seeing if it's possible to make the shield animation not 'slide' the round shields unnaturally at the end of the holster movement and how does the engine decide to activate rot (naturally the engine will activate rot curse if you spawn one of the blackstone item shield templates, eg: by 'AddToInventory' call, but for one of mod new items i have no clue - the RootTemplates don't appear to have anything special marking that.
Last edited by i30817; 09/12/21 06:24 AM.
|
|
|
|
apprentice
|
OP
apprentice
Joined: Jun 2014
|
Any way to prevent Wolgraf's beard from clipping through closed helmets in this game (i mean it in modding, the game engine itself).
The helmet itself is organized with 4 possible files (shadow map, diffuse map - the actual texture - , normal map and shadow map) and a bunch of possible properties. I was wondering if there was something like 'disable hair' that happens when you put a helmet that you could do for his beard instead.
I guess i'll upload what i have. I added a new unique helmet, that does nothing special, only this 'restores' the fool's crest which i had overwritten for this. I also made the helmet black, which was verrry annoying since i'm not a graphics artist. I still don't know why the color of the 'sun shine' on it is gold still. It has the clipping problem with Wolgraf's beard - but not Jahan though.
I also wonder if adding a MSK to those files can make the color dyes in game work for this helmet after i butchered the diffuse map to get a nearly black helmet instead. I'd be mad if it was much easier and higher quality if i just added a mask cutting off the 'wings' and added a item property color.
edit: that works. I'll prob use that, but it doesn't solve the 'gold shine' in the male version of the helmet. I think it's baked into the shadow map, and there is no chance i can regenerate it.
Last edited by i30817; 10/12/21 07:53 PM.
|
|
|
Moderated by Bvs, ForkTong, gbnf, Issh, Kurnster, Larian_QA, LarSeb, Lar_q, Lynn, Monodon, Raze, Stephen_Larian
|
|