Hey, I hate to bother you again and I hope your not tired of me but I am back in the pit
I added the following type\data and checked it and other new command lines I added with text commands (Not shown here) and it works great:
*************************************************
[code>
Type BGcountertype ;BattleGroup counter type
Field BGName$
Field Races$
Field WhichBattleGroup$
Field Whichgroup%
Field OrigX%
Field OrigY%
End Type
Restore ShipData
bData = True
While bData
Read BGName$
If BGName$ = "STOP"
bData = False
Else
Read Races$
Read WhichBattleGroup$
Read Whichgroup%
Read OrigX%
Read OrigY%
CurrentBG.BGcountertype = New BGcountertype
If CurrentBG.BGcountertype <> Null
CurrentBG\BGName$ = BGName$
CurrentBG\Races$ = Races$
CurrentBG\WhichBattleGroup$ = WhichBattleGroup$
CurrentBG\Whichgroup% = Whichgroup%
CurrentBG\OrigX% = OrigX%
CurrentBG\OrigY% = OrigY%
Else
Text 0,0, "Error BGcountertype could not build a CurrentBG instance of itself"
bData = False
EndIf
EndIf
Wend
Cls
.ShipData
Data "Talon" ,"Avari" ,"Fleets" ,1,34,4
Data "Saber" ,"Karn" ,"Fleets" ,2,34,5
Data "Puma" ,"Karn" ,"Fleets" ,3,34,6
Data "STOP"
/<code]
***************************************************
But I can't get it to work with your init loop. Here is what I tried so far. The following works good!
**************************************************
[code]
imgcounter = LoadAnimImage(Race$+WhichBattleGroup$+".bmp",43,32,0,5)
Race$ = Races$ ;Avari,Aqid,Entog,Repton,Karn
WhichBattlegroup$ = WhichBattleGroup$ ;Fleets,Patrols,SConvoys
Howmanygroups=Whichgroup%;From 1-5
;The next area is where the problem begins. I used my fields in type "BGcountertype" to prep the loop but the data doesn't come out as I expect. I thought the "Each BGcountertype" command below, loads every order of the type data as it is in ".shipdata" but it doesn't!
For current turn = 1 to 3 ; sample game with 3 turns
For i% = 1 To Howmanygroups
For CurrentBG.BGcountertype = Each BGcountertype
f.fleetcounterorder = New fleetcounterorder
f\x = OrigX%*32 ;change "i" to an actual placement
f\y = OrigY%*32 ;change "i" to an actual placement
f\image = i-1
Next
Next
Next
/[code]
*************************************************
The problem is it simply draws the last data set from .shipdata. Also as you can see I would like to loop the whole init loop to replace the counters each turn but the loop adds more counters each turn instaed of using the original ones.
Also I still can't figure out how to do this with the <code> thingy, In preview it shows nothing. You can email me a sample clausbohm@... if you want?
(P.S. By the way the 43 pixels is nessesary due to the way I built the image as a circle with a little overhang. It looks great on the board!)
I added the following type\data and checked it and other new command lines I added with text commands (Not shown here) and it works great:
*************************************************
[code>
Type BGcountertype ;BattleGroup counter type
Field BGName$
Field Races$
Field WhichBattleGroup$
Field Whichgroup%
Field OrigX%
Field OrigY%
End Type
Restore ShipData
bData = True
While bData
Read BGName$
If BGName$ = "STOP"
bData = False
Else
Read Races$
Read WhichBattleGroup$
Read Whichgroup%
Read OrigX%
Read OrigY%
CurrentBG.BGcountertype = New BGcountertype
If CurrentBG.BGcountertype <> Null
CurrentBG\BGName$ = BGName$
CurrentBG\Races$ = Races$
CurrentBG\WhichBattleGroup$ = WhichBattleGroup$
CurrentBG\Whichgroup% = Whichgroup%
CurrentBG\OrigX% = OrigX%
CurrentBG\OrigY% = OrigY%
Else
Text 0,0, "Error BGcountertype could not build a CurrentBG instance of itself"
bData = False
EndIf
EndIf
Wend
Cls
.ShipData
Data "Talon" ,"Avari" ,"Fleets" ,1,34,4
Data "Saber" ,"Karn" ,"Fleets" ,2,34,5
Data "Puma" ,"Karn" ,"Fleets" ,3,34,6
Data "STOP"
/<code]
***************************************************
But I can't get it to work with your init loop. Here is what I tried so far. The following works good!
**************************************************
[code]
imgcounter = LoadAnimImage(Race$+WhichBattleGroup$+".bmp",43,32,0,5)
Race$ = Races$ ;Avari,Aqid,Entog,Repton,Karn
WhichBattlegroup$ = WhichBattleGroup$ ;Fleets,Patrols,SConvoys
Howmanygroups=Whichgroup%;From 1-5
;The next area is where the problem begins. I used my fields in type "BGcountertype" to prep the loop but the data doesn't come out as I expect. I thought the "Each BGcountertype" command below, loads every order of the type data as it is in ".shipdata" but it doesn't!
For current turn = 1 to 3 ; sample game with 3 turns
For i% = 1 To Howmanygroups
For CurrentBG.BGcountertype = Each BGcountertype
f.fleetcounterorder = New fleetcounterorder
f\x = OrigX%*32 ;change "i" to an actual placement
f\y = OrigY%*32 ;change "i" to an actual placement
f\image = i-1
Next
Next
Next
/[code]
*************************************************
The problem is it simply draws the last data set from .shipdata. Also as you can see I would like to loop the whole init loop to replace the counters each turn but the loop adds more counters each turn instaed of using the original ones.
Also I still can't figure out how to do this with the <code> thingy, In preview it shows nothing. You can email me a sample clausbohm@... if you want?
(P.S. By the way the 43 pixels is nessesary due to the way I built the image as a circle with a little overhang. It looks great on the board!)