• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Creaint SFX on a Unit with Chaos Ability

Status
Not open for further replies.
Level 7
Joined
Jun 8, 2010
Messages
283
Title Typo: Create SFX on a Unit with Chaos Ability

Well, I have an item that would attach a special effects on the overhead of a unit. Then that unit would be given a chaos ability to transform. Sadly when I attach the special effects on the overhead of the unit after giving that unit chaos, it only attaches the special effects at the region point of the units position.

Heres the basic trigger without all the excess actions.
  • Event
    • Unit - A unit Uses an item
  • Conditions
  • Actions
    • Unit - Add Chaos (weapon) to (Hero manipulating item)
    • Special Effect - Create a special effect attached to the overhead of (Hero manipulating item) using war3mapImported\LIght_Flashlight_22.MDX
Reward: +rep :)
 
Use this:
  • Melee Initialization Copy
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Actions
      • Custom script: local unit u = GetTriggerUnit()
      • Custom script: call UnitAddAbility (u, 'S000')
      • Custom script: loop
      • Custom script: exitwhen GetUnitTypeId(u) == 'Hmkg'
      • Custom script: call TriggerSleepAction (0.27)
      • Custom script: endloop
      • Custom script: call AddSpecialEffectTarget ("Abilities\\Spells\\Other\\TalkToMe\\TalkToMe.mdx", u, "overhead")
      • Custom script: set u = null
Explanation:
• 'S000' is the rawcode of the custom Chaos ability I made. To view the rawcodes, go to Object Editor -> View (menu) -> Display object values as raw data or simply hit "Ctrl + D".

• 'Hmkg' is the rawcode of Mountain King; in the Chaos ability I created, I used Mountain King to be the 'to-be-transformed' unit-type, that is why I used its rawcode.

• This one detects whenever the unit-type of the hero that used an item becomes equal to the unit type of Mountain King's, so as to add the Special Effect afterwards.

Test map:

View attachment Special Effect & Chaos [test].w3x

P.S. You can also use 0.1 in place of 0.27, in the line "TriggerSleepAction".
 
Level 7
Joined
Jun 8, 2010
Messages
283
The spell worked properly in the test map, but when I copy and modify the triggers for my map I get the following errors for the following lines.

Line 2220 Expected 'Endif'
  • Custom script: local unit u = GetTriggerUnit()
Line 2221 Expected a name
  • Custom script: call UnitAddAbility (u, 'S004')
Line 2223 Expected a name
  • Custom script: exitwhen GetUnitTypeId(u) == 'H003'
Line 2226 Expected a name
  • Custom script: call AddSpecialEffectTarget ("Abilities\\Spells\\Other\\TalkToMe\\TalkToMe.mdx", u, "overhead")
Line 2227 Expected a variable name
  • Custom script: set u = null
 
Status
Not open for further replies.
Top