• 0

    posted a message on Common Sense 101 (Triggering Edition)

    Overall useful though your dogmatic inclination towards while loops and condemnation of for loops is bothersome and has no legitimate grounds. Hence the name though, I guess...

    Posted in: Triggers
  • 0

    posted a message on Win conditions: how to check for leavers on a team
    Quote from Stormahawk: Go

    Thank you for all the advice. Since every team had an AI, I ended up checking to see the number of allies the AI had every 5 seconds. If the number of allies was 0, the game would end.

    Definitely works fine in this case.

    In general it would be better style to check the condition only when a player leaves, so that you aren't running excessive periodic events (ofc in this case it doesn't matter like I said, but if you run into more complicated cases with large looping triggers running periodically ever .1 seconds you may notice some lagg issues, in which case you want to think about giving triggers events that only fire when they absolutely need to).

    In addition you would a "cleaner feel" running the check on player leave because then it would happen instantly every game, whereas in this case it takes an apparently random amount of time between 0 and 5 seconds for victory to occur.

    Posted in: Triggers
  • 0

    posted a message on Create a Tower (Dota style)

    @Diego6D: Go

    Tomorrow I will try to whip up a quick example of what I'm talking about

    Posted in: Triggers
  • 0

    posted a message on Regions Stop Working After Merging Too Many Shapes?
    Quote from DeltaV: Go

    Hey Entity. :)

    Yeah the limit is 50. Shapes 51 and onwards are not detectable with triggers. Like you I figured that out the hard way, haha. I should probably submit a bug report.

    @Mille25: Go

    On that note, if you only use positive shapes in a region, the random point in region function never fails, even with 50 shapes. (At least, I've never seen it fail). Negative shapes, however, are the bane of that function.

    Thanks Delta!

    If you happen to check this again, or anyone else knows... Is there a maximum total number of regions in a map before trigger events stop firing? My map is getting a ton of regions and I'm getting worried now, heh.

    Posted in: Triggers
  • 0

    posted a message on AddEventUnitRegion - Variable Unit

    @Mille25: Go

    I thought this is exactly what I did, I will make a very simple test of concept map tonight and make sure though.

    Edit: Bloody hell, I made a super simple map with only this functionality and it worked... I must have gotten lost in the complexities of everything... Will try to see where I slipped up.

    Edit 2: Found the difference!

    When using a pass by reference parameter, the editor uses the function UnitRefFromVariable(string) as I stated in my OP, however Mille, you used the function UnitRefFromUnit. Could have just told me that haha...

    Anyway, looks like this issue is solved! To any one else who wants to do "Variable unit enters variable region" triggers, it can certainly be accomplished, just make sure to use UnitRefFromUnit for the unit parameter to TriggerAddEventRegion.

    Posted in: Triggers
  • 0

    posted a message on Leaderboard Background

    @Scythe1250: Go

    You could set the custom value of the unit to something, say 72, whenever you kill it with a trigger.

    Then, in your conditions for the Unit Dies trigger, make the first condition be Custom Value of Triggering Unit != 72. Then any units you kill with triggers will short circuit out of your Unit Dies trigger immediately and you won't get the errors.

    I hate error messages like that though, many such error messages that I know don't matter have caused me to make changes in my maps to fix the error message in a way that ends up causing some obscure annoying actual problems down the road...

    (I lol'd at Feederboard)

    Posted in: Triggers
  • 0

    posted a message on Win conditions: how to check for leavers on a team

    You could create player groups at initialization: Team1Players, and Team2Players with

    for each player in Team 1
       if controller of picked player == user
          add picked player to Team1Players
    

    Ditto for Team 2

    Then whenever a player leaves, remove them from the TeamXPlayers group. Finally, at the end of the player leaves trigger, call a CheckVictory action, which would do the following

    if Team1Players is empty ==> Team 2 Victory

    if Team2Players is empty ==> Team1 Victory

    Posted in: Triggers
  • 0

    posted a message on Create a Tower (Dota style)

    It's been a while since I touched the original Dota, but in Dota 2 that's not how towers work. Towers will never switch targets until either the current target dies or goes out of range (exception: target reset trick). Towers prioritize heroes only if the hero is attacking the tower or allied units, otherwise they prioritize the closest unit.

    Just a heads up in case you are trying to imitate dota-style towers accurately.

    As to your question, I don't know much about battle mechanics in the editor, but I feel like there should be a combat priority field for each unit. If that doesn't allow you to get what you want done, then you could run some triggers to manually set the targets... Create a region, pick each tower in the game, center the region on the tower. Then loop through each unit in that region and perform logical checks to see which one should be the target, then order the tower to attack that unit.

    Posted in: Triggers
  • 0

    posted a message on RejuvinateEnergySound

    I'm using the sound effect "RejuvinateEnergySound" in my map, when I previewed it in the editor it sounded cool, but in-game it sounds totally different - it's shorter and just lame. What have I done wrong? >_>

    Posted in: Audio Development
  • 0

    posted a message on AddEventUnitRegion - Variable Unit

    @SoulTaker916: Go

    Thanks for the reply man.. kind of sad about that.

    I guess it's ok for now, since the trigger condition check is super fast (1 <= triggering player <= 10), it just seems like really sloppy style and I can't understand why the editor wouldn't have a way to do this.

    It seems the problem is in the function UnitRefFromVariable that the compiler automatically sticks in there, which ends up just being a null reference. Maybe there's some way to dynamically get an actual reference to the unit, and then it should work...

    Posted in: Triggers
  • 0

    posted a message on AddEventUnitRegion - Variable Unit

    Edit: Solved, use TriggerAddEventUnitRegion(t, UnitRefFromUnit(u), r, flag) to accomplish this functionality. See attached map for a demo.

    Hey, so I would like to create a trigger that functions essentially as follows:

    Events: gv_unitvar enters gv_regionvar

    Conditions: ...

    Actions: ...

    My current approach was to create a custom action definition called TriggerAddEventUnitRegion using the parameters from the native function in the archive, checking the native option, and then making the unit parameter passed by reference. Next, I created my function with the actions that I want to happen when the trigger fires. And finally, I created the trigger and called my action TriggerAddEventUnitRegion passing as a parameter my unit var and region var. However, the unit variable seems to be broken, it is being treated as null it seems (trigger is firing whenever Any Unit enters the region). I looked at the sciprt, the code that's being generated for the unit parameter is UnitRefFromVariable("gv_unitvar") - at first I was like "Oh that's a sweet function," but at the same time it's not working for me :/

    I can't be the only one who has tried to do this, anyone got this working?

    (Current shitty workaround: check condition after the trigger fires, but then I get a trigger firing possibly dozens of times a second when I really only want it to fire a few times per minute.)

    Posted in: Triggers
  • 0

    posted a message on Regions Stop Working After Merging Too Many Shapes?
    Quote from Mille25: Go

    Merging too many regions should be avoided because the resulting shapes will get more and more complex.

    As an example, the random point in region function has a certain chance to fail and return 0,0 if the region shape is too complex. I dont have any experience with the unit enters region event and region merging, but I didnt notice any issues with it myself yet. That said, I cant remember combining 50 regions into one, ever.

    If you can clearly reproduce the issue and prove that its related only to the amount of regions merged (or the complexity of the resulting shape) then I would suggest writing a detailed bug report for Blizzard.

    It's very clearly directly a cause of the number of shapes... it's right around 50. Split up my regions into two regions (which was a pain in the ass) and it worked perfectly, literally changed nothing else.

    Posted in: Triggers
  • 0

    posted a message on Regions Stop Working After Merging Too Many Shapes?

    I have this bug in my map where the trigger event "Unit Enters Region" just doesn't fire for the most recent shapes I added to a region. I spent hours trying to figure out what the hell is going on, finally I tried just taking those shapes out of the giant region of 50+ merged shapes, and viola, it works...???

    Got no error message or anything when building the regions, it just stopped working? Is something else going on here or is this really how the editor works, and if so, wtf!?

    Posted in: Triggers
  • 0

    posted a message on What does the "Custom Script" Option mean?

    I also tried to call it using a code directly rather than through the gui and it just gives a compiler error, haha. So weird, doesn't seem very useful.

    Posted in: Triggers
  • 0

    posted a message on Unit Model/Actor won't change after morph

    Hey, I'm a relative novice in the data editor, so maybe this won't be helpful, but have you made sure are you sending a ModelSwap actor message to your unit somewhere?

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