• 0

    posted a message on Worker that most recently dropped off minerals/gas

    Found the solution!

    With the help of another thread on this, and some playing around, I figured out what to do for anyone who wants to replicate this effect.

    Events
            Unit - Any Unit uses Probe - Return Cargo at Harvest7 - Drop Off stage (Ignore shared abilities)
    Conditions
            Resource Count[(Triggering player)][Minerals] < (Player (Triggering player) Minerals)
    Actions

            Variable - Modify Resource Count[(Triggering player)][Minerals]: + 5
            etc etc.

    You use a global array that you update whenever a specific resource for a specific player is collected in that player's hash for that resource.

    You use that to check which resource has been most recently dropped off.  The Unit event will give you Triggering Unit which gives you the unit who dropped the resource off.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Worker that most recently dropped off minerals/gas

    I've been playing around with it and I still can't quite seem to get it to work...

    The hotfix I've been using is selecting the unit closest to my base when my minerals/gas change, but this sadly is often incorrect as certain direction are considered closer than others so simultaneous dropoff screws things up.

    One of the problems is, I don't see any way to identify either "minerals" or "gas" as an item or cargo unit.  It only lets me specify units that have already been specifically placed on the map (such as individual mineral chunks or vespene geysers)

    I'm really just trying to replicate the effect in wc3 where I display text over a unit's head when it drops off a resource at the town hall.  I have the text all working properly, but my hotfix doesn't always pick the right unit to display it over

    Posted in: Miscellaneous Development
  • 0

    posted a message on Editor Deleted Loads of My Code!

    @Grogian

    I think I figured out how to use Any Player.  I looked up the preset and entered its value (c_playerAny) as a custom script, even though it was not offered as one of the presets for my Player Event

    Here's my code for one of the triggers that shows a warning

    Vowel Collect
        Events
            Player - Player c_playerAny Minerals Collected changes
        Local Variables
            i = 0 <Integer>
            Char = 0 <Integer>
        Conditions
        Actions
            Variable - Set Char = (Get Vowel((Random integer between 0 and 4)))
            Variable - Modify Alphabet Stock[Char][(Triggering player)]: + 1     <-----Warning on THIS element
            Print Letter Inventory((Triggering player))   <----Function that had all of its contents deleted
            Action - Display Character Collected((Closest unit to (Start location of player (Triggering player)) in (Probe units in (Entire map) owned by player (Triggering player) matching No Unit Filter, with at most Any Amount)), Char)

    Posted in: Triggers
  • 0

    posted a message on Editor Deleted Loads of My Code!
    @Grogian: Grogian, I don't see the "Any Player" option anywhere. The event I'm using is: "Player Property Changed" and it takes a player (integer), not a player group. How should I set this to work for "Any Player?"
    Posted in: Triggers
  • 0

    posted a message on Editor Deleted Loads of My Code!
    I'd gotten it once before too, and nothing was changed. This time, one of my largest functions that handled all my UI display printouts had everything but 1 line of its code removed (needless to say my UI no longer appears in test plays now). I was really shocked that the editor would do this on its own without at least warning me before, and I can't see any way to get the info back
    Posted in: Triggers
  • 0

    posted a message on Editor Deleted Loads of My Code!
    My code was removed by the editor automatically when I closed the editor and reopened it, then loaded my save file. Thanks for the advice on using Any Player, I'll do that. Funny thing is that it did work and didn't generate any errors in compiling or running (just the warning diamonds) but surprised me with this upon reopening it.
    Posted in: Triggers
  • 0

    posted a message on Worker that most recently dropped off minerals/gas
    @Honz: There's Unit Loads/Unloads Cargo and there's Unit Manipulates Inventory Item. The cargo option doesn't take any arguments other than load/unload and I don't think it refers to minerals/gas, and the inventory item only accepts individual units as the inventory items, and I don't know how to make that work or if it's appropriate...
    Posted in: Miscellaneous Development
  • 0

    posted a message on Editor Deleted Loads of My Code!
    So, I had my triggers and functions all up and running, and they worked perfectly in testing. They gave me some warnings, which I think are caused by an invalid use of "Triggering Player," as that's the only common thread. For some reason, I don't think it wants me using "Triggering Player" for an event that also uses "Triggering Player" as an event criteria... But I don't know any other workaround, and it WAS working fine. So, I closed my editor (after saving mind you), and opened it again to be greeted with this slew of warnings: Warning: Orphaned trigger function call removed: Function Call 'Word Of String' (Function Call, 9029C7A2, Lib: 0) Warning: Orphaned trigger function call removed: Function Call 'While' (Function Call, 1C307243, Lib: 0) Warning: Orphaned trigger function call removed: Function Call 'Convert String To Text' (Function Call, DE36CFE5, Lib: 0) Warning: Orphaned trigger function call removed: Function Call 'Clear Text Messages' (Function Call, 6EB24965, Lib: 0) Warning: Orphaned trigger function call removed: Function Call 'All Players' (Function Call, 5FECC527, Lib: 0) Warning: Orphaned trigger function call removed: Function Call 'Convert String To Text' (Function Call, 597D38CC, Lib: 0) Warning: Orphaned trigger function call removed: Function Call 'Combine Text Multiple' (Function Call, 24D0ED0E, Lib: 0) Warning: Orphaned trigger function call removed: Function Call 'Convert Player To Player Group' (Function Call, CF18EF92, Lib: 0) Warning: Orphaned trigger function call removed: Function Call 'Text Message' (Function Call, ACE5EBD2, Lib: 0) Warning: Orphaned trigger function call removed: Function Call 'Triggering Player' (Function Call, 93B73456, Lib: 0) Warning: Orphaned trigger function call removed: Function Call 'Text Message' (Function Call, D2997BF7, Lib: 0) Warning: Orphaned trigger function call removed: Function Call 'Triggering Player' (Function Call, 3E600237, Lib: 0) Warning: Orphaned trigger function call removed: Function Call 'Set Variable' (Function Call, 186493C1, Lib: 1) Warning: Orphaned trigger function call removed: Function Call 'Owner Of Unit' (Function Call, 97B957C6, Lib: 1) Warning: Orphaned trigger function call removed: Function Call 'Owner Of Unit' (Function Call, 4898044B, Lib: 1) Warning: Orphaned trigger function call removed: Function Call 'If Then Else' (Function Call, F1181590, Lib: 1) Warning: Orphaned trigger function call removed: Function Call 'Owner Of Unit' (Function Call, 26C06159, Lib: 1) Warning: Orphaned trigger function call removed: Function Call 'Owner Of Unit' (Function Call, C4408C1B, Lib: 1) Warning: Orphaned trigger function call removed: Function Call 'Triggering Unit' (Function Call, 9D8076DF, Lib: 1) Warning: Orphaned trigger function call removed: Function Call 'Owner Of Unit' (Function Call, B6342AAD, Lib: 1) Warning: Invalid trigger element reference removed from Function 'Print Letter Inventory' (Function Call, 6EB24965, Lib: 0) Warning: Invalid trigger element reference removed from Function 'Print Letter Inventory' (Function Call, 1C307243, Lib: 0) Warning: Orphaned trigger sub-function call removed: Function Call 'Modify Variable (Integer)' (Function Call, A65A3107, Lib: 1) Warning: Orphaned trigger sub-function call removed: Function Call 'Modify Variable (Integer)' (Function Call, CAFAC082, Lib: 1) Warning: Invalid trigger element reference removed from Parameter Value 'Unknown' (Function Call, 4898044B, Lib: 1) Warning: Invalid trigger element reference removed from Parameter Value 'Unknown' (Function Call, C4408C1B, Lib: 1) Warning: Invalid trigger element reference removed from Parameter Value 'Unknown' (Function Call, 93B73456, Lib: 0) Warning: Invalid trigger element reference removed from Parameter Value 'Unknown' (Function Call, 26C06159, Lib: 1) Warning: Invalid trigger element reference removed from Parameter Value 'Unknown' (Function Call, 97B957C6, Lib: 1) Warning: Invalid trigger element reference removed from Parameter Value 'Unknown' (Function Call, 3E600237, Lib: 0) Warning: Invalid trigger element reference removed from Parameter Value 'Unknown' (Function Call, B6342AAD, Lib: 1) I think the problem is that all of these elements referenced "Triggering Player" or some descendant thereof passed through the functions. The editor also removed "Triggering Player" as my call element in the triggers I called those functions and left that parameter blank. So now, I'm left with all that, very complicated print-out code deleted, and no reason to show for it. I understand why the editor behaved to foolishly, but it was incredibly overzealous and I still don't know what I can use instead of this warning-inducing "Triggering Player" variable.
    Posted in: Triggers
  • 0

    posted a message on Worker that most recently dropped off minerals/gas

    Anyone know how I can select the worker who most recently dumped minerals or gas at my nexus? I don't see a way natively. Do I create an actor out of all my probes or something?

    Thanks!

    Posted in: Miscellaneous Development
  • 0

    posted a message on User Input Parser and int to char Conversions

    Thanks a lot for the advice!

    I bit the bullet and just hardcoded my characters into an array of strings =P So I just do a lookup using that array.

    And thanks for point me to Event: Chat Message. Writing the parser will be just like an old C assignment, haha. I should try to look up my code from when I wrote one for class.

    Posted in: Triggers
  • 0

    posted a message on User Input Parser and int to char Conversions

    I'm looking to do two different things: one complicated, the other simple.

    The simple one is just being able to convert an int to a char in ASCII fashion, and then put that char in a string.

    The other is being able to parse user text input, letter by letter, and then run logic on that input (being able to specifically recognize every letter is important)

    Both of these operations are really really easy in C, but this editors lack of string dereferencing and seemingly no char type to speak of makes that difficult. This API Docs here suggest that a char type does exist in the scripting language only, but I don't know how to make that char into a string.

    Thanks for any help!

    Posted in: Triggers
  • 0

    posted a message on Floating Text over Unit's Head

    I'm looking to replicate the effect from WC3 where the number of resources collected displays in floating text over the worker's head when he delivers the resource. WC3 had several instances of this effect: the "Miss" text, the "Crit" text, and the +5 etc for resources, but I can't find how to actually make my own custom text in the WC3 editor either.

    I would love to be able to use this kind of custom text for my game, so I'm really hoping it's possible =)

    Edit: Found the solution here: http://forums.sc2mapster.com/development/map-development/8962-is-there-floating-text/

    Sorry for not searching thoroughly enough at first! (I tried to, honest!)

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