• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Pleaseeee help me import this Equipment system :(

Status
Not open for further replies.
Level 5
Joined
Feb 13, 2019
Messages
128
Equipment v2.5.2

I am having such a hard time importing and setting this system up, I'm very new to JASS and really could use some pointers here :(.


I understand that you need to copy the world editor information into your map (Units. abilities, etc.)

I guess it's mostly the JASS in the libraries that has me confused.. D:

I'm attempting and trying just if anyone feels generous and wants to help a JASS noob I'd reallllllly appreciate it..
 
Level 5
Joined
Feb 13, 2019
Messages
128
So this part I feel like isn't doing me any favors,
JASS:
    private function Initialize takes nothing returns nothing
        local unit demon = CreateUnit(Player(0), 'Edem', -14450, 13612, 0)
        local unit test  = CreateUnit(Player(0), 'H001', -14450, 13612, 0)
        call CreateEquipment(test)
        call CreateEquipment(demon)
      
        //*  Except for the village 255 animations model,
        //* Animationtags can mess with your models.
        //* You can disable this feature for a unit via:
        call EquipmentEnableAnimationTags(demon, false)
      
        //*  The demo map includes ItemPower and ItemSet,
        //* to show what can Equipment do.
        call CreateUnitItemPower(demon)
        call CreateUnitItemPower(test)
        call SetHeroLevel(demon, 10, false)
    endfunction
endscope

halpp.png

It spawns the test units but up here in the water lol.

Do I need to create units to apply the Equipment spell or can I just

--------- 4) How to initialize Equipment (4 ---------
call CreateEquipment ( unit )

The (unit) part has me a little tripped up... :(
Can I just put a units name as it is in Object Editor?

Example: "dat tank boi" or do I need some kind of ID?



I think this is my issue I'm not sure what to do here.

f). Make sure that all the adjustable variables in the setup part fit your map.



UPDATE:

So when I first set it up the units the trigger spawned had the "Slow ability" on the bottom left (which is not where or what the icon should have been)

So I assumed it was conflicting with another system, or trigger, something of the sort, and made a new map and it worked!!





I'd still love some insight into if possibly I had conflicting Base Id's or something like that?


So really all I need to know now is:


JASS:
    private function Initialize takes nothing returns nothing
        local unit demon = CreateUnit(Player(0), 'Edem', -14450, 13612, 0)
        local unit test  = CreateUnit(Player(0), 'H001', -14450, 13612, 0)
        call CreateEquipment(test)
        call CreateEquipment(demon)
      
        //*  Except for the village 255 animations model,
        //* Animationtags can mess with your models.
        //* You can disable this feature for a unit via:
        call EquipmentEnableAnimationTags(demon, false)
      
        //*  The demo map includes ItemPower and ItemSet,
        //* to show what can Equipment do.
        call CreateUnitItemPower(demon)
        call CreateUnitItemPower(test)
        call SetHeroLevel(demon, 10, false)
    endfunction
endscope


Is there a way to just set this up to go to player1's /2/3/4/5/6/.....'s only unit (like every player has 1 unit) so I don't need this trigger creating units at certain points?
 
Last edited:
call CreateEquipment(test)

^let's take this code line as example. What is interesting is..
  1. the function name - CreateEquipment
  2. the passing argument(s) - test
.. so it calls the function CreateEquipment, with passing the unit variable test.

You can replace the argument with your own unit value, instead of taking the created unit from above.
For example when your GUI variable for the players is named Hero[], so Hero[1] is for Player1 for example, then the code would look like this:

call CreateEquipment(udg_Hero[1])

So we simply replaced the passed argument. But notice the "udg_" prefix before the GUI variable name - this is simple a prefix always to use when working with GUI varibales in JASS.
Run all needed functions for the player heroes, and they should be registered correctly. And ensure this happens at a point when the Hero[] variable already holds correct values to the player heroes, so are really assigned already.
 
Status
Not open for further replies.
Top