News: Go to the front page portal to create a Torchmodders account | Visit the wiki!
November 18, 2018, 12:12:06 PM
collapse

*
Information

Please contribute to our


Sign up for a forum account at the Front Page. | Remember to Tag your posts.
Having problems logging in to the forums? Go the front page, log out and back in again.

Author Topic: Skills on weapons  (Read 5735 times)

Offline F430

  • Enchanted
  • *
  • Posts: 54
    • View Profile
Skills on weapons
« on: July 19, 2018, 10:38:37 AM »
Greetings all.

I got a question which hopefully can be answered here.
As a test, I'm trying to make a unique weapon which can proc on strike.
Normally, this would be a non-issue as there are plenty of stock procs in the game, but the proc I'm trying to make would be using a vanilla player skill.
The problem is that skills are separated into core/parent which controls everything, as well as child skills which can include abilities that are added as more points are invested in the skill.
If this is possible at all, would it require a chain of affixes and triggerables? Or would a single affix with correct skill name suffice?
I tried this sort of thing before and the usual result was "20% chance to cast ??? on strike" when testing in-game.

I have some additional questions, but I'll save them for later, as I don't want to make a massive wall with all of my novice woes.

Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2560
  • Country: ph
    • status ready
    • View Profile
  • Mood: mood angel
Re: Skills on weapons
« Reply #1 on: July 19, 2018, 09:58:59 PM »
Hi @F430 welcome to torchmodders!

Im having trouble figuring out what you want help with :D

is "+x% chance to cast" NOT what u wanted? cos that sounds like u got it working. What did u want instead?



Offline F430

  • Enchanted
  • *
  • Posts: 54
    • View Profile
Re: Skills on weapons
« Reply #2 on: July 20, 2018, 12:23:52 AM »
Hi Phanjam.
"x% to cast y" would be the desired effect, but the problem I'm having is that, instead of having a player skill proc from a weapon strike, nothing happens, and I get 3 question marks instead of the skill name that should proc.
This is probably due to an incorrect skill name, but another issue is that skill folders have tonnes of files in them and picking the correct one is trial and error, moreso if I wanted to use a particular level of the skill, eg level 10 of Berserker's Raze skill, rather than just the barebones skill with 1 point in it.

Edit: in a stroke of genius, I reckon I managed to get it to work, somehow. Except a completely unexpected problem surfaced - neither the weapon, nor the skill it calls on strike, deal any damage whatsoever.
« Last Edit: July 20, 2018, 01:08:36 AM by F430 »

Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2560
  • Country: ph
    • status ready
    • View Profile
  • Mood: mood angel
Re: Skills on weapons
« Reply #3 on: July 20, 2018, 09:04:05 AM »
I made something like this only once so far.

The item (a greathammer in my case) has an AFFIX baked-in to its DAT like this...

Code: [Select]
	[AFFIXES]
<STRING>AFFIX:HAMMERFALLEMBER
<STRING>AFFIX:UNIQUE_DIRECT_POISON_PERCENT_ALWAYS
[/AFFIXES]

That HAMMERFALLEMBER affix goes on to your char whenever you equip the item, granting you a CAST SKILL ON STRIKE effect.  The AFFIX code is...

Code: [Select]
[AFFIX]
<STRING>NAME:HAMMERFALLEMBER
<INTEGER>RANK:0
<INTEGER>MIN_SPAWN_RANGE:0
<INTEGER>MAX_SPAWN_RANGE:999
<FLOAT>DURATION:0
<INTEGER>WEIGHT:0
<INTEGER>SLOTS_OCCUPY:0
[EFFECT]
<STRING>NAME:HAMMERFALLEMBER
<STRING>ACTIVATION:PASSIVE
<INTEGER>LEVEL:1
<STRING>TYPE:CAST SKILL ON STRIKE
<BOOL>SAVE:true
<FLOAT>MIN:100
<FLOAT>MAX:100
[/EFFECT]
[/AFFIX]

As you can see, the chance to cast is set at 100%.  The skill it casts is that HAMMERFALLEMBER skill (the <STRING>NAME: inside the [EFFECT] block. kinda confusing i know, i proly shoulda named the skill differently from the affix :P )

The skill itself is a rehash of an old skill developed for another mod, but it can be anything you want really ;)

And i get this...

Spoiler
« Last Edit: July 20, 2018, 09:13:19 AM by Phanjam »



Offline F430

  • Enchanted
  • *
  • Posts: 54
    • View Profile
Re: Skills on weapons
« Reply #4 on: July 20, 2018, 10:00:25 AM »
And this is what I've done as far as the affix code itself goes:

