Thursday, April 19, 2012

Prolly Easy To Solve, But I'm Stumped!

Alright, I am making an art of defense map and am trying to get a random unit ability, assigned to units by way of a random number, to display to players so that they know what the buff is for the wave.


Code:
Random Abilities Assignment
Events
Whatever
Conditions
Actions
Wait 1.00 seconds
Set Temp_Group = (Units owned by Player 10 (Light Blue))
Set Ability_Number = (Random integer number between 0 and 19)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 10) Greater than or equal to 7
Then - Actions
Unit Group - Pick every unit in Temp_Group and do (Unit - Add Ability[Ability_Number] to (Picked unit))
Game - Display to PlayerCount for 3.00 seconds the text: (Ability: + (Name of Ability[Ability_Number]))
Else - Actions
Do nothing
Custom script: call DestroyGroup (udg_Temp_Group)
Game - Display to (All players) the text: (Level: + (String(MobLevel)))

"Ability" is an ability array variable of unit buffs.

"Ability_Number" is an integer variable.

As it stands right now, I am only getting "Default String" as a result for the ability name. Any help would be appreciated.|||Uhmmmmm.

i don`t know if boolean evaluation is ok. maybe setting a variable that contains ur random number (that 35% chance) and after check that variable in the boolean evaluation works better...

No comments:

Post a Comment