• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Short questions

Status
Not open for further replies.
Level 17
Joined
Nov 13, 2006
Messages
1,814
1. Can i add 2 effect with 1 trigger, i mean with add special effect to unit trigger can i add with 1 trigger weapon to unit left/right hand or need 2 trigger for this? (i am curios if i could make dynamic attachment system, and use string for attachment point and attachment model, but problem when i must attach to 2 place with 1 trigger)

2. can i change the default 1 ability point/lv up to 5 ability point ? i mean to when hero level uppinh then automaticall get 1 ability point, but i dont got this option in gameplay constants

3. if i do 3 ability and both 3 got 500 level that make high delay ? (in comparation with 6 ability lv10?)

4. specialeffectvar=specialeffect[5]
destroy specialeffectvar

5. how can i transfer the gear attachment to another unit if i use metamorph or replace unit?

then specialeffect[5] is destroyed too and have no leak right?
 
Last edited:

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
1.you can add it with one trigger
2.
  • Untitled Trigger 001
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • Hero - Modify unspent skill points of (Triggering unit): Add 4 points
3. 500 levels i way too much even if it dont lag it will not be good
4. yes the leak is removed if you instantly destroy it.

EDIT, HAH i was first spartipilo :D
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
1 - I think there's no problem, as long as you destroy the special effect when the unit stops using the item.

2- I never found the way to do it manipulating gameplay. You just use a trigger that "A unit levels up" -> "Unit - Set skill points to ##". It allows you to add, substract, or set specific value of skill points. Be aware that the maximum value of skill points available is equal to the sum of the levels of the available skills to learn. Example:

You have 4 skills with 10 levels each, and your max hero level is 60. If your hero reaches level 60 without using the points, it will stuck on 40, and never go over it, even if the unit levels up.

3- 500 Level is extreme gore lag/delay and map size increase. Warcraft 3 creates .slk files to handle abilities that have more than 4 levels, and .slk files will increase your mapsize. A 500 level ability, haven't tested, but I think it would create a huge ~5 segs lag spike. No more lag/delay after that. It just lags the first time.

4- Yeah, it works too. Saving special effects into variables is used to destroy special effects which requires permanency, and not inmediate destroying. You can have the special effect there all the time you want, and destroy it whenever you want with "

  • Special Effect - Create Special Effect using Bla\Bla.
  • Set specialeffect[5] = last created special effect
  • -------- You can play 5 hours, and then do --------
  • Special Effect - Destroy specialeffect[5] special effect
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
1.you can add it with one trigger

how?


Special Effect - Create a special effect attached to the hand left,hand right of (Triggering unit) using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl

this not work, or similair combinations. i want add dual weapon like dual dagger/2boot without useing 2 attachment array and check at every weapon switch
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
It's hand,left. Not left,hand :)

You attach the special effect to the hand, and then you tell it's the left... You can't attack to the left and then say that it's the hand.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
somebody can talk from his experience?
  • Melee Initialization
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Special Effect - Create a special effect attached to the hand left hand right of Paladin 0000 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Special Effect - Create a special effect attached to the hand left+hand right of Paladin 0000 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Special Effect - Create a special effect attached to the hand left,hand right of Paladin 0000 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Special Effect - Create a special effect attached to the hand+left,hand+right of Paladin 0000 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Special Effect - Create a special effect attached to the hand+left hand+right of Paladin 0000 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Special Effect - Create a special effect attached to the hand left+right of Paladin 0000 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Special Effect - Create a special effect attached to the right hand left hand of Paladin 0000 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Special Effect - Create a special effect attached to the right left hand of Paladin 0000 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Special Effect - Create a special effect attached to the right+left hand of Paladin 0000 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Special Effect - Create a special effect attached to the right,left hand of Paladin 0000 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Special Effect - Create a special effect attached to the right hand+left hand of Paladin 0000 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
that dont work
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
I will try this in my editor right now.

EDIT
this work for me test with another unit if this not work
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Special Effect - Create a special effect attached to the hand,left of Villager (Male 2) 0000 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
pls read the question
1. Can i add 2 effect with 1 trigger, i mean with add special effect to unit trigger can i add with 1 trigger weapon to unit left/right hand or need 2 trigger for this? (i am curios if i could make dynamic attachment system, and use string for attachment point and attachment model, but problem when i must attach to 2 place with 1 trigger)

i want add dual weapon like dual dagger/2boot

Darkgrom said:
1.you can add it with one trigger

I will try this in my editor right now.
EDIT
this work for me test with another unit if this not work
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Special Effect - Create a special effect attached to the hand,left of Villager (Male 2) 0000 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
just use another dagger model for one or use abilitys for attackments i think it will stack then

1. another dagger model kinda ugly if the difference in design is much
2. abilities again + work if everything else was made for multiboard inventory system then i must check everytime if he got ability and remove it, so at last its longer solution if each model is +1 ability and i use 10+ dagger=>10+ ability

