well though i'm sure these commands are nice to have, it doesn't work the way i'd hoped. If I do:
Type playerlist
Field player$
End Type
Type player
Field name$
End Type
p.playerlist=New playerlist
player$="jack"
p\player$=Handle(New player)
pl.player=Object.player(p\player$)
pl\name$="Jack"
Print pl\name$
player$="john"
p\player$=Handle(New player)
pl.player=Object.player(p\player$)
pl\name$="john"
Print pl\name$
For pl.player=Each player
Print pl\name$
Next
player$="jack"
pl.player=Object.player(p\player$)
Print pl\name$
WaitKey()
It makes two players, but It only saves one player$, which means i'd still have to revert to use arrays so it doesn't help any. The thing i was trying to avoid was for next loops, and redimming an array(well sorta), so i could have some type of pointer to that player. Right now what i'm doing is dimming p.player by 1000. And keeping a continous usercount, so each player increments ucount by 1 so i can have a pointer?(if this is the right word) to it. But when a player hangs, it resaves information to each player, well heres what i'm using right now:
Function Logoff(p.player)
If Not Eof(p\stream)
Print p\name$+" has logged off!"
WriteLine p\stream, "GOODBYE!...come back soon!"
CloseTCPStream(p\stream)
EndIf
jhk=p\playerID
;Print "player id deleteing: "+jhk
Select True
Case jhk=1 And ucount#=1
ucount#=oucount#-1
Delete pl(1)
Case jhk=ucount#
Delete pl(ucount#)
ucount#=ucount#-1
Case jhk<>ucount#
jhk=jhk+1
For x=jhk To ucount# Step 1
Print "Redimming player #"+x
k=x-1
stream=pl(x)\stream
pl (k)\stream=stream
;Print "player_id"+pl(x)\playerID+" larger Then A!="+a
pl(k)\playerid=pl(x)\PlayerId-1
pl(k)\status=pl(x)\status
pl(k)\level=pl(x)\level
pl(k)\name$=pl(x)\name$
pl(k)\password$=pl(x)\password$
pl(k)\password$=pl(x)\Curr_Area
pl(k)\curr_room=pl(x)\curr_room
pl(k)\title$=pl(x)\title$
pl(k)\pclass$=pl(x)\pclass$
pl(k)\prace$=pl(x)\prace$
pl(k)\pracenumber=pl(x)\pracenumber ;?
pl(k)\pclassnumber=pl(x)\pclassnumber;?
pl(k)\sex$=pl(x)\sex$
pl(k)\comm=pl(x)\comm
pl(k)\experience#=pl(x)\experience#
pl(k)\baseexp#=pl(x)\baseexp#
pl(k)\exptnl#=pl(x)\exptnl#
Next
Print "Deleting player#"+ucount#
Delete pl(ucount#)
ucount#=ucount#-1
End Select
Print "End Logoff"
End Function
What would be nice if i could input a name, or string to use as a variable or in an array so that i could input the players name from readstream, which would be from a string. Right now I have to use numbers. Using a string$ as a pointer to that variable would be very nice. for example:
Currently it works like this:
command="kill" target="Dave"
finds him on room\alsohere ; x
grabs his playersid;which looks like this:
y=a(curr_area)\ro[curr_room]\al[x]\Alsoid
then check p(y)(player) for all the other game crap
The only other way to do this would be to run a bunch of for next loop, which would be horrible for time/effiency,etc, considering i'd have to loop several times for each player. Wether it be writing to the player, the players in the rooms, adjancent rooms, etc.
it'd be nice if i could use there name, unless theres some other way, if there is, lemme know.