HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Why the **** is this giving me "Invalid Arguement- Integer"

02-17-2004, 08:57 PM#1
LegolasArcher
Im making a JASS spell, that requires texttags. This is what I have so far:
Code:
local integer one = GetRandomInt(1, 3)
local integer two = GetRandomInt(1, 3)
local integer three = GetRandomInt(1, 3)
local string combo = I2S(one) + " " + I2S(two) + " " + I2S(three)
local texttag disp = CreateTextTag()
call DisplayTextToPlayer(0, 0, 0, combo)
call SetTextTagText(disp, combo, 0.00)
call SetTextTagPosUnit(disp, GetSpellAbilityUnit(), 20.00)
call SetTextTagColor(disp, 100, 80, 20, 0)
call SetTextTagVisibility(disp, true)
Whenever I use a real (or try to) I get "Invalid Arguement type- Integer". So I looked at a converted "set real variable" action and I saw: "##.##". So I added my 0's, yet it still give the same ****ing error. Also, don't tell me to use an array for the 3 numbers, fo rthat's not the issue. Also, I dug though JASS.sourceforge.net but couldn't locate the form for reals. I would be overjoyed if this was answered.


Im sort of a n00b at JASS, and I appologize.
02-17-2004, 10:00 PM#2
Vidstige
Try changing from
Code:
call DisplayTextToPlayer(0, 0, 0, combo)
to
Code:
call DisplayTextToPlayer(Player(0), 0, 0, combo)
The first argument is not of type integer, but of type player.
02-17-2004, 10:49 PM#3
LegolasArcher
Its ironic my debug line cause that. I was going to change it to that, I must hav elost my train of thought though.

The other thing it was showing a different line iwth the error on it. Well it works, thanks:D

Now Im rwally puzzled (this is my first JASS spell. When I display the text I see a period, and nothing more. Heres my updated code:

Code:
    local integer one = GetRandomInt(1, 3)
    local integer two = GetRandomInt(1, 3)
    local integer three = GetRandomInt(1, 3)
    local string combo = I2S(one) + " " + I2S(two) + " " + I2S(three)
    local texttag disp = CreateTextTag()
    local integer i = 1
    local effect array Gold
    local boolean won = false
    call SetTextTagText(disp, combo, 0.00)
    call SetTextTagPosUnit(disp, GetSpellAbilityUnit(), 20.00)
    //call SetTextTagColor(disp, 100, 80, 20, 0)
    call SetTextTagVisibility(disp, true)
    if (one == two or two == three) then
        set won = true
    endif
    set Gold[0] = AddSpecialEffectTargetUnitBJ("overhead", GetSpellAbilityUnit(), "Objects\\InventoryItems\\TreasureChest\\treasurechest.mdl")
    loop
        exitwhen i == 10
        set Gold[i] = AddSpecialEffectTargetUnitBJ( "overhead", GetSpellAbilityUnit(), "UI\\Feedback\\GoldCredit\\GoldCredit.mdl" )
        set i = i + 1
        call TriggerSleepAction(.1)
    endloop
    set i = 1
    call TriggerSleepAction(1.5)
    call DestroyEffect(Gold[0])
    loop
        exitwhen i == 10
        call DestroyEffect(Gold[i])
        set i = i + 1
    endloop
    call TriggerSleepAction(3)
    call DestroyTextTag(disp)
02-17-2004, 11:11 PM#4
Vidstige
I have no clue how to use texttags unfortunetly, a quick test with your code didn't give me any visual output at all though.
02-17-2004, 11:43 PM#5
LegolasArcher
I just caught the period, its tiny, and I was lucky to see it on dark terrian. I hope someone could help me with thit, but thanks for trying. Its my first JASS texttag XP aswell.