HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

I2S conversion problems from ai-script

06-08-2003, 08:31 PM#1
Vidstige
Does ai-scripts have any problems with the conversion functions?

native I2S takes integer i returns string

absolutely refuses to make a proper conversion when called
from below code in an ai-script.

Code:
function aiLoop takes nothing returns nothing
	local integer j = 0
	loop
		exitwhen gShutdown == true

		call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "-->" + I2S(j) + "<--")
		call Sleep(2)

		set j = j + 1
	endloop
endfunction

The code only produces --><--.

Any suggestions on what might be the problem? I2S works
well when called from a normal trigger. emote_confused
06-08-2003, 08:58 PM#2
AIAndy
I2S does not work from AI. Callbacks in common.j also do not work so all natives from there that take code will not work properly. I guess that with I2S is that functions that return strings do not work.
As a workaround you can use the function Int2Str from my AMAI common.ai .
06-08-2003, 09:37 PM#3
Vidstige
Thanks!

I will keep your file close to know when it's time for workarounds.

You don't happen to have an ai-script tutorial laying around. :gsmile:
06-11-2003, 02:23 AM#4
Guest
Quote:
Originally posted by Vidstige
Thanks!

I will keep your file close to know when it's time for workarounds.

You don't happen to have an ai-script tutorial laying around. :gsmile:


Ditto...

What would be great in leui of a tutorial (cos they take a loooong time to produce) is just a FAQ on what can and cannot be done in AI. I know about the thing already mentioned like in this post, but conceptually I haven't yet worked out what is possible in ai scripts.

e.g. I assume it is possible to:
- select units matching one or more conditions
- order units do to things (attack/move/upgrade/build etc)

But can you say
- create units (not build)
- move units instantly

I assume not because of course these functions are all in blizzard.j

While I'm wishing for stuff, as a n00b to JASS I'd love a quick reference guide to show the relationship between Triggers in WE to their JASS equivalents. If this does not already exist then I will start compiling one - I expect that after a few weeks of JASS immersion it will become fairly second nature anyhow...

oh and I wish for world peace and an end to famine too :)

lol
06-11-2003, 02:40 AM#5
AIAndy
The functions in Blizzard.j only use natives in common.j so you do not really lose functionality from not having Blizzard.j .
That means:
You can create units
You can move units instantly

The only real loss in functionality comes from the loss of callbacks which makes especially triggers unusable.
06-11-2003, 07:13 AM#6
Guest
Quote:
Originally posted by AIAndy
The functions in Blizzard.j only use natives in common.j so you do not really lose functionality from not having Blizzard.j .
That means:
You can create units
You can move units instantly

The only real loss in functionality comes from the loss of callbacks which makes especially triggers unusable.


*rubs hands in glee*

thanks for the tip! always good to ask when you don't know for sure...Assumptions at the outset are bad news :)

Cheers