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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top