Converting Name of Item-Type to string

2evil

New Member
Reaction score
16
I can find the function to convert the name of a specific item to a sting, but i need to find a way to convert an item-type

I have an array of item-type variables and need to display which one is in which slot for my reference, a debugging tool
 
M

Mythic Fr0st

Guest
hmm

Like this??

Code:
Item
    Events
        Player - Player 1 (Red) skips a cinematic sequence
    Conditions
    Actions
        Unit Group - Pick every unit in (Units owned by (Triggering player) of type Footman) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has an item of type Tome of Experience) Equal to True
                    Then - Actions
                        Game - Display to (All players) the text: (Name of (Item carried by (Picked unit) of type Tome of Experience))
                    Else - Actions

or like this?

Code:
Item
    Events
        Player - Player 1 (Red) skips a cinematic sequence
    Conditions
    Actions
        Unit Group - Pick every unit in (Units owned by (Triggering player) of type Footman) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has (Item carried by (Last created unit) in slot 1)) Equal to True
                        ((Picked unit) has (Item carried by (Last created unit) in slot 2)) Equal to True
                        ((Picked unit) has (Item carried by (Last created unit) in slot 3)) Equal to True
                        ((Picked unit) has (Item carried by (Last created unit) in slot 4)) Equal to True
                        ((Picked unit) has (Item carried by (Last created unit) in slot 5)) Equal to True
                        ((Picked unit) has (Item carried by (Last created unit) in slot 6)) Equal to True
                    Then - Actions
                        Game - Display to (All players) the text: (Name of (Item carried by (Picked unit) of type Tome of Experience))
                    Else - Actions


Or like this?(below is WEU function)

Item
Events
Code:
        Player - Player 1 (Red) skips a cinematic sequence
    Conditions
    Actions
        Unit Group - Pick every unit in (Units owned by (Triggering player) of type Footman) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Is item (Item carried by (Picked unit) of type Tome of Experience) in the inventory of a hero) Equal to True
                    Then - Actions
                        Game - Display to (All players) the text: (Name of (Item carried by (Picked unit) of type Tome of Experience))
                    Else - Actions

or like this?

Code:
Item
    Events
        Player - Player 1 (Red) skips a cinematic sequence
    Conditions
    Actions
        Unit Group - Pick every unit in (Units owned by (Triggering player) of type Footman) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has (1th item of Type Claws of Attack +15 carried by (Picked unit))) Equal to True
                    Then - Actions
                        Game - Display to (All players) the text: (Name of (Item carried by (Picked unit) of type Tome of Experience))
                    Else - Actions

Just thought i'd throw a bunch out there, see if any are what you are meaning?

uhh note, the second trigger its suppost to be "Picked unit has an item type of tome of experience in picked player slot" not last created unit lolz
 

2evil

New Member
Reaction score
16
to clarify (thanks for the examples :D)

i want to do this
game - display to [all players] (name of item-type(Items[integer a]))

items is a unit-type variable, array
 
M

Mythic Fr0st

Guest
Xd

Hmmph

This works
Code:
Hmph
    Events
        Unit - A unit Acquires an item
    Conditions
    Actions
        Set ItemCount = (ItemCount + 1)
        Set Item[ItemCount] = (Item being manipulated)
        For each (Integer A) from 0 to (ItemCount + 1), do (Actions)
            Loop - Actions
                Game - Display to (All players) the text: (Name of Item[(Integer A)])
        Set ItemCount = 0

Item is a item array size 8170 lol...
Item count is an integer
Change the event to what you want, I think its a pretty cool idea XD
 

2evil

New Member
Reaction score
16
ill tell you the complete application :(

its for a debugging multiboard (i shouldn't be having problems with debug code, eh? lol) that lets me see whats in each slot of a item-type array variable, not simple item variable. Cause if it was my life would be a lot easier :D

i use the item-type variable because i also have another array defining how many of each item-type there is stored and its easier to create an item of item type (varialbe slot x) from my experience
 
M

Mythic Fr0st

Guest
uhm

Uhm, I dont know what debugging a multiboard is Lolz, However I took a crack at writing you a code for dropping items, (it may be an annoyance, but its something to fall back on, if you cant get ur thing working, if I understand right)

Oh btw, I tried changing check to a boolean, some reason It doesnt work

Code:
Hmph
    Events
        Unit - A unit Acquires an item
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
            Then - Actions
                Set Items[0] = (Items[0] + 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Items[0] Greater than or equal to 2
                    Then - Actions
                        Set Check = 1
                        Hero - Drop (Item being manipulated) from (Hero manipulating item)
                        Game - Display to (All players) the text: ((Name of (Item being manipulated)) +  is already in your inventory)
                        Set Items[0] = (Items[0] - 1)
                        Set Check = 0
                    Else - Actions
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Item-type of (Item being manipulated)) Equal to Orb of Frost
            Then - Actions
                Set Items[1] = (Items[1] + 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Items[1] Greater than or equal to 2
                    Then - Actions
                        Set Check_2 = 1
                        Hero - Drop (Item being manipulated) from (Hero manipulating item)
                        Game - Display to (All players) the text: ((Name of (Item being manipulated)) +  is already in your inventory)
                        Set Items[1] = (Items[1] - 1)
                        Set Check_2 = 0
                    Else - Actions
            Else - Actions

Code:
Hmph2
    Events
        Unit - A unit Loses an item
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
                Check Not equal to 1
            Then - Actions
                Set Items[0] = 0
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Check_2 Not equal to 1
                (Item-type of (Item being manipulated)) Equal to Orb of Frost
            Then - Actions
                Set Items[1] = 0
            Else - Actions

Well, Good luck with what you are doing
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Custom script: set udg_Name = GetObjectName( udg_Items[ bj_forLoopAIndex ] )
Game - Display to (All players) the text: Name


With "Name" being a variable of type "String".
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top