Selectable Upgrades

Discussion in 'StarCraft 2 Maps, Replays, Modding' started by DoSrsCa88, Dec 29, 2011.

Selectable Upgrades

  1. DoSrsCa88

    DoSrsCa88 New Member

    Joined:
    May 29, 2010
    Messages:
    162
    Likes received:
    0
    Trophy points:
    0
    I want to before my map starts to create a box with with the upgrades from the campaign and give player 1 the opportunity to select 10 of these upgrades.

    would this be done through the dialogue option?
     
  2. EatMeReturns

    EatMeReturns Happy Mapper Moderator

    Joined:
    Jun 28, 2007
    Messages:
    1,731
    Likes received:
    11
    Trophy points:
    38
    From:
    Albuquerque, New Mexico
    If you want a custom dialogue box, then yes: create a custom dialogue menu. If you want it to occur through the normal action locations in the bottom right, use upgrade buttons and abilities.
     
  3. DoSrsCa88

    DoSrsCa88 New Member

    Joined:
    May 29, 2010
    Messages:
    162
    Likes received:
    0
    Trophy points:
    0
    You know in the SC2 campaign when on the Hyperion between mission you can go to the bar. And in the bar there is a laptop on a table and you can click on it. When you do you go to a large box with the selection of mercenaries you can hire. Or when you are in the lab and you click on the terminal you bring up the research options in a box, is that done using dialogue or something else? Just curious.
     
  4. EatMeReturns

    EatMeReturns Happy Mapper Moderator

    Joined:
    Jun 28, 2007
    Messages:
    1,731
    Likes received:
    11
    Trophy points:
    38
    From:
    Albuquerque, New Mexico
    Well, first of all, that's done using story mode. I know little to nothing about the campaign's mechanics. I would assume some sort of dialogue system is used, but I've never messed around with story mode.
     
  5. DoSrsCa88

    DoSrsCa88 New Member

    Joined:
    May 29, 2010
    Messages:
    162
    Likes received:
    0
    Trophy points:
    0
    I don't really want to go into the campaign/story stuff at this stage. Anyway that is the sort of thing I am after with the dialogue boxes. I will just use the dialogue mechanism and hope to achieve something similar in looks.
     
    Last edited: Dec 31, 2011
  6. EatMeReturns

    EatMeReturns Happy Mapper Moderator

    Joined:
    Jun 28, 2007
    Messages:
    1,731
    Likes received:
    11
    Trophy points:
    38
    From:
    Albuquerque, New Mexico
    I like to think I'm pretty good with the dialogue system. I have a video of my best dialogue work somewhere...
     
  7. DoSrsCa88

    DoSrsCa88 New Member

    Joined:
    May 29, 2010
    Messages:
    162
    Likes received:
    0
    Trophy points:
    0
    I am almost done with my dialog system. There is only one thing I am still thinking how to do. I have 10 upgrades but I only want player 1 to be able to select 5 of them and then the dialog box closes. Can this be done with a switch? I've seen many dialog examples where people use switches for the actions of the buttons but I am not sure if it will work in my case. Some advice please?
     
  8. EatMeReturns

    EatMeReturns Happy Mapper Moderator

    Joined:
    Jun 28, 2007
    Messages:
    1,731
    Likes received:
    11
    Trophy points:
    38
    From:
    Albuquerque, New Mexico
    You have a variable called upgradescounter, and you initialize it to the value 5. Whenever P1 selects an upgrade, decrease upgradecounter by 1. Afterward, check if upgradecounter == 0. If it is, close the upgrade dialog.
     
  9. DoSrsCa88

    DoSrsCa88 New Member

    Joined:
    May 29, 2010
    Messages:
    162
    Likes received:
    0
    Trophy points:
    0
    I have almost finished my dialog now. Everything is positioned right inside the box and all the buttons and images are made and are showing. I have created the two triggers for the dialog. One for the pick upgrade buttons and the other for closing when 5 upgrades are selected. The problem is it is not closing after I pick 5 items. It just stays open.
     
  10. EatMeReturns

    EatMeReturns Happy Mapper Moderator

    Joined:
    Jun 28, 2007
    Messages:
    1,731
    Likes received:
    11
    Trophy points:
    38
    From:
    Albuquerque, New Mexico
    I would have to see your triggering.
     
  11. DoSrsCa88

    DoSrsCa88 New Member

    Joined:
    May 29, 2010
    Messages:
    162
    Likes received:
    0
    Trophy points:
    0
    The first trigger is the one that has the switch in it with the cases for selecting the buttons along with some conditions. I didn't put a default option cause of the second trigger I made. I didn't think I needed one.

    The second trigger is the one for closing the dialog after 5 upgrades. It starts on the event any dialog item is clicked by player 1. It has the condition to run if the upgrades counter variable is greater than 0. The action is an if else statement saying that if upgrades counter variable is greater than 0 then modify upgrades counter by -1 else hide last created dialog for all players.
     
  12. EatMeReturns

    EatMeReturns Happy Mapper Moderator

    Joined:
    Jun 28, 2007
    Messages:
    1,731
    Likes received:
    11
    Trophy points:
    38
    From:
    Albuquerque, New Mexico
    Instead, give the second trigger no Event. Then, for the trigger with all of the switch cases, add the action "Run Trigger SECOND TRIGGER" after each successful upgrade purchase.
     
  13. DoSrsCa88

    DoSrsCa88 New Member

    Joined:
    May 29, 2010
    Messages:
    162
    Likes received:
    0
    Trophy points:
    0
    Still didn't work. I added the run second trigger to each case in the switch in the first trigger and got rid of the event in the second trigger as well.
     
  14. EatMeReturns

    EatMeReturns Happy Mapper Moderator

    Joined:
    Jun 28, 2007
    Messages:
    1,731
    Likes received:
    11
    Trophy points:
    38
    From:
    Albuquerque, New Mexico
    Do you have your exact code, then? It could be a condition not working, the close dialog action not working...
     
  15. DoSrsCa88

    DoSrsCa88 New Member

    Joined:
    May 29, 2010
    Messages:
    162
    Likes received:
    0
    Trophy points:
    0
    I found the problem, it was a condition. So that takes care of that. One thing I want to check is whether the units gets the upgrades I select. Is Tech Tree the right category and would allow/disallow upgrade for player be the right chose? Is there something else I need to add in the switch statement cause the units show no sign of the chosen 5 upgrades working in game?
     
  16. EatMeReturns

    EatMeReturns Happy Mapper Moderator

    Joined:
    Jun 28, 2007
    Messages:
    1,731
    Likes received:
    11
    Trophy points:
    38
    From:
    Albuquerque, New Mexico
    I think Allow/Disallow simply makes it so that a player has the capacity to attain the upgrade, but does not explicitly grant the upgrade.
     
  17. DoSrsCa88

    DoSrsCa88 New Member

    Joined:
    May 29, 2010
    Messages:
    162
    Likes received:
    0
    Trophy points:
    0
    Would apply campaign tech under story mode category fix the issue? I don't know what else to choose. There is nothing under the unit category which I can see that would be of any help. There are only things for allowing/disallowing and enabling and disabling upgrades, abilities and behaviors and adding upgrade levels in the tech tree category.
     
  18. EatMeReturns

    EatMeReturns Happy Mapper Moderator

    Joined:
    Jun 28, 2007
    Messages:
    1,731
    Likes received:
    11
    Trophy points:
    38
    From:
    Albuquerque, New Mexico
    You can try add upgrade level. I got it to work by using behaviors and adding behaviors to units.