Can VB be configured to read such a language?
I am trying to make a visual basic program able to put the information to variables
Can Visual Basic 6 be coded read a language like this
Code:
actor NamiDarkImp 3100
{
Health 120
Radius 20
Height 56
Speed 8
PainChance 200
MONSTER
+FLOORCLIP
+FOILINVUL
SeeSound "imp/sight"
PainSound "imp/pain"
DeathSound "imp/death"
ActiveSound "imp/active"
MeleeSound "imp/melee"
Obituary "%o was cursed by a dark imp."
HitObituary "%o was touched by a dark imp."
MissileType DarkSeeker
MeleeDamage 3
States
{
Spawn:
DRKI AB 10 A_Look
Loop
See:
DRKI AABBCCDD 3 A_Chase
Loop
Melee:
Missile:
DRKI EF 8 A_FaceTarget
DRKI G 6 A_ComboAttack
Goto See
Pain:
DRKI H 2
DRKI H 2 A_Pain
Goto See
Death:
DRKI I 100
DRKI J 8 A_Scream
DRKI K 6
DRKI L 6 A_Fall
DRKI M -1
Stop
XDeath:
DRKI N 5
DRKI O 10 A_XScream
DRKI P 5
DRKI Q 5 A_Fall
DRKI RST 5
DRKI U -1
Stop
Raise:
DRKI ML 8
DRKI KJI 6
Goto See
}
}
Don't copy this to VB, this is a game language
Re: Can VB be configured to read such a language?
Yes it can be used to read a language like that. I assume you want someone to write you something? We might need a bit of information on how you want the data to be available..
chem
Re: Can VB be configured to read such a language?
How is it stored? In a text file?
What do the words mean?
Is the first part a list of properties and the second part instructions for actions?
And what should be done with it once it is read?
Re: Can VB be configured to read such a language?
From text files
actor is telling the format of it and NamiDarkImp is the name of the thing and 3100 is a number for placing it
And you should be able to tell what each of the values mean
Re: Can VB be configured to read such a language?
Quote:
Originally Posted by chemicalNova
Yes it can be used to read a language like that. I assume you want someone to write you something? We might need a bit of information on how you want the data to be available..
chem
in code tags or an attachment would be fine
Re: Can VB be configured to read such a language?
I'll write up an example of parsing something [b]like[/b[ this, but I won't be doing the exact same language, because I don't know how you want them stored. Give me about 10 minutes..
chem
1 Attachment(s)
Re: Can VB be configured to read such a language?
Ok, I know it took a while, but meh, I had phone calls and stuff coming from left right, and center.
The language is basic, you can find it in script.txt inside the attachment. You should be able to add to it.
Hope that helps,
chem
Re: Can VB be configured to read such a language?
I change CHARACTERPROC to actor both in the program and text file it is and I get subscript out of range
Re: Can VB be configured to read such a language?
That's because:
The way it works is by moving through the script 1 character at a time. Each time it moves forward, it checks a certain length ahead, for a keyword. So:
VB Code:
If (UCase$(Mid$(str, currPos, [b]13[/b])) = "ACTOR") Then
..will not execute at all, because "ACTOR" isn't 13 characters long. So change it to:
VB Code:
If (UCase$(Mid$(str, currPos, [b]5[/b])) = "ACTOR") Then
chem
Re: Can VB be configured to read such a language?
Oh, and also, this line:
VB Code:
Characters(num_characters).name = GetValue(Trim$(Replace$(Mid$(str, currPos + [b]14[/b], (InStr(currPos + 1, str, "{") - (currPos + [b]14[/b]))), vbNewLine, "")))
the currPos+14 means it passes the CHARACTERPROC bit by 1 more than the length of CHARACTERPROC. So, change it to:
VB Code:
Characters(num_characters).name = GetValue(Trim$(Replace$(Mid$(str, currPos + [b]6[/b], (InStr(currPos + 1, str, "{") - (currPos + [b]6[/b]))), vbNewLine, "")))
chem