Torchmodders

Modding => Modding Questions => Topic started by: Andrew on December 11, 2015, 03:16:16 pm


Title: SpawnClass, I really mean NO_MAGIC_ITEMS!
Post by: Andrew on December 11, 2015, 03:16:16 pm
So I'm creating a monk and since the damage calculations do not work for bare-handed combat, I've created "fist wraps" that can be bought from a merchant that I created. Since this is meant to simulate bare-handed combat, I really need to prevent magic ones from spawning. Here is a snippet from my spawn class for my merchant:
Code: [Select]
[SPAWNCLASS]
<STRING>NAME:MERCHANT_MONK_FIST_WRAPS
[OBJECT]
<STRING>UNIT:FIST_WRAP
<INTEGER>WEIGHT:-1
<INTEGER>RARITY_OVERRIDE:1
<INTEGER>MINCOUNT:2
<INTEGER>MAXCOUNT:2
<BOOL>NO_MAGIC_ITEMS:1
<BOOL>NO_UNIQUE_ITEMS:1
<BOOL>IGNORE_RANGE:1
[/OBJECT]
[OBJECT]
<STRING>UNIT:FIST_WRAP_5
<INTEGER>WEIGHT:-1
<INTEGER>RARITY_OVERRIDE:1
<INTEGER>MINCOUNT:2
<INTEGER>MAXCOUNT:2
<BOOL>NO_MAGIC_ITEMS:1
<BOOL>NO_UNIQUE_ITEMS:1
<BOOL>IGNORE_RANGE:1
[/OBJECT]
...

As you can see, I'm attempting to force 2 of each (the _5 is the level, so I have _10, _15, etc. up to level 100) to be able to buy from the merchant. This is the merchant code:
Code: [Select]
[UNIT]
<STRING>BASEFILE:media/units/monsters/base.dat
<STRING>NAME:MONK_MERCHANT
<STRING>RESOURCEDIRECTORY:media/models/npcs/est_m
<TRANSLATE>DESCRIPTION:Monk Merchant
<STRING>MESHFILE:npc_esm_town_01
<STRING>ALIGNMENT:NEUTRAL
<STRING>UNITTYPE:MERCHANT
<FLOAT>COLLISION_RADIUS:1.5
<FLOAT>MAXHP:250
<FLOAT>MINHP:250
<INTEGER>MINDAMAGE:100
<FLOAT>WALKINGSPEED:0
<FLOAT>RUNNINGSPEED:0
<FLOAT>PLAYER_LEVEL_FOR_MERCHANT:1
<FLOAT>SCALE:1
<INTEGER>RARITY:0
<TRANSLATE>DISPLAYNAME:Arden the Merchant
<STRING>NPCGREET:ScotGreet
<STRING>NPCBYE:ScotBye
<INTEGER>LEVEL:1
<INTEGER>MAXDAMAGE:125
<FLOAT>TURN_RATE:0
<STRING>GOLD_SOUND:GOLDPICKUP
<INTEGER>MERCHANT_LOOT_LEVEL_OFFSET_MIN:-1
<INTEGER>MERCHANT_LOOT_LEVEL_OFFSET_MAX:3
<INTEGER>MINIMUM_MERCHANT_LEVEL:7
<INTEGER>MERCHANTTAB:1
<STRING>UNIT_GUID:5782696698541290877
<STRING>CHEST_OVERRIDE:ESTHERIAN_02_CHEST
<STRING>BOOTS_OVERRIDE:ESTHERIAN_01_BOOTS
<STRING>PANTS_OVERRIDE:ESTHERIAN_02_PANTS
<BOOL>ALWAYSACTIVE:1
<BOOL>DAMAGEABLE:0
<BOOL>INVINCIBLE:1
<BOOL>RENDERBEHIND:0
<BOOL>ALLOWS_MERCH_MAGICAL:0
<BOOL>LOCALONLY:1
<BOOL>DROP_TO_GROUND:0
[INTERACT_UI]
<STRING>UIMENU:MERCHANTMENU
<STRING>UIMENU:PLAYERINVENTORYMENU
[/INTERACT_UI]
[INVENTORY]
<STRING>CONTAINER:Merchant Armors
<STRING>CONTAINER:Merchant Buy Back Bag
<STRING>CONTAINER:Merchant Weapons
<STRING>CONTAINER:MERCHANTBODY
<STRING>CONTAINER:MERCHANTITEM
<STRING>CONTAINER:Pointer
[/INVENTORY]
[TREASURE]
<STRING>SPAWNCLASS:MERCHANT_MONK_FIST_WRAPS
<INTEGER>MIN:1
<INTEGER>MAX:1
[/TREASURE]
[ANIMATION_ALTS]
[/ANIMATION_ALTS]
[EQUIPMENT]
[/EQUIPMENT]
[MESHFILES]
<STRING>MESHFILE:npc_esm_town_01
[/MESHFILES]
[/UNIT]

