Results 1 to 10 of 10

Thread: Can VB be configured to read such a language?

  1. #1

    Thread Starter
    Member Doomguy0505's Avatar
    Join Date
    Apr 2005
    Posts
    55

    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

  2. #2
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    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

    Visual Studio 6, Visual Studio.NET 2005, MASM

  3. #3
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    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?

  4. #4

    Thread Starter
    Member Doomguy0505's Avatar
    Join Date
    Apr 2005
    Posts
    55

    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

  5. #5

    Thread Starter
    Member Doomguy0505's Avatar
    Join Date
    Apr 2005
    Posts
    55

    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

  6. #6
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    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

    Visual Studio 6, Visual Studio.NET 2005, MASM

  7. #7
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    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
    Attached Files Attached Files

    Visual Studio 6, Visual Studio.NET 2005, MASM

  8. #8

    Thread Starter
    Member Doomguy0505's Avatar
    Join Date
    Apr 2005
    Posts
    55

    Angry 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

  9. #9
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    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:
    1. 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:
    1. If (UCase$(Mid$(str, currPos, [b]5[/b])) = "ACTOR") Then
    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  10. #10
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Can VB be configured to read such a language?

    Oh, and also, this line:
    VB Code:
    1. 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:
    1. Characters(num_characters).name = GetValue(Trim$(Replace$(Mid$(str, currPos + [b]6[/b], (InStr(currPos + 1, str, "{") - (currPos + [b]6[/b]))), vbNewLine, "")))
    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width