• 0

    posted a message on Timers messed up

    @Nerfpl: Go

    yeh what you said ^ ^ it was pretty easy to plant in although i had to take a dialog tutorial cause im new to the editor. I want to change the font of the timers(variables) that get displayed on the minimap... i have like a method that calculates all the timers or what you call labels on the minimap for 2 players 4 players and 6 players.

    Suggestions would be nice... know im grateful ^_^

    Posted in: Triggers
  • 0

    posted a message on Timers messed up

    @Swagblanket: Go

    Hey, thnx man ill prolly try that out in the future, ive been messing around with it a lot... Anyway if your interested, here was my solution: another desert strike had used it so i recreated it since he had hismap locked :p

    O yeh and! If you know a way to make the spawntime variables showed on the map increase in size, pls tell me! http://imageshack.us/photo/my-images/171/maptimers.jpg/

    :D

    Posted in: Triggers
  • 0

    posted a message on Timers messed up

    @Swagblanket: Go

    Hey, i kinda alrdy figured it out, i have created a custom dialog above the original minimap and put the timers on the positions where the startpositions of the players are located.

    what you mentioned was actually kinda the idea, and i already had the leaderboard with players and spawntimers, only thing was that at times it would display the wrong spawntimer for a player. And the reason for that was that the lobby slots and teams arent the same as the ingame positions and teams..

    Posted in: Triggers
  • 0

    posted a message on Timers messed up

    Hey,

    Im making kinda of a desert strike map but im having a little trouble showing the spawntimers... Anyway, there are 2 teams, each team can have 3 players:

    1st spawner: 30 secs 2nd spawner: 60 secs 3rd spawner 90 secs

    So there are 2 spawners at every spawntime now . Everyspawntimer counts down to zero and restarts at 90 if 6 players in game, at 60 if 4 players ingame, at 30 is 2 players ingame.

    Now the thing is... a lot of times the lobby gets messed up becus like example: player 1, 4 and 6 will be in the same team, and my spawntimers are totally lost. so... what i saw in some map online called DS 1338 they just put the spawntimers on the starting locations on the Minimap, which is an awesome solution because i think you dont really have to know which player is in which starting location, it just starts counting down at the start location of the players.

    Anyway my Question!:

    How did they do it?, is it a custom dialog which displays over hte normal minimap? Anyone got a global idea of how to fix my problem? can i reference the timers to the start locations instead of the players themselves? like, if player starts on starting location 1 show timer 1

    Posted in: Triggers
  • 0

    posted a message on Structure refund

    @Zolstice: Go

    Wow i wwas just reposting while i read your post, you were right thx, i put the ability stage to execute, now its fine, only triggers 1 time :D

    thx for all help, works perfectly now!

    I had 1 last question which isnt really relevent to what i was fixing. How can i send such a text message of the refunded minerals to a specific player and not a plyer group? more like the player who triggered the unit

    Refund
        Events
            TriggerAddEventUnitAbility((EventUnitTargetUnit()), "SellBarracks", 0, c_unitAbilStageExecute, false)
        Local Variables
            constant = 0.75 <fixed>
            structureCost = 0.0 <fixed>
            refund = 0.0 <fixed>
        Conditions
        Actions
            UIDisplayMessage((PlayerGroupAll()), c_messageAreaChat, "Building is Being Salvaged!")
            SetVariable(structureCost, (FixedToInt((IntToFixed((UnitTypeGetCost((UnitGetType((EventUnit()))), c_unitCostMinerals)))))))
            SetVariable(refund, (ArithmeticReal(constant, *, structureCost)))
            UIDisplayMessage((PlayerGroupAll()), c_messageAreaChat, (CombineText("Refund = ", (FixedToText(refund, c_fixedPrecisionAny)))))
            UIDisplayMessage((PlayerGroupAll()), c_messageAreaError, (CombineText("Structure cost:", (FixedToText(structureCost, c_fixedPrecisionAny)))))
            PlayerModifyPropertyInt((UnitGetOwner((EventUnit()))), c_playerPropMinerals, c_playerPropOperAdd, (FixedToInt(refund)))
    
    Posted in: Triggers
  • 0

    posted a message on Structure refund

    @Rice87: Go

    Hey,

    i changed all the integers to real and everything works now accept for that once it gets triggered, it hits multiple times so you get like 6 times the refund... Any can explain?

    Posted in: Triggers
  • 0

    posted a message on Structure refund

    @Rice87: Go

    Hey, i made an ability to sell my barracks call SellBarracks

    name: SellBarracks

    ID: SellBarracks

    Ability typ: Effect - Instant

    Based On: Refund

    Race: Terran

    Field values: set to parent values

    After that i went back to my code, tested it with a few message displays, when i press the salvage on my barracks it does trigger. It says the refund is 0 and the cost is 105 which is correct, so there must be something wrong with adding to the refund variable. As you can see i copied the code downlow.. Any suggestions? (i tried it also with real number instead of 3/4 and it still says refund: 0) Also the text message displays like 6 times at once when i activate the ability :/

    Refund
        Events
            TriggerAddEventUnitAbility((EventUnitTargetUnit()), "SellBarracks", 0, c_unitAbilStageAll, false)
        Local Variables
            structureCost = 0 <int>
            refund = 0 <int>
        Conditions
        Actions
            UIDisplayMessage((PlayerGroupAll()), c_messageAreaChat, "Building is Being Salvaged!")
            SetVariable(structureCost, (FixedToInt((IntToFixed((UnitTypeGetCost((UnitGetType((EventUnit()))), c_unitCostMinerals)))))))
            SetVariable(refund, (ArithmeticInt(structureCost, *, (FixedToInt(0.75)))))
            UIDisplayMessage((PlayerGroupAll()), c_messageAreaDirective, (CombineText("Refund = ", (IntToText(refund)))))
            UIDisplayMessage((PlayerGroupAll()), c_messageAreaError, (CombineText("Structure cost:", (IntToText(structureCost)))))
            PlayerModifyPropertyInt((UnitGetOwner((EventUnit()))), c_playerPropMinerals, c_playerPropOperAdd, refund)
    
    Posted in: Triggers
  • 0

    posted a message on Structure refund

    @Rice87: Go

    Thx for the fast reply!

    I work in the GUI and sometimes add pieces of custom code, i think i did something wrong in the ability then, thx i was wondering how the heck i could see the code in the GUI . i used to just copy from Data > viewscript :p ill hit back when i found the problem

    Posted in: Triggers
  • 0

    posted a message on Structure refund

    Hey ppl.

    Im pretty new to the map editor so i had a question about my trigger not working... Its suppose to go off whenever a structure uses the specified sell ability for that structure. Then in actions i get the cost of the triggerd building and the player which hads triggerd it, and take off 25% of the refund so the player gets 75% of spend minerals. And i didnt know how to use decimals so i used 3:4 = 0,75 for the refund. I havent really created much triggers yet but i thought this would kinda work.

    maybe someone can enlighten me? All help is welcome!

    Event

    TriggerAddEventUnitAbility(gt_Refund, UnitRefFromUnit(EventUnitTargetUnit()), AbilityCommand("RefundSpecificBuilding", 7), c_unitAbilStageAll, false);

    Variable Initialization

    lv_structureCost = 0;

    lv_refund = 0;

    Actions

    lv_structureCost = FixedToInt(IntToFixed(UnitTypeGetCost(UnitGetType(EventUnit()), c_unitCostMinerals)));

    lv_refund = (lv_structureCost * (3 / 4));

    PlayerModifyPropertyInt(UnitGetOwner(EventUnit()), c_playerPropMinerals, c_playerPropOperAdd,lv_refund);

    return true;

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