HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Some JASS questions I had

02-21-2004, 01:46 AM#1
Narwanza
Okie dokie, so I am trying to optomize my TD using some JASS stuff. I know a little bit about JASS and have used it to create some spells, but I have a couple little questions that can't be answered at an API browser. How would I do a return unitcode function? Is unitcode even a handle? How do I specify a type of unit in a variable? Here is a little example of code. I know it won't work, and it does give me multiple compile errors, so bear with it. I need to know how to return a unitcode properly, and how to use it once it is returned.
Code:
function Wave_Set_Up takes integer i returns (what, unitcode?)
    local (unitcode?) enemies
    if (i == 1) then
        set unitcode? = 'Afoo'
    endif
endfunction

function Trig_test_Actions takes nothing returns nothing
    local integer level = 1
    local integer numofunits = 10
    CreateNUnitsAtLoc(numofunits, (what to put here? Wave_Set_Up(level)?), player(0), GetTriggeringRegion(), 90)
endfunction

I know that that is just a whole buch of crap, but should I set a variable equal to what the funciton returns earlier, and then create the local variable? Help me Please.
02-21-2004, 01:48 AM#2
weaaddar
Your not a programmer but a general sign of a character to int operator is the single quote '.
The type is integer because anything inside the ' ' becomes an integer. Its converting the ascii value to its int value in case you wondered.
02-21-2004, 01:53 AM#3
Narwanza
ohhhh, i see now weaaddar. Yes, and I am not a programmer at all. Well, actuall I did work in JAVA Script for a little while, but had no real projects to do so I quit. Now I am trying to learn JASS because I actually have projects I want to do, but I am trying to go from a web-design language to OO, and it has been hard. Thanks for you patience in answering my dumb question. I will get there one day:D.