| 04-27-2009, 06:47 PM | #1 |
Hello ! I'm training my scripting skill in JASS and i wanted to create a trigger which puts flowers around a farm when the construction is complete. My script works with destructables, but I can't find a native function to put doodads on the map ingame. Does it exist a JASS function to put doodads ingame ? or it's possible by another way ? My script : JASS:function Flowers_condition_unit_type takes nothing returns boolean return GetUnitTypeId(GetTriggerUnit()) == 'hhou' endfunction function Flowers_random takes real a, real b returns real local real nombre = GetRandomReal(a, b) loop exitwhen (nombre < -72) or (nombre > 72) set nombre = GetRandomReal(a, b) endloop return nombre endfunction function Flowers_Action takes nothing returns nothing local real radius = 200 local unit ferme = GetTriggerUnit() local integer nbFleursMax = 0 local integer nbFleurs = 0 loop exitwhen nbFleurs == nbFleursMax call CreateDestructable('B000', GetUnitX(ferme) + Flowers_random(-200, 200), GetUnitY(ferme) + Flowers_random(-200, 200),0,0.8, GetRandomInt(0, 3)) set nbFleurs = nbFleurs + 1 call TriggerSleepAction(0.2) endloop set ferme = null endfunction function InitTrig_Flowers takes nothing returns nothing local trigger gg_trg_Flowers set gg_trg_Flowers = CreateTrigger() call TriggerRegisterAnyUnitEventBJ(gg_trg_Flowers, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) call TriggerAddCondition(gg_trg_Flowers, Condition(function Flowers_condition_unit_type)) call TriggerAddAction(gg_trg_Flowers, function Flowers_Action) endfunction Thanks =) |
| 04-27-2009, 07:02 PM | #2 |
You cant do it with JASS alas. You could fake doodas with units using the Locust ability. I presume you can walk over the flowers, right? You could try using the ability the Undead Graveyard uses to generate the tombstones around, and change the model to your flowers. You must chnage the unittype corpses probably to a flying unit so it doesnt display them. |
| 04-27-2009, 07:16 PM | #3 |
You could possibly also use a custom version of the spell 'volcano', casted by a dummy caster. |
| 04-27-2009, 11:04 PM | #4 |
Volcano creates destructables, not doodads. The whole point of doodads is that unlike destructables they can't be manipulated, otherwise they'd be pretty much the same thing. |
| 04-27-2009, 11:14 PM | #5 |
Can you make a destructable untargetable? |
| 04-28-2009, 12:13 AM | #6 |
Yup. The Ruins Naga Circle is a counted as a destructible. |
| 04-28-2009, 11:43 AM | #7 |
Hi ! Thanks for replies, so I have to work with destructables =) I'll try with ruins naga circle, because with a tree with a flower skin and pathable option ticked, my units climb on the flowers, and I wanted them to pass through. Screenshot here ! That's my problem =) |
| 04-28-2009, 09:25 PM | #8 |
disable walkable |
| 05-01-2009, 12:42 PM | #9 |
Huh it works ^^ Thanks =) |