As you can see, I set the ALLOWS_MERCH_MAGICAL to 0 to also try to prevent magical items. Here is an example of one of the fists:
Code: [Select]
[UNIT]
<STRING>CREATEAS:EQUIPMENT
<STRING>UNITTYPE:MONK FIST
<INTEGER>MAXDAMAGE:100
<STRING>FALL_SOUND:Item Fall
<STRING>TAKE_SOUND:AxeGet
<STRING>LAND_SOUND:AxeDrop
<STRING>STRIKE_SOUND:SwordFlesh
<STRING>ATTACK_SOUND:SwordSwing
<FLOAT>STRIKERANGE:0.7
<FLOAT>RANGE:0.5
<STRING>GAMBLER_ICON:icon_weapon_claw01
<STRING>ICON:icons_armor_wanderer_belt07
<TRANSLATE>DISPLAYNAME:Fist Wrap
<FLOAT>WEAPONARC:0
<FLOAT>SECONDARY_DMG_PCT:0
<STRING>NAME:fist_wrap_10
<FLOAT>DEVIATION_FROM_30FPS:0.8
<TRANSLATE>DESCRIPTION:Protective wrapping for monks to fight without weapons.\n\nRequired to be dual-wielded for bare-handed monk skills. (Wraps are available for every 5 character levels. There is a merchant in the Estherian Enclave that sells the wraps (near the respec merchant))
<INTEGER>RARITY_DMG_MOD:200
<FLOAT>SOAKSCALEPCT:50
<STRING>BASEFILE:media/units/items/fists/base_fist.dat
<INTEGER>SPEED:70
<INTEGER>SPEED_DMG_MOD:60
<INTEGER>LEVEL_REQUIRED:10
<INTEGER>DEFENSE_REQUIRED:200
<INTEGER>MAGIC_REQUIRED:200
<INTEGER>STRENGTH_REQUIRED:200
<INTEGER>DEXTERITY_REQUIRED:200
<INTEGER>SOCKETS:0
<INTEGER>MAX_SOCKETS:0
<STRING>RESOURCEDIRECTORY:media/models/weapons
<STRING>MESHFILE:invisible_weapon
<INTEGER>LEVEL:10
<INTEGER>MINDAMAGE:70
<INTEGER>MINLEVEL:0
<INTEGER>MAXLEVEL:30
<STRING>UNIT_GUID:3018375431840284113
<INTEGER>DAMAGE_PHYSICAL:100
<INTEGER>RARITY:0
[REQ_CLASS]
<STRING>UNITTYPE:MONK
[/REQ_CLASS]
[STATS]
[/STATS]
[/UNIT]

Despite all these things I've tried, the merchant occasionally has green items (as my char levels up there are spawning more frequently). How can I stop it from adding magical properties to these items in the merchant (is this adding item affixes or something)?

The items inherit from "NORMAL FIST" so there should be no magical properties.

Thanks for any help
Title: Re: SpawnClass, I really mean NO_MAGIC_ITEMS!
Post by: Kva3imoda on December 11, 2015, 04:31:59 pm
As I know this is encoded. I think the easiest way - to make a unique item.
http://forums.runicgames.com/viewtopic.php?f=57&t=59713

like this
http://tidbi.ru/eng/item.php?item=axe_u05x

