HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

bug in 1.16?

07-06-2004, 07:55 PM#1
iNfraNe
Code:
Game - Display to (All Players) the text: SLItems 'this is for debugging, SLItems is a string with item codes
set Item[1] = (Substring(SLItems,1 , 2))
set Item[2] = (Substring(SLItems,3 , 4))
set Item[3] = (Substring(SLItems,5 , 6))
set Item[4] = (Substring(SLItems,7 , 8))
set Item[5] = (Substring(SLItems,9 , 10))
set Item[6] = (Substring(SLItems,11 , 12))
For each (Integer A) from 1 to 6, do (Actions)
    Loop - Actions
        Game - Display to (All Players) the text: Item[(Integer A)] 'this is for debugging
        If (All Conditions are True) Then do (Then Actions) else do (Else Actions)
            If - Conditions
                Item[(Integer A)] Not equal to 00 '00 = no item
            Then - Actions
                Item - Create Items[(Integer(Item[(Integer A0]))] at (Position of Hero[(Player number of (Triggering player))] 'Items is an item-type array, Hero is an array of units
                Hero - Give (Last Created item) to Hero[(Player number of(Triggering player))]

ok, in my save/load system I am trying to load the items, which is viewed here. The load code works perfectly and lets say SLItems is "010203040506". The game displays that for me... but here starts the problem: It sometimes doesnt load an item, which is because an Item[] is empty, so my games would display this:
010203040506
01
"nothing here"
"nothing here"
"nothing here"
"nothing here"
"nothing here"

or
010203040506
"nothing here"
02
03
04
05
06

This I dont understand because I REALLY set them to have a substring of SLItems, which is a string of 12 characters!

Is this a bug in warcraft or am I just doing something foolish, tell me plz!

Edit: btw, I found the same error (I think) in Juliens RPG aswell... It didnt load all the items I had!
07-06-2004, 10:03 PM#2
linkmaster23
Can I be confused now?
07-07-2004, 09:28 AM#3
iNfraNe
you may be confused, but is it 'cause you dont know why it doesnt work... or just 'cause I didn't explain it too well :P
07-07-2004, 02:40 PM#4
Anitarf
If linkmaster is considering being confused, then I am definitely confused. Maybe the conversion from string to integer is buggy? Try finding this out by making a string array that goes something like this: strngAry(1)= "01", strngAry(2) = "02"... and then compare the substrings of SLItems directly to these strings, instead of making the conversion to integer.
07-07-2004, 02:44 PM#5
iNfraNe
no, the string to integer isnt bugged, I tested it. And also: my game just doesnt display the substrings, so it doesnt even matter if I do or dont get the item. it should display all substrings, but it sometimes "misses" a few...
07-07-2004, 02:57 PM#6
weaaddar
if a string is populated by null or "" then nothing will be displayed when you try to print it out using the DisplayAsTextToX or BJDebugMsg functions. Concantanating "" has no harmful effect but adding null to a string will make sure nothing is displayed.
07-07-2004, 03:04 PM#7
iNfraNe
iknow this, but the problem is, the string ISNT empty! thats why I let the game display SLItems aswell! it displays fromSLitems something like 070203010304
but then with the substring it only displays
07

or any other of same examples
07-07-2004, 03:32 PM#8
Freakazoid
First- Try using normal non-variable items.
Second (maybe litle confusing) - if owner of unit (iteming one) is playing then add ITEM to slot number * or else Nothing.

Well u have to crate more triggers for each player. :<

Hope it works ^_^
07-07-2004, 03:56 PM#9
iNfraNe
its not that problem, IF he reads the substring the item is created and given to the hero, player is in game has no use cuz he just typed -load "code" so he must be in game. its the problem the substring ISNT read! maybe its a problem that I do 6 substring after eachother?
07-08-2004, 05:52 PM#10
Ninja73
yea, like them im a little confused, but y not just do this, instead of makeing it no item, make it so that if its 00 it gives them an item that does nothing, then pick all the does nothing items and remove them. When it happens fast people wont know they ever got that item.
07-11-2004, 03:02 PM#11
randyM4A1
Quote:
Originally Posted by toot
Code:
Game - Display to (All Players) the text: SLItems 'this is for debugging, SLItems is a string with item codes
set Item[1] = (Substring(SLItems,1 , 2))
set Item[2] = (Substring(SLItems,3 , 4))
set Item[3] = (Substring(SLItems,5 , 6))
set Item[4] = (Substring(SLItems,7 , 8))
set Item[5] = (Substring(SLItems,9 , 10))
set Item[6] = (Substring(SLItems,11 , 12))
For each (Integer A) from 1 to 6, do (Actions)
    Loop - Actions
        Game - Display to (All Players) the text: Item[(Integer A)] 'this is for debugging
        If (All Conditions are True) Then do (Then Actions) else do (Else Actions)
            If - Conditions
                Item[(Integer A)] Not equal to 00 '00 = no item
            Then - Actions
                Item - Create Items[(Integer(Item[(Integer A0]))] at (Position of Hero[(Player number of (Triggering player))] 'Items is an item-type array, Hero is an array of units
                Hero - Give (Last Created item) to Hero[(Player number of(Triggering player))]

Edit: btw, I found the same error (I think) in Juliens RPG aswell... It didnt load all the items I had!


Something wrong with the SET ITEM LIST ..also your trigger is kinda weird, what i have seen in so many save/load systems from different creators ..i dont think your trigger is right...

dont mention about Julien RPG on this forum... cause that julien RPG is suck and very suck .. a little kid could make that julien rpg map ...that map lag too much cause of too many unuse dooads and julien rpg saveload system is fuked up aswell.. set item cant even combines a cinamatic cause 5 peoples drop when the game start.... !
07-11-2004, 08:25 PM#12
iNfraNe
I have done it:
I just put this part of the -load part to another trigger and it works. Guess there was nothing wrong with it and wc3 just couldnt handle the pressure. Thx for your help all, tho it didnt fix the problem :/