Code: [Select]
[AFFIX]
<STRING>NAME:UNIQUE_PROC_WEAPON_RAZE
<INTEGER>RANK:0
<INTEGER>MIN_SPAWN_RANGE:0
<INTEGER>MAX_SPAWN_RANGE:999
<FLOAT>DURATION:0
<INTEGER>WEIGHT:0
<INTEGER>SLOTS_OCCUPY:0
[UNITTYPES]
<STRING>UNITTYPE:UNIQUE SOCKETABLE
<STRING>UNITTYPE:WEAPON
[/UNITTYPES]
[NOT_UNITTYPES]
<STRING>UNITTYPE:WEAPON
[/NOT_UNITTYPES]
[EFFECT]
<STRING>NAME:BigStrike
<STRING>ACTIVATION:PASSIVE
<INTEGER>LEVEL:15
<STRING>TYPE:CAST SKILL ON MELEE STRIKE
<STRING>DAMAGE_TYPE:PHYSICAL
<BOOL>SAVE:true
<FLOAT>MIN:100
<FLOAT>MAX:100
[/EFFECT]
[/AFFIX]

The test weapon I made has "100% chance to cast Raze on strike", which is what I was after from the start, but the skill itself itself does not do any damage.
More importantly, as stated before, the weapon itself doesn't do ANY damage either, and I have no idea why.

Here's the weapon code, if it's of any relevance:

Spoiler
Code: [Select]
[UNIT]
<STRING>BASEFILE:media\units\items\fists\base_fists_unique.dat
<INTEGER>DAMAGE_PHYSICAL:100
<TRANSLATE>DISPLAYNAME:Testing Fist
<STRING>ICON:icon_weapon_fist21
<STRING>MESHFILE:fist21
<STRING>NAME:legendary_fist_testing
<INTEGER>RARITY:0
<STRING>RESOURCEDIRECTORY:media/models/weapons/_Fists
<INTEGER>SPEED:70
<INTEGER>SPEED_DMG_MOD:70
<STRING>UNITTYPE:LEGENDARY FIST
<INTEGER>LEVEL:30
<INTEGER>MINLEVEL:45
<INTEGER>RARITY_DMG_MOD:160
<INTEGER>SOCKETS:2
<TRANSLATE>UNIDENTIFIED_NAME:A Truly Spectacular Find!
<INTEGER>DEXTERITY_REQUIRED:0
<INTEGER>STRENGTH_REQUIRED:0
<FLOAT>WEAPONARC:0
<FLOAT>SECONDARY_DMG_PCT:0
<FLOAT>SCALE:1.5
<STRING>ATTACHEDLAYOUT:media/particles/weapons/legendaries/pistollayout.layout
<STRING>UNIT_GUID:5723810948296985480
<TRANSLATE>DESCRIPTION:Placeholder desc
<INTEGER>LEVEL_REQUIRED:1
[AFFIXES]
<STRING>AFFIX:UNIQUE_PROC_WEAPON_RAZE
[/AFFIXES]
[/UNIT]

Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2560
  • Country: ph
    • status ready
    • View Profile
  • Mood: mood angel
Re: Skills on weapons
« Reply #5 on: July 20, 2018, 01:21:27 PM »
First about the weapon itself having no damage, to eliminate possible glitches in coding, i recommend u use a straight copy of an existing weapon .DAT with no edits at all except for
- change NAME:
- change GUID and
- add your skill affix

If that works out u can always edit from there but it should be easier to trace back any problems

Next about the skill doing no damage - check that the skill DAT is able to find all the other files it needs to work, like any LAYOUT and damage AFFIX files. Calling layouts is file-path-specific so ur directory structure has to match (or the other way around)
« Last Edit: July 20, 2018, 01:25:06 PM by Phanjam »



Offline F430

  • Enchanted
  • *
  • Posts: 54
    • View Profile
Re: Skills on weapons
« Reply #6 on: July 20, 2018, 03:21:53 PM »
I've tried quite a few things that you listed and then some, namely barebones item cloning, affix checking, making sure .dat/.layout files are in correct folders and whatnot, even made sure all project directories are uppercase so some data editors won't list the same thing more than once.

And yet, no damage from both the weapon and skill.

The orange werewolf mesh appears every time I attack an enemy so I'm just about certain the layouts are intact and refer to correct files.
Also, none of the existing mods I have change that particular player skill in any way.
I'm still very much a novice in this, but the only thing I can think is making the entire skill, or at least a specific level, into a standalone shared skill or something along the lines.

Offline Epoch

  • Developer
  • Enchanted
  • *
  • Posts: 65
    • View Profile
Re: Skills on weapons
« Reply #7 on: July 20, 2018, 06:15:29 PM »
I think the problem may have to do with what activation type the skill is set to.

Can you show the code to the skill you are using?

Offline F430

  • Enchanted
  • *
  • Posts: 54
    • View Profile
Re: Skills on weapons
« Reply #8 on: July 20, 2018, 07:00:57 PM »
The skill in question is a vanilla Berserker skill [MEDIA\SKILLS\BERSERKER\BIGSTRIKE] and it's not modified in any way, besides I'm not sure SMF would like 11KB of text in a single post.
But with activation types, I'm lead to believe that procs are always set to passive, as they can occur based on chance percentage.

Offline Epoch

  • Developer
  • Enchanted
  • *
  • Posts: 65
    • View Profile
Re: Skills on weapons
« Reply #9 on: July 20, 2018, 08:56:37 PM »
Alright, so I tested several possibilities and discovered the answer is extremely simple.

