making a function compatible help please

xoxdragonxox

New Member
Reaction score
1
The trigger still don't work if i change it to
JASS:
    call SpawnRectRandom(gg_rct_SpawnWestTop,Player(14),'GetUnitTypeId(udg_Unit[GetRandomInt(1,5)])',1)


This would have me change the Variable "Unit" to a (Unit-Variable), currently its a (UnitType-Variable).
This also means i would have to Preplace the units i want on the map to set it to the unit[] i need.
 

Dirac

22710180
Reaction score
147
Remove the (')

[ljass]'hfoo'[/ljass] evaluates the ASCII characters inside the (') and turn them into a number
[ljass]'GetUnitTypeId(udg_Unit[GetRandomInt(1,5)])'[/ljass] is doing the same thing, all the code sees is a bunch of words inside, the function dosn't matter anymore

[ljass]'hfoo'==GetUnitTypeId(udg_Unit[GetRandomInt(1,5)])[/ljass]
 

xoxdragonxox

New Member
Reaction score
1
Like i said in my other post using GetUnitTypeId() will not work, because that would mean i would have to change my varible type from Unit-Type to Unit. I tested it with another varible called MapUnits[] which is a Unit Varible and it saves without any errors. my problem is you cant set a unit to Units varible because the unit would have to be preplaced on the map to do so

here is what i have in my map initilizaion

set udg_Unit[1] = 'nzom'
set udg_Unit[2] = 'n00I'
set udg_Unit[3] = 'n00J'
set udg_Unit[4] = 'n001'
set udg_Unit[5] = 'n00M'
set udg_Unit[6] = 'n00P'
set udg_Unit[7] = 'n00G'
set udg_Unit[8] = 'n00F'
set udg_Unit[9] = 'u00C'
set udg_Unit[10] = 'u001'
set udg_Unit[11] = 'ugar'
set udg_Unit[12] = 'u009'
set udg_Unit[13] = 'u00B'
set udg_Unit[14] = 'u000'
set udg_Unit[15] = 'u00A'
set udg_Unit[16] = 'h021'
set udg_Unit[17] = 'u008'
set udg_Unit[18] = 'u004'
set udg_Unit[19] = 'n00K'
set udg_Unit[20] = 'z00D'
 

Solmyr

Ultra Cool Member
Reaction score
30
Use this then:

[ljass]call SpawnRectRandom(gg_rct_SpawnWestTop, Player(14), udg_Unit[GetRandomInt(1,5)], 1)[/ljass]

You could have told us that the [ljass]udg_Units[/ljass] array contains unit IDs, not units (as the name describes).
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Don't edit out your original post.
In the future, when other people find this thread for a similar problem they won't be able to see how the script and/or thread progressed.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top