News: Go to the front page portal to create a Torchmodders account | Visit the wiki!
May 28, 2020, 06:14:49 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: Triggerable Weapons  (Read 1231 times)

Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2749
  • Country: ph
    • status ready
    • View Profile
  • Mood: mood angel
Triggerable Weapons
« on: April 19, 2019, 07:17:40 AM »
Hi! I'm going to post about this exercise to make "triggerable weapons". The idea was to make weapons which behave how the "relic weapons" in the upcoming Torchlight Frontiers game work (at least how i understood it from their descriptions).

So my take-off was from TL2's "augmentable weapons".  These use an affix which (a) attaches a triggerable to increment a stat whenever the weapon does something this first triggerable is set to look for (like "kill x monsters"), and (b) attaches a second triggerable which activates some special affix when the watched stat reaches a value this second triggerable is looking for.

In the vanilla augmentable weapons, the special affix also does a REMOVE TRIGGERABLE on the unit, wiping away both of the triggerables mentioned above. My idea was to leave those triggerables on the unit and just do a SET STAT to bring the watched stat back to a value of 0 or 1, thereby allowing the triggerables (which are still on the unit) to do their thing all over again ;) .

So as usual I am still having trouble making this work. And since I can't spend too many hours bird-dogging this, i wanted to post so people smarter than me might get interested to try and figure it out.



Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2749
  • Country: ph
    • status ready
    • View Profile
  • Mood: mood angel
Re: Triggerable Weapons
« Reply #1 on: April 19, 2019, 07:17:53 AM »
Here is the unit file. It's a straight copy of the GREATSWORD_N01.DAT file in the GUTS media folder, just renamed / re-GUID'd and adding a custom affix for the triggerables.

TRIGGERABLE UNIT
Code: [Select]
[UNIT]
<STRING>BASEFILE:media\units\items\2HSword\base_2hsword.dat
<STRING>UNIT_GUID:8400082774156798390
<INTEGER>DAMAGE_PHYSICAL:1000
<TRANSLATE>DISPLAYNAME:Reliquary Broadsword
<INTEGER>LEVEL:2
<STRING>MESHFILE:greatsword01
<STRING>NAME:reliquary_greatsword_n01
<INTEGER>RARITY:0
<STRING>RESOURCEDIRECTORY:media/models/weapons/_Greatswords
<INTEGER>SPEED:90
<INTEGER>SPEED_DMG_MOD:90
<STRING>ICON:icon_weapon_greatsword01
<INTEGER>DEFENSE_REQUIRED:0
<INTEGER>DEXTERITY_REQUIRED:0
<INTEGER>MAGIC_REQUIRED:0
<INTEGER>STRENGTH_REQUIRED:40
<INTEGER>MINLEVEL:1
[AFFIXES]
<STRING>AFFIX:CRIT_EVERY_10_KILLS
[/AFFIXES]
[/UNIT]

So the affix which starts it all of is CRIT_EVERY_10_KILLS, which looks like this...

CRIT_EVERY_10_KILLS AFFIX
Code: [Select]
[AFFIX]
<STRING>NAME:CRIT_EVERY_10_KILLS
<TRANSLATE>PREFIX:Reliquary [ITEM]
<INTEGER>RANK:1
<INTEGER>MIN_SPAWN_RANGE:11
<INTEGER>MAX_SPAWN_RANGE:999
<FLOAT>DURATION:0
<INTEGER>WEIGHT:5
<INTEGER>SLOTS_OCCUPY:1
[UNITTYPES]
<STRING>UNITTYPE:WEAPON
[/UNITTYPES]
[NOT_UNITTYPES]
<STRING>UNITTYPE:MAGIC
[/NOT_UNITTYPES]
[EFFECT]
<STRING>NAME:CRIT_EVERY_10_KILLS
<STRING>ACTIVATION:DYNAMIC
<STRING>DURATION:INSTANT
<STRING>TYPE:ADD TRIGGERABLE
<FLOAT>CHANCE:100
[/EFFECT]
[EFFECT]
<STRING>NAME:CRIT_EVERY_10_KILLS_COUNT
<STRING>ACTIVATION:DYNAMIC
<STRING>DURATION:INSTANT
<STRING>TYPE:ADD TRIGGERABLE
<FLOAT>CHANCE:100
[/EFFECT]
[/AFFIX]

the first triggerable it adds is also named CRIT_EVERY_10_KILLS.  This is the triggerable which gives the special affix when the triggerable condition is met - in this case, "kill 10 monsters".

