EnglishFrançaisItalianoDeutschEspañolPortuguês
 Language
 CORE
 Home
 Astrogation
 Dean Files
 Adventure

Quest Language

A simple language was created for storing quests in. The would enable non-coders to write and donate quests to the game.  In retrospect, it is rather code like and I guess you would really need to know some sort of programming to make full use of.

Anyway, it can define a number of quest items, either locations, people, cargo, or cash amounts. The quest is a statement. Certain subroutines are activate at certain times. When active the game checks them periodically and when they evaluate as runnable that segment is run.

The best way to describe it is through an example. See below.

The quest engine is pretty much finished. All that needs to be done is a slightly more clever expression evaluation for the Boolean evaluatoins.

TITLE "New Natural Resource"
SUB MAIN Ship:docked & Ship:getHoldFree>30 & Acct:canAfford(2500*30)
    loc1=newLocation("{here}")
    pers1=newPerson(".")
    cargo1=newCargo("name=Ferrus Metal Ore.tons=30.value=5000")
    dosh1=newDosh("30*2500")
    if yesNo(_
    "Greetings. I am "+pers1:name+" of Agar Industries. A nearby planet,_
    which for reasons of confidentiality I cannot name, has the advantage_
    of possessing a completely cooled core. Consequently it is possible_
    to dig right down to the centre where the, almost pure, Iron Ore_
    has collected. We are in the market testing phase of our operation_
    and have "+cargo1:tons+" available for purchase at the discount price_
    of "+dosh1+". Would you be interested in engaging in this trial?") then
        ok("Then good day and I hope you will traffic in Agar Industries _
        products in the near future.")
        done
        return
    endif
    if buy("dosh1",cargo1) then
        ok("We are pleased to reccomend Delgado Finance for credit operations. Next time.")
        done
        return
    end if
    ok("Thank you for your business.")
    add(cargo1)
    activate("Gone")
    deactivate("MAIN")
    setStatus("Market testing "+cargo1:name+" for Agar Associates.")
END SUB
SUB Gone at(cargo1)=0
    deactivate(Gone)
    date1=newDate(D(3))
    activate("Followup")
END SUB
SUB Followup at(date1)
    ok("A message arrives from Agar Industries.")
    ok("Dear "+captain+", Thank you for participating in an Agar Industries_
     market test. It was necessary to charge you for your help in order to_
     gain true market data. Now that the data has been collected we are_
     pleased to refund you the money you invested. -"+pers1:name+".")
    add(dosh1)
    reputationIncr(AGAR, 1)
    done
END SUB
 

up