• 0

    posted a message on Valerian02Incapacitated causing Hero Revive on Map Start :(

    Your problem is not in this trigger. You can stop going through it as soon as you see

    Events

    Unit - Any Unit is attacked

    There is no way this would affect your units to start with unless your units get one shotted the second they spawn on the map.

    How are you creating these unit to start with? Thats the area causing the problem.

    Posted in: Triggers
  • 0

    posted a message on calling variable functions

    No need for custom script as we can use the datatable for the trigger string identification, but maybe that a custom script could be abit more efficent then doing it with normal ingame code.

    I just like to use a datatable when possible due to its memory perks in the map.

    Posted in: Triggers
  • 0

    posted a message on Problem with sliding trigger

    small question

    Is the location the unit moves to a fixed spot everytime or is it meant to be a random point based on your input into the game?

    Posted in: Triggers
  • 0

    posted a message on calling variable functions

    Ya though of that first but then he also said

    "and i also don't want to make 1 function and 10 if's"

    Pretty much makes that code idea obsolete

    Posted in: Triggers
  • 0

    posted a message on calling variable functions

    No what hes asking is he has like say 10 functions.
    then wants to add those functions to a variable array and then run the fucntions out of a loop based on the array index.
    What hes refering to in WC3 is actually now alot more complex and is infact the "Run Trigger" action we now have.
    Just need to bend our minds alittle to deal with it compared to the old version.

    Having a trigger as container instead of a function does allow alot more breathing room when coding as you can always still use global variables to pass on and return values from the trigger. It just doesnt work the way you would want by using a function directly

    Posted in: Triggers
  • 0

    posted a message on calling variable functions

    No a variable can only contain 1 type of data. Trying to add a function as a variable value pretty much breaks this whole concept as a function contains alot more then a single type value.

    What you can do but also has some limitations is not using a function or action but using a trigger. You can save a trigger into the Data Table with the naming you want.
    the naming is a simple string value so you can then load up the string values into an array and call on the data table entries to run the trigger of choise.

    The only draw back you have with this method is you loose the ability to pass on parameters and have no return value. Your contruction will need an overhaul but can be achieved with this method

    Posted in: Triggers
  • 0

    posted a message on Where is all of the missing content for triggers?

    @Hexenlord

    Map making is for those that like to do it and want to do it. When your creating a map you almost doing the exact same as a level designer.
    The editor was never intended to be an extra part of the game for everyone. If you cant understand the complexity of the system then please leave that to the people that do understand.
    The differences between WC3 and SC2 editor are amazing and allow so much more then we could think of before with WC3.
    If you need help on something like say add an new little function to count the unit for a player and you have trouble doing it then just ask here. There are quite a few people that are more then glad to help that have quite a bit more understanding of the system then you do.

    There is absolutly no foundation for your frustration toward blizz exspecially when your on this website.

    I checked the editor for the easiest way to do this and come to the conclusion that the code line that Lordabyss posted will do exactly what you need without even creating a function and also allows you to do alot more with the action then you ever could do in WC3.

    Posted in: Triggers
  • 0

    posted a message on A trigger to detect any ability used by any unit?

    Well i was thinking of creating an extra function that returns an ability command.
    The function can be added in the the event trigger in place of the ability command you enter on the standard event we are using above.
    The idea is to pass on the triggering unit in a parameter to the function then get the ability command of the last used ability by that unit en return that as the return value of the function

    After that it would be easy to define on what abilitys it triggers with a condition based ability array.

    Oh one other thing i thought of but also restricts your ability's alittle is to use an event that rsponds to property change and then focus on energy used.

    Event - any unit uses energy
    bla bla bla

    Only draw back is you would have to make sure that every abilty uses energy that you want to detect.

    Posted in: Triggers
  • 0

    posted a message on A trigger to detect any ability used by any unit?

    Ive been digging around abit and did get a valid idea as how to do it how ever i constantly run into a problem not being able to return the last used abilty from a unit. With out that part i cannot sum up the events into 1 event line.
    Either blizz will have to add the abilty to return the last used ability on a unit or im completely overlooking it.

    So all i can say sadly is your bound to adding an event line for every ability you want it to react too. I must note that its not bad coding to add that many lines in the event. It will not create any adverse lag or memory issues just need to type quite abit.

    @anyone beside baldey
    If you have a way to return last used abilty in an action i would love to know

    Posted in: Triggers
  • 0

    posted a message on Button Array Question

    I had the same issue a while back.

    The solution i found was far more simpeler then i every thought it would be.
    Ditch the array and loops and use Data Table with you own logical naming.

    An example of my own code lines i use

    Dialog - ("DG Section Minus 1" from the Global data table) is used by Player Any Player with event type Clicked

    Dialog Item Is Used
    Item: Value From Data Table (Dialog Item)
    Name: "DG Section Minus 1"
    Scope: Global
    Player: Any Player
    Event Type: Clicked

    You can ofcourse also just keep it as "any dialog item" in the event and use these in if-then-else structure to respond to individual dialog items.
    The reference "Value From Data Table" has made my life alittle easier concerning dialogs.
    Also note Datatable entries do not count towards your maximum memory usage in the map so it will save space as well

    Posted in: Triggers
  • 0

    posted a message on Question concerning dialog items and multiple players

    Arrays are collections of teh same type variable
    If you create one with the size 4 then yes the memory used is exactly the same as creating the 4 variables individualy.

    The thing about arrays is that to use them correctly you almost always need to use loops to deal with the values. Loops are heavy on the game avoid when possible.

    Also when creating a loop always try to use the "While" loop. The "For" loops have been proven to have a bug in them which tend to allocate insane amounts of memory usage in your map for absolutly nothing. This is something blizz will have to fix. Just avoid them now when possible.

    Posted in: Triggers
  • 0

    posted a message on How to simulate "kills" condition

    So you know how many times you killed say a zergling. What then post it on the leaderboard or something so we can all players can see you killed zerglings? I doubt that will add to any form of game play.

    Im thinking one step ahead and going for what would i use this data for and when i think of that then how to gather the data in the most efficient way without creating extra variables.
    Unit custom values are there if you want or not. Custom global variable are always an addition to your map and thus reserves memory for actually nothing.

    I find it amusing how many people horde up on global variables and arrays and loops that make any real programmer wanna cry.
    Please dont try to discredit people giving something extra to really help.

    Posted in: Triggers
  • 0

    posted a message on How to simulate "kills" condition

    Example?
    One thing i can think of maybe is if your unit has killed say 50+ zerglings that the specific unit gains +25% damage to zerglings
    But any new unit created of that same type does not get the increase until it has killed 50 itself.

    Posted in: Triggers
  • 0

    posted a message on Question concerning dialog items and multiple players

    Indeed arrays are very well possible. Dont go overboard on them though.
    I like to use the data table abit as its alot more memory freindly then arrays.
    A combination of both is good

    Posted in: Triggers
  • 0

    posted a message on A trigger to detect any ability used by any unit?

    TBH i havent been able to think ovf anything you would want to use this kind of trigger for.

    Tell me what are you fireing off when the ability event is registeerd? maybe there is a far more efficient method to doing what you want?

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