• 0

    posted a message on Attaching Extra Models To Unit (Data Editor)

    @Amaroqwlf:

    Doesn't seem to do it - the extra model still doesn't grab clicks on the unit :-/

    I think you've got me going in the right direction, though. Terran building construction seems to do this, but I can't quite piece together the how.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Attaching Extra Models To Unit (Data Editor)

    Edit: mispost, but good excuse for a bump.

    Posted in: Miscellaneous Development
  • 0

    posted a message on ...anyone know how to make the life bar over a unit disappear?

    @BrotherLaz: Go

    I'm at work so I can't point you exactly to the right field, but on the unit's actor there should be a "status bar flags" field that lets you turn on the various bars (health, shields, progress, etc) - just uncheck everything you don't want

    Posted in: Miscellaneous Development
  • 0

    posted a message on Attaching Extra Models To Unit (Data Editor)

    Hmm, I can't get it to work by tweaking just those values :-/ Mind taking a look at a test map?

    The visual indicator for the selection resizes properly, but the area that you can click on still seems constrained to the model proper. The start point really highlights this, as only the "pin" portion of it seems selectable. (where's /that/ defined? as part of the model?)

    Posted in: Miscellaneous Development
  • 0

    posted a message on Attaching Extra Models To Unit (Data Editor)

    Note: This is a repost of my thread over on the battle.net forums to get some extra exposure.

    I'm trying to attach additional models to a unit, and have them act as part of the unit (mostly, I want to be able to select the unit by clicking on an additional model). Secondly, I'm looking for a way to do this entirely in the data editor so the extra models show up in the terrain editor, and not just in game.

    Here's how I'm currently attaching the additional model:

    The model is defined as an actor of type Model (with a parent of CActorModel):

    • The Subject field of "Hosting - Host +" is set to "Selectable". "_Unit" also works. _I'm not sure what this is defining.
    • The Operations field of "Hosting - Host Site Operations +" is set to SOpAttachOrigin.

    The unit's actor is defined in a regular manner, except I add the following event:

    • ActorCreation
      • Create NameOfExtraModel

    Alternatively, you can also skip the event on the unit and have a UnitBirth.UnitName: Create event on the extra model.

    This is all fine and dandy, and I've got the extra model scaled/tweaked to look nice when attached to the unit, but the problem is that I can't select the unit when clicking on the extra model. One last thing I also am trying to achieve: I've got this extra model attached in the same way to several units, and I'd like to be able to just reference it in the main unit actor rather than duplicating it for each unit.

    Anyone have some pointers?

    Posted in: Miscellaneous Development
  • 0

    posted a message on Passing a dynamic amount of a parameter.

    @JamesObscura: Go

    I agree with Whiskee - breaking it into a small functional component like that makes a lot of sense for most cases. Is there something in your use where breaking the actions apart doesn't work as cleanly?

    If that doesn't cut it, you could use the local data table (only valid for current thread) to pass it around - similar to how Pick <Player/Unit> and Get Picked <Player/Unit> work, but in the reverse. Maybe pass a prefix to the receiving end to keep it clean.

    For Ex:

    string prefix = "PassedRegions/"
    
    DataTableSetInt(false, prefix + "#", <<number of regions>>);
    DataTableSetRegion(false, prefix + "0", <<region>>);
    DataTableSetRegion(false, prefix + "1", <<region>>);
    DataTableSetRegion(false, prefix + "2", <<region>>);
    ...
    

    and then just grab the count and iterate over the result on the receiving end

    Posted in: Miscellaneous Development
  • 0

    posted a message on Insight on Lives/Regions/Respawns(Solved)

    From what I understand, you want the zerglings to respawn where they die (or at some random point near their point of death?)

    Take a look at the attached map - you can do that without regions, mostly by grabbing all the values you want out of the unit/player before your wait action

    Posted in: Miscellaneous Development
  • 0

    posted a message on leaderboard question

    Give "Enable/Disable Leaderboard State" a whirl. It's got a "Showing" state that you can turn on/off - I'm guessing that it'll do what you want (haven't tried)

    Posted in: Miscellaneous Development
  • 0

    posted a message on Moving Mini map

    @Squeegeez: Go

    I think the secret will be overriding the SC2Layout files defined in Core.SC2Mod, if the game even allows us to.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Initial Starting view = starting point?

    @Etravex: Go

    You need to create a trigger that iterates through each active player and pan the camera to their start point (instantly). The game only does it by default as part of the standard melee triggers, once you override those, you need to do it yourself :)

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Need] Item functions/events/conditions
    Quote from Echtank: Go

    @BeLugh: Go

    It's not a very good solution, but to get a event based off a item being used I gave all possible units that could use the item a hidden dummy ability. Then made the item's effect itself issue a order to use said ability, which let me use the "Unit uses a ability" event. Its crappy, but it works for now.

    Did you have to give the unit your dummy ability as well, or do items grant the unit that ability?

    Posted in: Miscellaneous Development
  • 0

    posted a message on Regions and Mem Leaks

    Yeh, SC2 uses a garbage collector. So while you shouldn't see "memory leaks", you still need to be aware that keeping references around to values will cause them to stay in memory. Rule of thumb, never use global variables or store stuff in the data table unless you really, really need to.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Overriding SC2Layout/etc in Maps/Mods

    I've been playing a bit with overriding UI layouts and whatnot as part of a given map (not directly modifying the core mods) - no luck so far. Has anyone found methods for doing so, or is this something that's likely off limits?

    Posted in: Miscellaneous Development
  • 0

    posted a message on Displaying Time of Day?
    Quote from Prancer: Go

    One thing you may want to change is the "Grammar Text" entry. Just leave the "User Default Grammar Text" enabled and it will allow you to use the nice hyper-link method of inserting parameters in your triggers.

    If you do override the grammar text like I did, you can highlight words/passages and choose a variable that they link to (dropdown at the bottom of the window) - makes it a bit easier to read for some functions/actions :)

    Posted in: Miscellaneous Development
  • 0

    posted a message on Displaying Time of Day?

    The Time Of Day type is just a string internally (with the xx:xx:xx format). You can use the following function to convert it:

    Convert Time Of Day To String
        Options: Function
        Return Type: String
        Parameters
            Time Of Day = 00:00:00 <Time Of Day>
        Grammar Text: convert Time Of Day to string
        Hint Text: Converts a time of day value to a string.
        Custom Script Code
        Local Variables
        Actions
            General - Return lp_timeOfDay
    

    Note that the return action is returning a custom script value to force the "cast". (parameters are prefixed with lp_ - if you change the name of the parameter, make sure you change the return value accordingly.)

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