CRIT_EVERY_10_KILLS, FIRST TRIGGERABLE
Code: [Select]
[TRIGGERABLEACTION]
<STRING>NAME:CRIT_EVERY_10_KILLS
<TRANSLATE>DESCRIPTION:|cFFEAAA15Reliquary Weapon:\nKill 10 enemies to activate
//I just removed this part (<stat:killcount_any_25_crit>/25 killed)
<STRING>GAMEEVENTTYPE:STAT
<STRING>EVENTCREATOR:SELF
<STRING>SUBTYPE:ADDSTAT
<INTEGER>LEVEL:1
<FLOAT>FLOATCONDITION:10
<INTEGER>COOLDOWN:0
<BOOL>MESSAGEONTRIGGER:true
[AFFIXES]
<STRING>AFFIX:10_KILL_CRIT
[STATWATCHER]
<STRING>STAT:KILLCOUNT_CRIT_EVERY_10_KILLS
<STRING>PRIMARY_TARGET_TYPE:SELF
<STRING>SECONDARY_TARGET_TYPE:VALUE
<STRING>WATCH_TYPE:GREATER THAN
<FLOAT>SECONDARY_VALUE:9
[/STATWATCHER]
[/AFFIXES]
//I also removed the following lines so the triggerables stay on the unit
//[TRIGGERABLESREMOVE]
// <STRING>TRIGGERABLE:CRIT_EVERY_10_KILLS
// <STRING>TRIGGERABLE:CRIT_EVERY_10_KILLS_COUNT
//[/TRIGGERABLESREMOVE]
[/TRIGGERABLEACTION]

So it's looking for the stat KILLCOUNT_CRIT_EVERY_10_KILLS to reach 10 and then it will award the special affix 10_KILL_CRIT.

The second triggerable given by the CRIT_EVERY_10_KILLS affix is CRIT_EVERY_10_KILLS_COUNT...

CRIT_EVERY_10_KILLS_COUNT, SECOND TRIGGERABLE
Code: [Select]
[AFFIX]
<STRING>NAME:ADD_CRIT_EVERY_10_KILLS_COUNT
<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:KILLCOUNT_CRIT_EVERY_10_KILLS
<STRING>ACTIVATION:DYNAMIC
<STRING>DURATION:INSTANT
<STRING>TYPE:ADD STAT
<FLOAT>MIN:1
<FLOAT>MAX:1
<FLOAT>CHANCE:100
[/EFFECT]
[/AFFIX]

So this triggerable is looking for instances that you kill a monster using this weapon, and when it sees that it will increment the stat KILLCOUNT_CRIT_EVERY_10_KILLS by 1 (same stat the first triggerable is watching to reach 10).

For reference here is the code for the stat KILLCOUNT_CRIT_EVERY_10_KILLS...

KILLCOUNT_CRIT_EVERY_10_KILLS STAT
Code: [Select]
[STAT]
<STRING>NAME:KILLCOUNT_CRIT_EVERY_10_KILLS
<INTEGER64>UNIQUE_GUID:-1773635467609341913
<TRANSLATE>DISPLAYNAME:Monsters Slain
<STRING>TYPE:TYPE_INT
<FLOAT>MAXVALUE:10000
<BOOL>SAVES:true
[/STAT]

So assuming the first triggerables is working, when you kill 10 monsters with the weapon the stat should be at 10, which then activates the second triggerable to give you the special affix.

Here is the code for the special affix 10_KILL_CRIT SPECIAL...

10_KILL_CRIT SPECIAL AFFIX
Code: [Select]
[AFFIX]
<STRING>NAME:10_KILL_CRIT
<INTEGER>RANK:1
<INTEGER>MIN_SPAWN_RANGE:0
<INTEGER>MAX_SPAWN_RANGE:999
<FLOAT>DURATION:30
<INTEGER>WEIGHT:0
<INTEGER>SLOTS_OCCUPY:0
[UNITTYPES]
<STRING>UNITTYPE:WEAPON
[/UNITTYPES]
[NOT_UNITTYPES]
<STRING>UNITTYPE:WEAPON
[/NOT_UNITTYPES]
[EFFECT]
<STRING>NAME:RELIQUARY CRITICAL CHANCE
<STRING>ACTIVATION:PASSIVE
<STRING>DURATION:0
<STRING>TYPE:CRITICAL CHANCE
<STRING>UNITTHEME:BERSERKERRAGE
<FLOAT>MIN:100
<FLOAT>MAX:100
[/EFFECT]
[EFFECT]
<STRING>NAME:KILLCOUNT_CRIT_EVERY_10_KILLS
<STRING>ACTIVATION:PASSIVE
<STRING>DURATION:INSTANT
<STRING>TYPE:SET STAT
<FLOAT>MIN:0
<FLOAT>MAX:0
<FLOAT>CHANCE:100
[/EFFECT]
[/AFFIX]

