• 0

    posted a message on How to convert a preset VARIABLE to string?
    Quote from DeltaV: Go

    Or, you could make a custom function that converts any of your integer preset values into a string

    I'm pretty sure I use the int-translated version somewhere in my code (too lazy to look for it), and this is pretty easy/quick/straight-forward, so I'm gonna do this. Thanks for the help both of you!

    Posted in: Triggers
  • 0

    posted a message on How to convert a preset VARIABLE to string?

    I have a custom preset type called Armor Type, with values No Value, Helm, Shoulders, Chest, Legs, and Boots. I'm trying to convert a specific item (variable)'s value of this preset to a string value, but I can't figure out how. I can convert the VALUES to string, but when i go to the Variables tab, it's empty :/

    Posted in: Triggers
  • 0

    posted a message on Is it possible to make your own variable type?
    Quote from hobbidude: Go

    What your actually looking for is a preset; not a record which is basically a variable inside of variable. A preset will allow you to set the options of your own variable.

    Perfect! Thank you very much :)

    Posted in: Triggers
  • 0

    posted a message on How to set up item drops?

    Thanks for the help guys! I just spent a good 3 hours detailing all the item stats, generating them properly, name banks, blah blah blah.. However theres still a couple things I need help with.

    Right now, every time an item "unit" (the Point Defense drone in the pic in OP) is created, an item is now generated as follows: -I have a Record for Armor type items, with all the related stats they might have, as well as a record for Weapons, and "Other" items (but just the armor one is done for now) -I have a Variable referring to that record, in the form of an array of size 1000 (simply because I don't think we can do ArrayLists in sc2mapmaker, and I doubt they'll have 1,000 not-picked-up armor items on the ground at once) -When a new item is generated, it is set to the Record Variable (the array), at the index of CurrNumArmorPiecesOnGround, and CurrNumArmorPiecesOnGround is incremented. -So when all of the stats in the record are filled, the first stat filled is a variable of type Unit, that is set to the item "unit" (point defense drone) that is created when the player kills an enemy and the item first drops.

    MY PROBLEM: My trigger to show the item pickup window is when the player enters within a distance of a unit of type itemUnit, and I need to update the info in that window for the triggering unit's item stats. However I don't know how to do this, because afaik, I can't get the index in the array that this item belongs to. I could also assign a value to the unit itself equal to the index number when it is first assigned, but as far as I know, I can't just assign an int value to a specific unit in the map.

    So how can I do get the item stats from the triggering unit?

    Posted in: Triggers
  • 0

    posted a message on Is it possible to make your own variable type?

    It would be incredibly useful in some situations. For example, I'm working on an RPG, and it would be REALLY convenient to make an "Armor Type" var type that acts like a boolean, but rather than True or False, it can be set to Helm, Shoulders, Chest, Legs, or Feet (only one). This would cut down on possible errors that I know will arise when I use a String var Armor Type :/

    Posted in: Triggers
  • 0

    posted a message on Dialog item gif-like animation

    When you say a gif animation, I think of using several still images that connect one after another, shown in rapid succession like a flip book. However I'm a programmer, not an animator, so if that's not what you're looking for, disregard this...

    If it IS what you meant: Why not just make a custom function playAnim or whatever you wanna name it that sets the dialog item (image type) to the first image in animation, wait x seconds, set image to 2nd image in animation, wait x seconds, set image to 3rd image in animation, and so on and so on, til the whole animation plays?

    Hope this helps, and good luck! :)

    Posted in: Triggers
  • 0

    posted a message on How to set up item drops?

    My game is a 3rd person RPG. Currently, whenever a player kills an enemy, an item drops. The item looks like a small Point Defense Drone unit (brought down to ground level). When the player approaches the unit, a window pops up that shows an image corresponding to the type of item that dropped, and its stats. Even if the player is within range of multiple items, only one item window will show at a time. If you still want more clarity on how my game works, here's a picture: Item Drops

    Now, I know how to calculate chances for all of the different varying aspects, like the item type, its stats, etc. What I need your help with is figuring out how to SAVE these stats to the point defense drone "unit" so that every time I leave the radius of the item drop and come back later, the same stats will show. I'll probably also utilize this same method, whatever it turns out to be, to save these item stats for items that players equip and/or place in their inventory.

    If this were a standard programming language, I'd just make an item class, but as far as I'm aware, we can't do anything like new variable types, objects, etc without going directly into the sc2 code itself, which I don't want to attempt.

    Thanks for any and all help! I do appreciate it :) And if you need any more context, just let me know

    Posted in: Triggers
  • To post a comment, please or register a new account.