SC2Mapster Forums

Development > Data

Link charges between items and ability?

  • 15 posts
    #1 Feb 05, 2013 at 07:14 UTC - 0 likes

    I have a Throw grenade ability similar to the Raynor - Toss Grenade ability. I also have grenades that you can pick up and place in your inventory, as a compromise to the inability to bypass inventory hotkeys i wanted to add a ability that does the same exact thing as the item, but it can have ahotkey since its a ability. I want this ability to have the same charge count you would the grenade items. And upon usade a grenade item would be removed. The max charge stack count for the grnade item is 1, while the ability has a max charge of 10. At first i thought i could simply make the charge links between the ability and the item the same, and it would work. This method doesnt not raise the ability's charge count so im stuck.

    #2 Feb 05, 2013 at 17:36 UTC - 0 likes

    Why can't you just copy the pickups from the campaign? Or the Vulture ability to replace spider mines, which iirc uses a Modify Unit effect to restore charges.

    #3 Feb 05, 2013 at 21:36 UTC - 0 likes

    Im pretty sure that if i did that, the picked up item would vanish and i want players to be able to give grenades to other units or other players.

    #4 Feb 05, 2013 at 23:37 UTC - 0 likes

    Last week i played a custom game called "The Thing -Revival-", and i remember that you can collect grenade and they stay in your inventory while also enabling a abiliity that does the same thing and when you use the ability the grenade gets removed. I tried doign this via triggers once but i cant search the inventory for a specific item and remove it(or at least to my knowledge).

    #5 Feb 06, 2013 at 04:02 UTC - 0 likes

    I shall share some nice stuff with you. Create a new trigger, in it for the event have it be unit uses ability, whatever ability you want the item for.
    Make a unit group variable for my purposes I'm calling it Item group
    and another variable called item and is a unit variable
    and actions like this

    Add all units in region circle( position of triggering unit, .2) matching required: item excluded: ally, enemy, neutral to item group
    For each item in item group
    if unit type of item= Whatever item is required
    then
    remove item
    skip remaining actions
    else

    There you go

    Last edited Feb 06, 2013 by willuwontu

    I'm a triggerer
    I can't make awesome terrains
    I dabble in data

    I suck at poems
    That is why i do haiku
    i suck at them too :(

    #6 Feb 06, 2013 at 05:28 UTC - 0 likes

    well it isnt working :/

    could you lay out the trigger more clearly? like make the trigger and show me a screenshot.

    Last edited Feb 06, 2013 by Project_06
    #7 Feb 06, 2013 at 14:22 UTC - 0 likes

    @Project_06: Go

    How about making the ability apply an Issue Order effect to use the item?

    #8 Feb 06, 2013 at 20:19 UTC - 0 likes

    @Photoloss: Go

    Hmm interesting idea Photoloss ill check that out, the only problem there might be is if it can find the item, because my inventory ability have 6 slots, 2 can hold a grenade and one slot opens a container that can hold 8.

    AFTER CHECKING THIS METHOD: Well the issue order doesnt seem to have anything on using items, because the grenade item doesnt use a ability, it uses a launch missile effect.

    Last edited Feb 06, 2013 by Project_06
    #9 Feb 07, 2013 at 05:10 UTC - 0 likes

    Hmm, I sent you a pm with an example, Some of the triggers are broken cause i removed stuff, but it's enough to give you the general idea.

    Name Size MD5
    Grenade_test_map.SC2Map 717.1 KiB 048a919dab78...
    #10 Feb 07, 2013 at 05:23 UTC - 0 likes

    Sweet baby jesus, this is very complex plus your method looks like it's 100% triggers, and im trying to keep it in data. A few triggers is okay but custom functions and things like that seems excessive plus it doesnt look like it works for a map with multiple players. Unless it IS in data and i dont see it because this map has alot of stuff in it already.

    #11 Feb 07, 2013 at 05:55 UTC - 0 likes

    The items and abilities are in data. it works for multiple people, I've heavily tested this. You probably can't find the data stuff cause i left a lot of the data in there.

    #12 Feb 07, 2013 at 06:02 UTC - 0 likes

    Well i figured that the items and abilities would be there but it looks like the mechanics of this are needlessly complicated. I dont want to simply copy/paste the data and trigger i need because i already have data that must stay in or else i would lose track of it and get confused. Plus i dont know what to plug in for the broken triggers.

    #13 Feb 07, 2013 at 06:11 UTC - 0 likes

    It will only work if you know what unit that player has and if they only have one unit. You need to plug-in the unit. And that would be it. I would recommend you just put a marine on the map give him a grenade and have him use it. The ability will work and it will give you an idea of what I did. Then you should create it "cleaner" for your map, but don't copy paste because you won't learn from just doing that. Look at my coding and figure it out. mess with it. *gnight i'll check this post in the morning*

    Last edited Feb 07, 2013 by willuwontu
    #14 Feb 07, 2013 at 06:14 UTC - 0 likes

    Well when you say "if they only have one unit" then this method wont work, because the number of units each player has varies, they start with 4 units and can make structures. Quick question: Why wont simply linking the two charge id's work? Arent charge links for this exact purpose? Otherwise if charge links only interacted with itself then they wouldnt be nessecary.

    Last edited Feb 07, 2013 by Project_06
    #15 Feb 07, 2013 at 13:05 UTC - 0 likes

    It might, I remember seeing something by trenchaunt with what you are looking for. Here it is I hope that is useful. also you could change it so it works with more that one unit my way i have my grenades activated causes my to be only able to do it for one unit.

    Last edited Feb 07, 2013 by willuwontu
  • 15 posts

You must login to post a comment. Don't have an account? Register to get one!