Dynamically placed buttons

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
Okay, dynamically might be the wrong word. Here's what I am trying to do:

A unit has an inventory. The items can give abilities that only show up if you have the item. The problem is that there will be a lot of items, more than there are slots on the command card so a button has to be able to appear in several places.

Now I could do this in several ways but all ways I can think of are incredibly messy and takes a lot of extra work.

First of all, I'm pretty sure I have to add the button of all abilities to all slots where they can appear. I then have to make sure I only show one of the buttons of the same abilities and only if the unit has that item.

If anyone could think up a good solution for this, I'd be grateful.

If you have a solution that includes triggers, that's fine too but I prefer data.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
have you considered making dialog buttons and positioning them correctly to simulate buttons? that way you could move them arround as you please
 

Kyuft

Member
Reaction score
11
Wait... that's not normal?
And Siretu, you will probably have to do something with triggers and custom functions. Something like,
If
That slot on the card is not full,
then put it there
else,
put it somewhere else.

-Kyuft:shades:
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
I am usually very good at finding the answer myself so I rarely ask for help.

The problem with doing this with triggers(if I don't do it with dialogs as GFreak suggested, which by the way is a solution but it's not a good one) is that there's no way that I know of to interact with the command card with triggers.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
???
you mean you cant use the command card natives?
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
the trigger actions dealing with command cards, ie: Disable Command Card, etc.
 

Kyuft

Member
Reaction score
11
If i remember correctly, there is a few command card actions. However, I cannot remember where i saw them.

-Kyuft:shades:
 

Dave312

Censored for your safe viewing
Reaction score
269
the trigger actions dealing with command cards, ie: Disable Command Card, etc.

I think you may be thinking of Enable/Disable Command Type which is used for disabling ability commands. I recall no functions/actions that deal directly with the command card.
 

Jokker

Member
Reaction score
16
Depends on how many abilities there are...
If you don't want to mess around with buttons at all, you could add a hotkey in item description, so it would be activated with hotkeys only.
 

Dave312

Censored for your safe viewing
Reaction score
269
Have you tried using the Catalog function to set the positions of the buttons? That would probably be the easiest way of doing it (if it works).
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
I actually thought of using the catalog functions yesterday and spent a lot of time yesterday trying to get it to work and I didn't want to post about it until I was sure it'd work.

From my testings, it seems like moving the positions of buttons is not allowed(since catalog field value set has some fields it can't set because they're protected). What I did instead was to have 6 dummy buttons and 6 dummy abilities. One for each slot. I can then keep track of which items the unit has and change the name and description of the dummy abilities to reflect that.

This works as of now. If I have 3 of item A and 3 of item B, I'll get one button(not 3) for ability A and one button for ability B.

There are still some problems though that I think I can solve but which will take some time. Right now, the dummy abilities are all of the type "Effect - instant". I need some abilities to be "Effect - Target". I can't change the type so I probably need to have 6 more abilities and switch between them. There's also the problem that my "Effect - target" abilities can either have a unit target or a point target and I wasn't able to change between the two with catalog set. This means I'll probably need 6 more abilities(18 in total, sigh). Fortunately, it's still just a constant amount of work and adding a new item wont be a ton of work when the initial work is done.

There's one final thing I also have to do, I have to make a dialog overlay with images for the buttons since unfortunately, "Catalog field value set" can't modify the icon of a button so I'll just skip the icon for the button and do it with dialogs.

The reason I cant do the entire thing in dialogs is that some abilities require targeting and if I press an ability that requires a target, I can't by triggers get it to enter the targeting mode. I could fake it and overlay a picture of a target cursor on the cursor and change everything but that'd be stupid.
 

Dave312

Censored for your safe viewing
Reaction score
269
There's one final thing I also have to do, I have to make a dialog overlay with images for the buttons since unfortunately, "Catalog field value set" can't modify the icon of a button so I'll just skip the icon for the button and do it with dialogs.

What about using the Command Card: Level Button Image property on the dummy abilities to set the button image and setting the ability level to 2? With any luck you will have access to that.

Sounds like no matter which way you do it, it is going to be a lot of work. I wonder whether it might just be easier to scrap the command card and use an inventory to act as one instead.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top