Code: [Select]
[UNIT]
<STRING>NAME:axe_u05x
<STRING>BASEFILE:media\units\items\axes\axe_u05.dat
<INTEGER>DAMAGE_PHYSICAL:100
<TRANSLATE>DISPLAYNAME:The Axe of Throwing
<INTEGER>LEVEL:40
<INTEGER>RARITY:9
<INTEGER>SPEED_DMG_MOD:100
<INTEGER>SPEED:100
<INTEGER>DEXTERITY_REQUIRED:40
<INTEGER>STRENGTH_REQUIRED:89
<INTEGER>DAMAGE_FIRE:0
<INTEGER>DAMAGE_ICE:0
<INTEGER>DAMAGE_POISON:0
<INTEGER>DAMAGE_ELECTRIC:0
<STRING>UNIT_GUID:-2745156838019801528
<TRANSLATE>DESCRIPTION:Born to fly!
<FLOAT>RANGE:9
<FLOAT>WEAPONARC:0
<FLOAT>SECONDARY_DMG_PCT:0
<STRING>UNITTYPE:MAGIC 1HAXE
<FLOAT>STRIKERANGE:0
<INTEGER>MAGIC_REQUIRED:0
[SKILL]
<STRING>NAME:AXETHROW
<INTEGER>LEVEL:-1
[/SKILL]
[AFFIXES]
<STRING>AFFIX:UNIQUE_DEGRADE_ARMOR3
<STRING>AFFIX:UNIQUE_KNOCKBACK
<STRING>AFFIX:UNIQUE_LUCK2
<STRING>AFFIX:UNIQUE_PROC_AXETHROW100
<STRING>AFFIX:UNIQUE_TL2_SHORTSTUN3
[/AFFIXES]
[/UNIT]

