Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Important Var..and stuff

Author
Message
Oneka
21
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 25th Apr 2004 00:29
Okie how do I know if a variable is assinged to what?
like in BYOND
you would call the player's var like this
mob/var/ABC // defines ABC as a variable
usr.ABC = 0 // player's variable to 0
or if i wanted to call a mob or another player it would be this
for(var/mob/M in oview(3))// the range from the player exlcudeing his/her box
M.ABC = 1// set the variable to a number
how would you do this in DarkBasic?

Oneka productions
Daikanu Online
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 25th Apr 2004 01:57 Edited at: 25th Apr 2004 01:58
hmmm! strange weird language alert!, variables in Pro/classic are like this

number=123

number#=1.23

name$="abc"

guessing a bit, in order, the equivalents to what you posted are something like

mob/var/ABC // defines ABC as a variable ---- not needed, variables are created when given a value

usr.ABC = 0 // player's variable to 0 ---- player=0 or you could use types, check the help file on types.

for(var/mob/M in oview(3))// the range from the player exlcudeing his/her box ----- I think there is no direct equivalent, looks to be something like an atom or somesuch

M.ABC = 1// set the variable to a number --- player=123

again you could emulate the structure of the variable names by using types, but in basic variables are normaly created when assigned a value, apart from the aformentioned types and arrays, here I create a number and add another too it, then create an array and fill it with 9`s, then I create a type and load three values into it


number=123
another_value=456
answer=number+another_value
print answer

dim a(300)
for i=1 to 300
a(i)=9
next i

type unit
xpos
ypos
health
endtype

myplayer as unit

myplayer.xpos=20
myplayer.ypos=40
myplayer.health=100

these just allow for better ordering and association of variables, they don`t bear any relation (I think) to the variables you mentioned, I am assuming they are a mixture of user and system variables something like the system used in the Div games creator, where each item created has some system defined values allocated automaticaly, and the user can add others to customise the procedure (or something like that), you might want to look up a basic primer and check out variables for the basic language, they are the same for the most part as DarkBasics, cheers.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, ATI radeon 9800 pro gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.

Login to post a reply

Server time is: 2025-05-23 11:05:11
Your offset time is: 2025-05-23 11:05:11