From what I can tell, weapons that proc skills cannot utilize anything that falls within:
Code: [Select]
		[EVENT_TRIGGER]
[/EVENT_TRIGGER]

So what I did was follow PJ's instructions for the weapon & affix, then made a copy of the BigStrike skill, renamed it BigStrike2, and changed the GUID. I then changed the EVENT_TRIGGER to EVENT_START and everything works properly. Procced skills can still utilize the EVENT_UNITHIT, so the buff this skill applies still works.

Use the affix to set what level of the skill you want to proc through:
Code: [Select]
	<INTEGER>LEVEL:#

Super easy solution.
« Last Edit: July 20, 2018, 09:00:56 PM by Epoch »

Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2560
  • Country: ph
    • status ready
    • View Profile
  • Mood: mood angel
Re: Skills on weapons
« Reply #10 on: July 21, 2018, 01:50:06 AM »
Woot! Yeah i was wrong to say "it can be any skill u want" sorry about that @F430 :P

And thanks @Epoch !

Edit:
Oh and @F430 , ur right to point out its an existing vanilla skill so a repost is not necessary. But generally speaking, in the interest of advancing modding knowledge, 11kb of text is well well worth it! :D
« Last Edit: July 21, 2018, 01:55:29 AM by Phanjam »



Offline F430

  • Enchanted
  • *
  • Posts: 54
    • View Profile
Re: Skills on weapons
« Reply #11 on: July 21, 2018, 11:38:14 AM »
Thanks for your help, lads. I won't be able to test this properly until later today, but based on my noobish understanding of what Epoch said, what is it exactly that I should do?
Should I rename EVENT_TRIGGER brackets to EVENT_START, then remove original EVENT_START? Or should I merge them both and remove whatever is left within EVENT_TRIGGER, brackets themselves included?
If I can slap the entries from both within a single bracket, then that's fair enough, but I'm not certain what to do with .layout references, since both _START and _TRIGGER have those, and I have no idea whether calling both in a single entry would cause issues.

Apologies for being dense, but I really want to get this right, as I'm very much enjoying modding TL2.

Offline Epoch

  • Developer
  • Enchanted
  • *
  • Posts: 65
    • View Profile
Re: Skills on weapons
« Reply #12 on: July 21, 2018, 03:25:34 PM »
Leave the existing EVENT_START as is. Just change the EVENT_TRIGGER into a 2nd EVENT_START bracket. If I remember correctly, you can only have 1 layout per event bracket.

Offline F430

  • Enchanted
  • *
  • Posts: 54
    • View Profile
Re: Skills on weapons
« Reply #13 on: July 21, 2018, 06:34:45 PM »
Alright, you two can rest easy now. I figured it out and the skill works perfectly. I cut the whole thing down to a single [LEVEL] entry and removed some unneeded strings like mana cost, tier descriptions and whatnot.

I would like to once again thank you both very much for assisting me in this.

Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2560
  • Country: ph
    • status ready
    • View Profile
  • Mood: mood angel
Re: Skills on weapons
« Reply #14 on: July 22, 2018, 01:35:31 AM »
Glad to hear that F430! Just give a shout if u feel u need help with something ;)



Tags:
 

* Quick Search


* Member Information

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Mod Boards Activity

* Who's Online

  • Dot Guests: 9
  • Dot Hidden: 0
  • Dot Users: 1
  • Dot Users Online:

* Calendar

November 2018
Sun Mon Tue Wed Thu Fri Sat
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
[18] 19 20 21 22 23 24
25 26 27 28 29 30

No calendar events were found.

* Recent Topics

Pet Variants Mod by Sch123
[Today at 11:52:56 AM]


Skills Expansion: Bugs Report & Ideas by Sch123
[Today at 11:23:59 AM]


Equipping Weapon *Visual* to Pet? by Phiengley
[November 17, 2018, 07:03:40 AM]


Hello! by Phanjam
[November 10, 2018, 03:57:42 AM]


(Solved)Help Editing Vanilla Class (adding / taking out other vanilla Skills) by Lrv
[November 07, 2018, 05:05:55 PM]


[TL2] Ultimate Respec Lite by doudley
[November 04, 2018, 08:17:27 AM]


Torchlight Frontiers announced by Kva3imoda
[November 03, 2018, 11:10:58 PM]


Fate Items by Phanjam
[November 03, 2018, 11:10:17 PM]


FEP+ by Sch123
[November 02, 2018, 09:03:12 AM]


Skills on weapons by Sch123
[October 29, 2018, 11:15:59 AM]


Medea Pet to Class by Vkoslak
[October 26, 2018, 07:41:19 PM]


[Tool] Item Unit file maker Script by Anarch16sync
[October 26, 2018, 04:13:27 PM]


Notepad++ Custom Language File (Syntax Highlight) by Lord Nyriox
[October 26, 2018, 12:08:33 AM]


Mod Package and Publish Error by DragonDawn
[October 24, 2018, 02:31:03 PM]


Looking for Modder to Collaborate on Character Design by Exqzr
[October 23, 2018, 08:15:56 AM]

* Popular Topics