Technically, this is a unique axe, but it looks like rare.
Title: Re: SpawnClass, I really mean NO_MAGIC_ITEMS!
Post by: Kva3imoda on December 11, 2015, 04:51:08 pm
(http://i.imgur.com/sjkIPXe.png)

You need to create a unique base item without effects.
For example:
axe_u05
Code: [Select]
[UNIT]
<STRING>BASEFILE:media\units\items\axes\base_axe_unique.dat
<INTEGER>DAMAGE_PHYSICAL:50
<TRANSLATE>DISPLAYNAME:The Cruel Hand of Fate
<STRING>ICON:icon_weapon_axe_varkolyn01
<INTEGER>LEVEL:60
<STRING>MESHFILE:axe_varkolyn01
<STRING>NAME:axe_u05
<INTEGER>RARITY:100
<STRING>RESOURCEDIRECTORY:media/models/weapons/_Axes
<INTEGER>SPEED:100
<INTEGER>SPEED_DMG_MOD:100
<STRING>UNIT_GUID:-3517773071788290131
<INTEGER>STRENGTH_REQUIRED:116
<INTEGER>DEXTERITY_REQUIRED:0
<INTEGER>DAMAGE_ELECTRIC:25
<INTEGER>DAMAGE_ICE:25
<TRANSLATE>DESCRIPTION:It cuts down everyone, eventually.
<INTEGER>MAGIC_REQUIRED:0
[/UNIT]

Then you create a normal item using this base file.
axe_u05x
Code: [Select]
[UNIT]
<STRING>NAME:axe_u05x
<STRING>BASEFILE:media\units\items\axes\axe_u05.dat
<INTEGER>DAMAGE_PHYSICAL:100
<TRANSLATE>DISPLAYNAME:The Axe of Throwing
<INTEGER>LEVEL:40
<INTEGER>RARITY:9
<INTEGER>SPEED_DMG_MOD:100
<INTEGER>SPEED:100
<INTEGER>DEXTERITY_REQUIRED:40
<INTEGER>STRENGTH_REQUIRED:89
<INTEGER>DAMAGE_FIRE:0
<INTEGER>DAMAGE_ICE:0
<INTEGER>DAMAGE_POISON:0
<INTEGER>DAMAGE_ELECTRIC:0
<STRING>UNIT_GUID:-2745156838019801528
<TRANSLATE>DESCRIPTION:Born to fly!
<FLOAT>RANGE:9
<FLOAT>WEAPONARC:0
<FLOAT>SECONDARY_DMG_PCT:0
<STRING>UNITTYPE:NORMAL 1HAXE
<FLOAT>STRIKERANGE:0
<INTEGER>MAGIC_REQUIRED:0
[SKILL]
<STRING>NAME:AXETHROW
<INTEGER>LEVEL:-1
[/SKILL]
[/UNIT]
Title: Re: SpawnClass, I really mean NO_MAGIC_ITEMS!
Post by: Kva3imoda on December 11, 2015, 05:10:46 pm
Hmm ... Well, I tried to do it.
It seems that sometimes it's not working - I have a green items. Also, I tried to add the BLANK_NO_EFFECTS affix - this is also does not work.  >:(
Title: Re: SpawnClass, I really mean NO_MAGIC_ITEMS!
Post by: Andrew on December 11, 2015, 08:13:46 pm
Hmm ... Well, I tried to do it.
It seems that sometimes it's not working - I have a green items. Also, I tried to add the BLANK_NO_EFFECTS affix - this is also does not work.  >:(

Yeah I tried that too. I also added 6 dummy affixes (rank 1, 6, 11, 16, 21 and 26) and the level 100 item in my test ended up green. Not sure if that was because of the rank or it just didn't work. Not sure what else to try at the moment.
Title: Re: SpawnClass, I really mean NO_MAGIC_ITEMS!
Post by: Phanjam on December 12, 2015, 01:19:15 am
Hey Andrew! Sorry I don't really have an answer for your current problem - I just wanted to welcome you to Torchmodders ;) thanks for coming here for help, we're honored.
Title: Re: SpawnClass, I really mean NO_MAGIC_ITEMS!
Post by: Andrew on December 18, 2015, 08:51:08 am
FYI, I found a way around my barehanded damage issue so I can avoid having to create fake items. Basically I can add a flat damage affix for each char level and use stat modifiers on strength, damage %, etc to boost the damage as the normal damage would be boosted by such thing. As a result I don't need to address the issue found in this thread.
Title: Re: SpawnClass, I really mean NO_MAGIC_ITEMS!
Post by: Phanjam on December 19, 2015, 12:57:58 am
...I can add a flat damage affix for each char level and use stat modifiers on strength, damage %, etc to boost the damage as the normal damage would be boosted by such thing.

That's a neat solution Andrew, thanks! and good news for anyone making a barehanded fighter class ;)

Is that done just within the player unit's .DAT file (or the unit>player editor screen in GUTS)?
Title: Re: SpawnClass, I really mean NO_MAGIC_ITEMS!
Post by: Andrew on December 19, 2015, 01:34:04 pm
...I can add a flat damage affix for each char level and use stat modifiers on strength, damage %, etc to boost the damage as the normal damage would be boosted by such thing.

That's a neat solution Andrew, thanks! and good news for anyone making a barehanded fighter class ;)

Is that done just within the player unit's .DAT file (or the unit>player editor screen in GUTS)?

It was very complex and it may be best to have people just see my source once I publish the mod (I'm still balancing my monk class and testing it with Synergies as that is what it is intended to be used with). The gist is this:

It took me a while and several attempts, but it is working. I had to use MIN/MAX to be one number, not a range as it seems TL2 just picks a number in that range instead of actually using it on each hit, so the barehanded damage is like an AXE, doing one set damage amount. I used python code with unicode support to create the 200 AFFIXES and the two skills that have 100 levels so that I would not go nuts. It also makes it easy to change the amount of damage as I make one code change and then regenerate all 100 or 200 AFFIXES for example.
Title: Re: SpawnClass, I really mean NO_MAGIC_ITEMS!
Post by: Phanjam on December 19, 2015, 05:09:34 pm
 ???
"complex" is not an exaggeration then! I salute you for figuring all that out AND for your sheer determination!
Title: Re: SpawnClass, I really mean NO_MAGIC_ITEMS!
Post by: Karkozi the All-Powerful on May 10, 2016, 12:09:10 pm
I know I'm  late to the party, but it makes sense that NO_MAGIC tag won't work, because for GUTS "magic" means blue items, and NO_MAGIC prevents blue items from spawning as intended.