how can i transfer the gear attachment to another unit if i use metamorph or replace unit?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Because you're setting an action into a variable. Variable works with values, not with actions.

It should be "Custom script: call AddSpecialEffectTarget(udg_Attachment_Path[400], GetTriggerUnit(), "foot,right")"
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Because you're setting an action into a variable. Variable works with values, not with actions.

It should be "Custom script: call AddSpecialEffectTarget(udg_Attachment_Path[400], GetTriggerUnit(), "foot,right")"

(about previous question, i can do anything but don's show the special effect if its path is war3import blabla, need custom path, idk why but work now)

i dont know why but this dont work (i think dont store to attachment weapon variable, kinda dont have last created effect)

(simple stacking all attachment on unit and dont destroyed if i destroy the attachment weapon variable)

  • Custom script: call AddSpecialEffectTarget(udg_Attachment_Path[udg_Weapon[udg_plNR]], GetTriggerUnit(), "hand left")
  • Set Attachment_Weapon[plNR] = (Last created special effect)
  • later
  • Special Effect - Destroy Attachment_Weapon[plNR]
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
The reason it doesn't work is because AddSpecialEffectTarget doesn't set bj_lastCreatedSpecialEffect (aka Last created special effect in GUI) to the created special effect.

Create and set the special effect variable like this:
  • Custom script: set udg_Attachment_Weapon[plNR] = AddSpecialEffectTarget(udg_Attachment_Path[udg_Weapon[udg_plNR]], GetTriggerUnit(), "hand left")
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
The reason it doesn't work is because AddSpecialEffectTarget doesn't set bj_lastCreatedSpecialEffect (aka Last created special effect in GUI) to the created special effect.

Create and set the special effect variable like this:
  • Custom script: set udg_Attachment_Weapon[plNR] = AddSpecialEffectTarget(udg_Attachment_Path[udg_Weapon[udg_plNR]], GetTriggerUnit(), "hand left")

still dont work this (reason why i destroy and recreate coz have more weapon type and i dont wrote destroy attach to each weapon type in previous action)

still result is the old special effect not destroyed jusr stacking (if i pick 4x then add 4x to right hand)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • TempNr Less than 1050
      • TempNr Greater than or equal to 750
      • Weapon[plNR] Greater than 0
    • Then - Actions
      • Special Effect - Destroy Attachment_Weapon[plNR]
      • Special Effect - Destroy Attachment_Weapon2[plNR]
      • Custom script: set udg_Attachment_Weapon[udg_plNR] = AddSpecialEffectTarget(udg_Attachment_Path[udg_Weapon[udg_plNR]], GetTriggerUnit(), "hand right")
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempNr Less than 1000
          • TempNr Greater than or equal to 950
        • Then - Actions
          • Custom script: set udg_Attachment_Weapon2[udg_plNR] = AddSpecialEffectTarget(udg_Attachment_Path[udg_Weapon[udg_plNR]], GetTriggerUnit(), "hand left")
        • Else - Actions
    • Else - Actions
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
with this work but got around 5 sec delay in replace.

i mean i equip a bow after sword then still sword in my hand (also bow) and need ~4-5sec till sword dispear. i need do something trick for instant attachment replace?

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • TempNr Less than 1050
      • TempNr Greater than or equal to 750
      • Weapon[plNR] Greater than 0
    • Then - Actions
      • Special Effect - Destroy Attachment_Weapon[plNR]
      • Special Effect - Destroy Attachment_Weapon2[plNR]
      • Custom script: set udg_Attachment_Weapon[udg_plNR] = AddSpecialEffectTarget(udg_Attachment_Path[udg_Weapon[udg_plNR]], GetTriggerUnit(), "hand right")
      • Custom script: call AddSpecialEffectTargetUnitBJ( "hand right", GetTriggerUnit(), udg_Attachment_Path[udg_Weapon[udg_plNR]] )
      • Set Attachment_Weapon[plNR] = (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempNr Less than 1000
          • TempNr Greater than or equal to 950
        • Then - Actions
          • Custom script: call AddSpecialEffectTargetUnitBJ( "hand left", GetTriggerUnit(), udg_Attachment_Path[udg_Weapon[udg_plNR]] )
          • Set Attachment_Weapon2[plNR] = (Last created special effect)
          • Custom script: set udg_Attachment_Weapon2[udg_plNR] = AddSpecialEffectTarget(udg_Attachment_Path[udg_Weapon[udg_plNR]], GetTriggerUnit(), "hand left")
        • Else - Actions
    • Else - Actions
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,243
That is because the item has no death animation. There's a special effect decay time in gameplay constants, destroyed effects stay there for about 5 seconds. The death anim should play, but as it doesn't exist, the stand anim is played instead.

There is some trick around that I believe. It might involve Metamorphosis. I'm using it in my project, but can't remember the details right now.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
That is because the item has no death animation. There's a special effect decay time in gameplay constants, destroyed effects stay there for about 5 seconds. The death anim should play, but as it doesn't exist, the stand anim is played instead.

There is some trick around that I believe. It might involve Metamorphosis. I'm using it in my project, but can't remember the details right now.

how? add metamorphosis after attachment and remove or how?
(somehow i think the hide/show unit also dont work if this is a constant death animation thing :/)
 
I coded great item system for my project, attachment switching work instantly.
I can't share it sorry but idea is next.

In some setup function do next:
// Item Raw Code , Attachment Path
SaveItem ('I000', "war3mapImported\\SwordShort.mdx")

SaveItem function can look like this:
function SaveItem takes integer id, string s returns nothing
call SaveStr(hash, id, 0, s)

Then just check when unit equip or drop item and run function that will do next:
function LoadItem takes integer id returns nothing
local effect SFX = AddSpecialEffectTarget(LoadStr(hash, id,0),u,where)
call SaveEffectHandle(hash, id, 100, SFX)
or
function FlushItem takes integer id returns nothing
local effect SFX = LoadEffectHandle(hash, id, 100)
call DestroyEffect(SFX)

Sorry if this look a little strange, but I just showed you base idea, whole functions and other things are long and use much more than 1 or 2 variables.

note: this works fine even if you equip 2 swords for example, removing 1 will still keep 1 attachment there, so you don't need to care about it.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
^That doesn't really solve the issue. The issue is that models with no death animation will stay there for effect decay time, which is 5 seconds by default.

Models with proper death animation don't need this "fix".

Solution:

Create an ability based on Bear Form.
Normal Form: The unit type of your unit
Alternate Form: Can be any unit type. Use hero if your unit is hero.
Duration: 0
Check Dependencies: False

When you want to destroy the effect, use destroy effect action. Give the unit the ability and order it to use it. You don't have to give the abil to the unit in object editor.

Demo trigger:
  • Untitled Trigger 013
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Execution count of (This trigger)) mod 2) Equal to 1
        • Then - Actions
          • Set u = Villager (Male) 0026 <gen>
          • Special Effect - Create a special effect attached to the left hand of u using war3mapImported\sword.mdx
        • Else - Actions
          • Special Effect - Destroy (Last created special effect)
          • Unit - Add Bear Form effect to u
          • Unit - Order u to Night Elf Druid Of The Claw - Bear Form
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
somebody know why this error?