So the special affix is meant to let you crit 100% of the time for 30 seconds ( <FLOAT>DURATION:30 ).  I included the unit theme BERSERKERRAGE just to give me some visual indication that the affix had been awarded.

Lastly, it has the SET STAT effect to bring the stat KILLCOUNT_CRIT_EVERY_10_KILLS back to 0, so the cycle can begin again.
« Last Edit: April 19, 2019, 07:42:56 AM by Phanjam »



Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2749
  • Country: ph
    • status ready
    • View Profile
  • Mood: mood angel
Re: Triggerable Weapons
« Reply #2 on: April 19, 2019, 07:32:04 AM »
Okay so troubleshooting...

The 2 main triggerables seem to get applied just fine (they show in the GUTS combat log when i spawn the weapon), but when i kill 10 onsters nothing seems to happen :P

What i was troubleshooting when i had to stop for other RL things were...

1. the "add 1" triggerable isnt working, so the stat isnt incrementing
2. the stat is incrementing but the "grant special affix" triggerable isnt working
3. the triggerable is awarding the special affix, but its improperly coded so it looks like its not being awarded

So thus it will stay, until i am able to get back to it :P

But if anyone wants to take a crack at it, pls be my guest!  The MEDIA folder in its current state is attached below...
« Last Edit: April 19, 2019, 07:40:28 AM by Phanjam »



Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2749
  • Country: ph
    • status ready
    • View Profile
  • Mood: mood angel
Re: Triggerable Weapons
« Reply #3 on: April 29, 2019, 11:15:57 AM »
Okay an update on this experiment, by way of an infographic...



So it's kinda working atm, but looks like i need to refine how i code-up the special affix that's meant to be applied.

Woot! Ever forward! :D



Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2749
  • Country: ph
    • status ready
    • View Profile
  • Mood: mood angel
Re: Triggerable Weapons
« Reply #4 on: June 04, 2019, 12:25:05 PM »
Hey all! For now a quick post to say that "trigerrable weapons" are now a real thing, thanks heavily to Twinkletoes!

His method uses all skills - had to move away from trigerrables because it had issues with who "owns" what effect or trigerrable :P It works like a charm! Will post code samples in a future post.

Next i will try see if i can get the trigerrables method to work on player units ;)



 

* Quick Search


* Member Information

 
 
Welcome, Guest. Please login or register.

* Mod Boards Activity

* Who's Online

  • Dot Guests: 3
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Calendar

May 2020
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
31

No calendar events were found.

* Recent Topics

How do you change Whirling Gust Skill to not count Pistols? by Phanjam
[May 26, 2020, 10:22:02 AM]


How do I add Piercing to Sniper Shot? by Phanjam
[May 26, 2020, 08:28:50 AM]


How to remove Pistol and Crossbow projectile trails? by Phanjam
[May 25, 2020, 04:45:05 PM]


How to change Chatacter Select weapon animations? by InsanityPilgrim
[May 24, 2020, 06:46:27 AM]


How to change Summon Limit? by InsanityPilgrim
[May 24, 2020, 02:43:53 AM]


[SCRIPT] Automatic Mesh Rebuilding by Lord Nyriox
[May 22, 2020, 03:33:07 AM]


[Tool] another localization tool by Awkward
[May 13, 2020, 05:29:37 AM]


Need Help: Getting Translation into game by Awkward
[May 09, 2020, 05:12:16 PM]


I need some help merging 2 simple mods that both contain GLOBALS.DAT files by Phanjam
[May 08, 2020, 09:50:26 AM]


Wardrobe Mod Progress, Issues, Updates by Zodin
[May 05, 2020, 05:49:46 PM]


New class "Timewarper" by Phanjam
[April 11, 2020, 02:41:22 AM]


Variant Classes Mod Information by Sch123
[April 10, 2020, 04:22:51 PM]


% to cast spell in a Set Bonus by Phanjam
[February 25, 2020, 03:52:45 PM]


Lightbringer Mod (Paladin) by Phanjam
[February 15, 2020, 02:23:45 AM]


What free software do you guys use? by Phanjam
[January 24, 2020, 06:25:40 AM]

* Popular Topics