(its when i enable the libram ability generator trigger)

last time got problem with libram (but i think coz i changed to we) and when i turned back to jass new gen then when i enable the libram my all triggers stucked so i reimported but now the generator trigger dont work :/
 

Attachments

  • error.JPG
    error.JPG
    123.1 KB · Views: 47
That is a very odd error. It seems that it can't open your MPQ's, are they modified in any way? Do you have a retail version of warcraft 3?

Anyway, I suggest that you ignore using the generation trigger. Instead, you can just import them manually:

  • Disable the generation trigger.
  • Open the libram test map.
  • Open the object editor.
  • Click the abilities tab, and look for the "Page Up" ability. Copy that ability and paste it into your map with the rawcode Apup
  • Go back to the libram map, copy the "Page Down" ability and paste it into your map with the rawcode Apdn
  • If you aren't using the rawcodes 'Apup' and 'Apdn' for your abilities, then change the values of these globals accordingly. (to see the rawcode id of an object, press Ctrl + D in the object editor)
    JASS:
    static constant integer PAGE_UP   = 'Apup'
    static constant integer PAGE_DOWN = 'Apdn'
  • Go back to the libram map, and click the Items tab. Find the item, "Page Up" and copy and paste it into your map with the rawcode Ipup
  • Go back to the libram map again, and copy and paste the item "Page Down" with the rawcode Ipdn
  • Once again, if you aren't using the rawcodes I've told you to use, then you can simply change these fields accordingly:
    JASS:
    static constant integer PAGE_UP_ITEM           = 'Ipup'
    static constant integer PAGE_DOWN_ITEM         = 'Ipdn'
  • After that, you are done importing! Just change these globals to whatever types you want enabled. If you don't want one feature enabled, then you can set that field to false instead of true.
    JASS:
        globals
            public  constant boolean ENABLE_KEY_SHIFT     = true
            public  constant boolean ENABLE_ABILITY_SHIFT = true
            public  constant boolean ENABLE_ITEM_SHIFT    = true
        endglobals
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
thx u


1.next question is how to use unit on my map what is higher level than 20? i tryed edit neutral hostile&player unit in object editor and set level to 100 but in game when i check it is lv20

2.i can make global aura? (example 1 unit use a aura and get every unit in his team on whole map)
if yes its laggy co of huge range?
(i thought to difficulty system, example in hard mode give +attack speed to every neutral hostile unit but i dont want give ability each time when they respawn or created)
 
Status
Not open for further replies.
Top