Pages: 1 ... 4 5 [6]
|
|
|
Author
|
Topic: Project 6014 Demo v 0.2 release (Read 23339 times)
|
|
dczanik
*Smell* controller
Offline
Posts: 306
|
Well, it's fixed. You can open it up in Gimp too. Just hide or delete the layer. You should put up the .SVG files too.
|
|
|
Logged
|
|
|
|
Megagun
Enlightened
Offline
Gender:
Posts: 580
Moo
|
Great.
A spoiler-free A4-printable starmap, plus an "interactive starmap" which you can drag around and zoom inside your browser are available on the Downloads page: http://code.google.com/p/project6014/wiki/Downloads
Also, .deb packages for Ubuntu Linux / Linux Mint / Debian are now available!
|
|
|
Logged
|
|
|
|
|
dczanik
*Smell* controller
Offline
Posts: 306
|
Sure!
If you're looking for a new release, it's not going to happen for months. I'd like to shoot for the end of the year, but I don't think that's happening. There's just too much to do and not enough free time. Until then, my side project called Ur-Quan Masters HD should be released fairly soon.
As far as updates, go. Project 6014 isn't dead, just quiet. Instead of a new demo, we'd like to just release the full game. And this creates a lot more work for the writers. But on the art side, We've got new artwork, and new animation. We've also re-written the entire dialog system to a simple scripting language. On the writing side, I've created some preliminary stuff for the Mycon that I find interesting.
The new dialog system is the most exciting part for me. Now, you can just open a text file and change the dialog and conversation logic/flow without needing to be a programmer. No need to compile C code. Should be much easier for anybody to write their own adventures.
As an example:
greeting Hello Captain! .main
node main
option Hello Alien! We've missed you Captain. .main
option I must be going. Goodbye Captain! .done
.main
That just greets the captain, then gives you 2 dialog choices. You can test out your own stuff here: http://mooses.nl/uqm/wip/js-dialogue/# The example dialog button shows you what the system can do.
Full documentation can be seen here: http://code.google.com/p/project6014/wiki/DialogLanguage
Anyways. I hope that helps to satiate any curiosity and dispels any worries. We've had several updates to the game this week. We're not dead.
|
|
|
Logged
|
|
|
|
|
Death 999
Global Moderator
Enlightened
Offline
Gender:
Posts: 3874
We did. You did. Yes we can. No.
|
Indirectly - it's compatible with the existing UQM system. Each block of text goes into a string table. You map the entries on this string table to the filenames of the voice-acting files.
Obviously, changing the lines invalidates the voice-acting.
|
|
« Last Edit: May 27, 2012, 02:17:07 am by Death 999 »
|
Logged
|
|
|
|
|
meep-eep
Forum Admin
Enlightened
Offline
Posts: 2847
|
Interesting.
It so happens that my latest project for UQM was making it possible to put the dialog structure in the content, though it's been two months since I actually worked on it. My approach is different, though, as my goals are different. I like your design however, and my initial plan was something more in that direction, with a declarative instead of an imperative language.
Some of my own considerations were:
- it should be powerful enough to handle the existing UQM dialogs, with all its side effects, including making/breaking alliances, giving ships, landers, resource units, scheduling game events, etc.
- it should be close to the original, so that we can convert the existing dialogs, instead of having to reimplement them. Especially the amount of debugging involved would be a concern (an in fact, it still is the largest problem, even with the approach chosen)
- the actual dialog strings and the dialog logic should be separate, to make translations and the association with speech samples easy
So what I ended up implementing were Lua bindings for UQM, together with string interpolation for the speech files. Lua is a relatively fast scripting language, which is often used for applications such as this (see here).
As an example, here is the Lua script for the Arilou:
function exitConversation(r) comm.setSegue(comm.segue.depart)
if r == "bye_angry_space" then comm.doNpcPhrase("GOODBYE_ANGRY_SPACE") elseif r == "bye_friendly_space" then comm.doNpcPhrase("GOODBYE_FRIENDLY_SPACE") elseif r == "bye_friendly_homeworld" then comm.doNpcPhrase("GOODBYE_FRDLY_HOMEWORLD") elseif r == "lets_fight" then comm.doNpcPhrase("NO_FIGHT") elseif r == "bug_eyed_fruitcakes" then comm.doNpcPhrase("WE_NEVER_FRIENDS")
state.prop.set("ARILOU_MANNER", 2) elseif r == "best_if_i_killed_you" then comm.doNpcPhrase("WICKED_HUMAN")
state.prop.set("ARILOU_MANNER", 2) end end
function arilouHome(r) local lastStack = 0 local pStr = { nil, nil, nil, nil }
if r == "confused_by_hello" then comm.doNpcPhrase("CONFUSED_RESPONSE") elseif r == "happy_by_hello" then comm.doNpcPhrase("HAPPY_RESPONSE") elseif r == "miffed_by_hello" then comm.doNpcPhrase("MIFFED_RESPONSE") elseif r == "ok_lets_be_friends" then comm.doNpcPhrase("NO_ALLY_BUT_MUCH_GIVE") elseif r == "what_about_war" then comm.doNpcPhrase("ABOUT_WAR")
state.prop.set("ARILOU_STACK_1", 1) elseif r == "what_about_urquan" then comm.doNpcPhrase("ABOUT_URQUAN")
state.prop.set("ARILOU_STACK_1", 2) elseif r == "tell_arilou_about_tpet" then comm.doNpcPhrase("BAD_NEWS_ABOUT_TPET")
lastStack = 1 state.prop.set("ARILOU_STACK_2", 1) elseif r == "what_do_about_tpet" then comm.doNpcPhrase("DANGEROUS_BUT_USEFUL")
lastStack = 1 state.prop.set("ARILOU_STACK_2", 2) elseif r == "learned_about_umgah" then if state.prop.get("ARILOU_CHECKED_UMGAH") ~= 2 then comm.doNpcPhrase("NO_NEWS_YET") else comm.doNpcPhrase("UMGAH_UNDER_COMPULSION")
lastStack = 1 end
comm.disablePhrase("learned_about_umgah") elseif r == "umgah_acting_weird" then comm.doNpcPhrase("WELL_GO_CHECK")
state.prop.set("ARILOU_CHECKED_UMGAH", 1) event.addRelative(0, 0, 10, "ARILOU_UMGAH_CHECK") comm.disablePhrase("umgah_acting_weird") elseif r == "what_do_now" then comm.doNpcPhrase("GO_FIND_OUT")
state.prop.set("ARILOU_CHECKED_UMGAH", 3) elseif r == "what_did_on_earth" then comm.doNpcPhrase("DID_THIS")
lastStack = 2 state.prop.set("ARILOU_STACK_3", 1) elseif r == "why_did_this" then comm.doNpcPhrase("IDF_PARASITES")
lastStack = 2 state.prop.set("ARILOU_STACK_3", 2) elseif r == "tell_more" then comm.doNpcPhrase("NOT_NOW")
lastStack = 2 state.prop.set("ARILOU_STACK_3", 3) elseif r == "what_give_me" then comm.doNpcPhrase("ABOUT_PORTAL")
lastStack = 3 state.prop.set("KNOW_ARILOU_WANT_WRECK", 1)
r = "about_portal_again" --[[ XXX: What is the idea behind this? It does not do -- anything. - SvdB ]] comm.disablePhrase("what_give_me") elseif r == "what_about_tpet" then comm.doNpcPhrase("ABOUT_TPET")
state.prop.set("ARILOU_STACK_4", 1) elseif r == "about_portal_again" then comm.doNpcPhrase("PORTAL_AGAIN")
comm.disablePhrase("about_portal_again") elseif r == "got_it" then if state.prop.get("ARILOU_HOME_VISITS") == 1 then comm.doNpcPhrase("CLEVER_HUMAN") end comm.doNpcPhrase("GIVE_PORTAL")
state.prop.set("PORTAL_KEY_ON_SHIP", 0) state.prop.set("PORTAL_SPAWNER", 1) state.prop.set("PORTAL_SPAWNER_ON_SHIP", 1) --[[ #ifdef NEVER elseif r == "got_tpet" then comm.doNpcPhrase("OK_GOT_TPET")
state.prop.set("ARILOU_STACK_2", 1) ]] end
local arilouStack1 = state.prop.get("ARILOU_STACK_1") if arilouStack1 == 0 then pStr[0] = "what_about_war" elseif arilouStack1 == 1 then pStr[0] = "what_about_urquan" end if state.prop.get("TALKING_PET") > 0 then --[[ #ifdef NEVER if state.prop.get("ARILOU_STACK_2") == 0 then pStr[1] = "got_tpet" ]] else if state.prop.get("TALKING_PET_VISITS") > 0 then local arilouStack2 = state.prop.get("ARILOU_STACK_2") if arilouStack2 == 0 then pStr[1] = "tell_arilou_about_tpet" elseif arilouStack2 == 1 then pStr[1] = "what_do_about_tpet" end elseif state.prop.get("KNOW_UMGAH_ZOMBIES") > 0 then if state.prop.get("ARILOU_CHECKED_UMGAH") == 0 then pStr[1] = "umgah_acting_weird" elseif comm.isPhraseEnabled("learned_about_umgah") and comm.isPhraseEnabled("umgah_acting_weird") then pStr[1] = "learned_about_umgah" elseif state.prop.get("ARILOU_CHECKED_UMGAH") == 2 then pStr[1] = "what_do_now" end end end
local arilouStack3 = state.prop.get("ARILOU_STACK_3") if arilouStack3 == 0 then pStr[2] = "what_did_on_earth" elseif arilouStack3 == 1 then pStr[2] = "why_did_this" elseif arilouStack3 == 2 then pStr[2] = "tell_more" end
if state.prop.get("KNOW_ARILOU_WANT_WRECK") == 0 then pStr[3] = "what_give_me" elseif state.prop.get("ARILOU_STACK_4") == 0 then pStr[3] = "what_about_tpet" end --[[ XXX: What is the idea behind this? It does not do -- anything. - SvdB ]] comm.disablePhrase("what_give_me") elseif r == "what_about_tpet" then comm.doNpcPhrase("ABOUT_TPET")
state.prop.set("ARILOU_STACK_4", 1) elseif r == "about_portal_again" then comm.doNpcPhrase("PORTAL_AGAIN")
comm.disablePhrase("about_portal_again") elseif r == "got_it" then if state.prop.get("ARILOU_HOME_VISITS") == 1 then comm.doNpcPhrase("CLEVER_HUMAN") end comm.doNpcPhrase("GIVE_PORTAL")
state.prop.set("PORTAL_KEY_ON_SHIP", 0) state.prop.set("PORTAL_SPAWNER", 1) state.prop.set("PORTAL_SPAWNER_ON_SHIP", 1) --[[ #ifdef NEVER elseif r == "got_tpet" then comm.doNpcPhrase("OK_GOT_TPET")
state.prop.set("ARILOU_STACK_2", 1) ]] end
local arilouStack1 = state.prop.get("ARILOU_STACK_1") if arilouStack1 == 0 then pStr[0] = "what_about_war" elseif arilouStack1 == 1 then pStr[0] = "what_about_urquan" end if state.prop.get("TALKING_PET") > 0 then --[[ #ifdef NEVER if state.prop.get("ARILOU_STACK_2") == 0 then pStr[1] = "got_tpet" ]] else if state.prop.get("TALKING_PET_VISITS") > 0 then local arilouStack2 = state.prop.get("ARILOU_STACK_2") if arilouStack2 == 0 then pStr[1] = "tell_arilou_about_tpet" elseif arilouStack2 == 1 then pStr[1] = "what_do_about_tpet" end elseif state.prop.get("KNOW_UMGAH_ZOMBIES") > 0 then if state.prop.get("ARILOU_CHECKED_UMGAH") == 0 then pStr[1] = "umgah_acting_weird" elseif comm.isPhraseEnabled("learned_about_umgah") and comm.isPhraseEnabled("umgah_acting_weird") then pStr[1] = "learned_about_umgah" elseif state.prop.get("ARILOU_CHECKED_UMGAH") == 2 then pStr[1] = "what_do_now" end end end
local arilouStack3 = state.prop.get("ARILOU_STACK_3") if arilouStack3 == 0 then pStr[2] = "what_did_on_earth" elseif arilouStack3 == 1 then pStr[2] = "why_did_this" elseif arilouStack3 == 2 then pStr[2] = "tell_more" end
if state.prop.get("KNOW_ARILOU_WANT_WRECK") == 0 then pStr[3] = "what_give_me" elseif state.prop.get("ARILOU_STACK_4") == 0 then pStr[3] = "what_about_tpet" end
if pStr[lastStack] ~= nil then comm.addResponse(pStr[lastStack], arilouHome) end
local i for i = 0, 3 do if i ~= lastStack and pStr[i] ~= nil then comm.addResponse(pStr[i], arilouHome) end end
if state.prop.get("KNOW_ARILOU_WANT_WRECK") > 0 then if state.prop.get("PORTAL_KEY_ON_SHIP") > 0 then comm.addResponse("got_it", arilouHome) elseif comm.isPhraseEnabled("about_portal_again") and state.prop.get("PORTAL_SPAWNER") == 0 then comm.addResponse("about_portal_again", arilouHome) end end if state.prop.get("ARILOU_MANNER") ~= 3 then comm.addResponse("best_if_i_killed_you", exitConversation) end comm.addResponse("bye_friendly_homeworld", exitConversation) end
function angryHomeArilou(r) if r == "invaders_from_mars" then comm.doNpcPhrase("HAD_OUR_REASONS")
comm.disablePhrase("invaders_from_mars") elseif r == "why_should_i_trust" then comm.doNpcPhrase("TRUST_BECAUSE")
comm.disablePhrase("why_should_i_trust") elseif r == "what_about_interference" then comm.doNpcPhrase("INTERFERENCE_NECESSARY")
comm.disablePhrase("what_about_interference") elseif r == "i_just_like_to_leave" then comm.doNpcPhrase("SORRY_NO_LEAVE")
comm.disablePhrase("i_just_like_to_leave") end
if comm.isPhraseEnabled("invaders_from_mars") then comm.addResponse("invaders_from_mars", angryHomeArilou) else comm.addResponse("bug_eyed_fruitcakes", exitConversation) end if comm.isPhraseEnabled("why_should_i_trust") then comm.addResponse("why_should_i_trust", angryHomeArilou) elseif comm.isPhraseEnabled("what_about_interference") then comm.addResponse("what_about_interference", angryHomeArilou) end comm.addResponse("ok_lets_be_friends", arilouHome) comm.addResponse("i_just_like_to_leave", angryHomeArilou) end
function angrySpaceArilou(r) if r == "im_sorry" then comm.doNpcPhrase("APOLOGIZE_AT_HOMEWORLD")
comm.disablePhrase("im_sorry") end
comm.addResponse("lets_fight", exitConversation) if comm.isPhraseEnabled("im_sorry") then comm.addResponse("im_sorry", angrySpaceArilou) end comm.addResponse("bye_angry_space", exitConversation) end
function friendlySpaceArilou(r) if r == "confused_by_hello" then comm.doNpcPhrase("CONFUSED_RESPONSE") elseif r == "happy_by_hello" then comm.doNpcPhrase("HAPPY_RESPONSE") elseif r == "miffed_by_hello" then comm.doNpcPhrase("MIFFED_RESPONSE") elseif r == "whats_up_1" or r == "whats_up_2" then local numVisits = state.prop.get("ARILOU_INFO") if numVisits == 0 then comm.doNpcPhrase("GENERAL_INFO_1") numVisits = numVisits + 1 elseif numVisits == 1 then comm.doNpcPhrase("GENERAL_INFO_2") numVisits = numVisits + 1 elseif numVisits == 2 then comm.doNpcPhrase("GENERAL_INFO_3") numVisits = numVisits + 1 elseif numVisits == 3 then comm.doNpcPhrase("GENERAL_INFO_4") end state.prop.set("ARILOU_INFO", numVisits)
comm.disablePhrase("whats_up_2") elseif r == "why_you_here" then comm.doNpcPhrase("LEARN_THINGS")
state.prop.set("ARILOU_STACK_5", 1) elseif r == "what_things" then comm.doNpcPhrase("THESE_THINGS")
state.prop.set("ARILOU_STACK_5", 2) elseif r == "why_do_it" then comm.doNpcPhrase("DO_IT_BECAUSE")
state.prop.set("ARILOU_STACK_5", 3) elseif r == "give_me_info_1" or r == "give_me_info_2" then local numVisits = state.prop.get("ARILOU_HINTS") if numVisits == 0 then comm.doNpcPhrase("ARILOU_HINTS_1") numVisits = numVisits + 1 elseif numVisits == 1 then comm.doNpcPhrase("ARILOU_HINTS_2") if state.prop.get("KNOW_ABOUT_SHATTERED") < 2 then state.prop.set("KNOW_ABOUT_SHATTERED", 2) end numVisits = numVisits + 1 elseif numVisits == 2 then comm.doNpcPhrase("ARILOU_HINTS_3") state.prop.set("KNOW_URQUAN_STORY", 1) state.prop.set("KNOW_KOHR_AH_STORY", 1) numVisits = numVisits + 1 elseif numVisits == 3 then comm.doNpcPhrase("ARILOU_HINTS_4") end state.prop.set("ARILOU_HINTS", numVisits)
comm.disablePhrase("give_me_info_2") end
local arilouStack5 = state.prop.get("ARILOU_STACK_5") if arilouStack5 == 0 then comm.addResponse("why_you_here", friendlySpaceArilou) elseif arilouStack5 == 1 then comm.addResponse("what_things", friendlySpaceArilou) elseif arilouStack5 == 2 then comm.addResponse("why_do_it", friendlySpaceArilou) end
if comm.isPhraseEnabled("whats_up_2") then if state.prop.get("ARILOU_INFO") == 0 then comm.addResponse("whats_up_1", friendlySpaceArilou) else comm.addResponse("whats_up_2", friendlySpaceArilou) end end
if comm.isPhraseEnabled("give_me_info_2") then if state.prop.get("ARILOU_HINTS") == 0 then comm.addResponse("give_me_info_1", friendlySpaceArilou) else comm.addResponse("give_me_info_2", friendlySpaceArilou) end end comm.addResponse("bye_friendly_space", exitConversation) end
function init() if comm.isInOuttakes() then comm.doNpcPhrase("OUT_TAKES")
state.setSegue(comm.segue.depart) return end
if state.prop.get("MET_ARILOU") == 0 then local respFunc
if state.prop.get("ARILOU_SPACE_SIDE") <= 1 then comm.doNpcPhrase("INIT_HELLO") respFunc = friendlySpaceArilou else comm.doNpcPhrase("FRDLY_HOMEWORLD_HELLO_1") respFunc = arilouHome state.prop.set("ARILOU_HOME_VISITS", 1) end comm.addResponse("confused_by_hello", respFunc) comm.addResponse("happy_by_hello", respFunc) comm.addResponse("miffed_by_hello", respFunc) state.prop.set("MET_ARILOU", 1) return end
local manner = state.prop.get("ARILOU_MANNER") if manner == 2 then local numVisits = state.prop.get("ARILOU_VISITS") if numVisits == 0 then comm.doNpcPhrase("HOSTILE_GOODBYE_1") numVisits = numVisits + 1 elseif numVisits == 1 then comm.doNpcPhrase("HOSTILE_GOODBYE_2") numVisits = numVisits + 1 elseif numVisits == 2 then comm.doNpcPhrase("HOSTILE_GOODBYE_3") numVisits = numVisits + 1 elseif numVisits == 3 then comm.doNpcPhrase("HOSTILE_GOODBYE_4") end state.prop.set("ARILOU_VISITS", numVisits)
state.setSegue(comm.segue.depart) elseif manner == 1 then if state.prop.get("ARILOU_SPACE_SIDE") > 1 then comm.doNpcPhrase("INIT_ANGRY_HWLD_HELLO") state.prop.set("ARILOU_HOME_VISITS", 1)
angryHomeArilou(nil) else local numVisits = state.prop.get("ARILOU_VISITS") if numVisits == 0 then comm.doNpcPhrase("ANGRY_SPACE_HELLO_1") numVisits = numVisits + 1 elseif numVisits == 1 then comm.doNpcPhrase("ANGRY_SPACE_HELLO_2") end state.prop.set("ARILOU_VISITS", numVisits)
angrySpaceArilou(nil) end else if state.prop.get("ARILOU_SPACE_SIDE") <= 1 then local numVisits = state.prop.get("ARILOU_VISITS") if numVisits == 0 then comm.doNpcPhrase("FRIENDLY_SPACE_HELLO_1") numVisits = numVisits + 1 elseif numVisits == 1 then comm.doNpcPhrase("FRIENDLY_SPACE_HELLO_2") numVisits = numVisits + 1 elseif numVisits == 2 then comm.doNpcPhrase("FRIENDLY_SPACE_HELLO_3") numVisits = numVisits + 1 elseif numVisits == 3 then comm.doNpcPhrase("FRIENDLY_SPACE_HELLO_4") end state.prop.set("ARILOU_VISITS", numVisits)
friendlySpaceArilou(nil) else if state.prop.get("PORTAL_SPAWNER") == 0 and state.prop.get("KNOW_ARILOU_WANT_WRECK") > 0 then local numVisits = state.prop.get("NO_PORTAL_VISITS") if numVisits == 0 then comm.doNpcPhrase("GOT_PART_YET_1") numVisits = numVisits + 1 elseif numVisits == 1 then comm.doNpcPhrase("GOT_PART_YET_1") end state.prop.set("NO_PORTAL_VISITS", numVisits) else local numVisits = state.prop.get("ARILOU_HOME_VISITS") if numVisits == 0 then comm.doNpcPhrase("FRDLY_HOMEWORLD_HELLO_1") numVisits = numVisits + 1 elseif numVisits == 1 then comm.doNpcPhrase("FRDLY_HOMEWORLD_HELLO_2") numVisits = numVisits + 1 elseif numVisits == 2 then comm.doNpcPhrase("FRDLY_HOMEWORLD_HELLO_3") numVisits = numVisits + 1 elseif numVisits == 3 then comm.doNpcPhrase("FRDLY_HOMEWORLD_HELLO_4") end state.prop.set("ARILOU_HOME_VISITS", numVisits) end
arilouHome(nil) end end end
function post() if comm.getSegue() == comm.segue.battle then local manner = state.prop.get("ARILOU_MANNER") if manner ~= 2 then state.prop.set("ARILOU_MANNER", 1) if manner ~= 1 then state.prop.set("ARILOU_VISITS", 0) state.prop.set("ARILOU_HOME_VISITS", 0) end end end
if state.prop.get("ARILOU_SPACE_SIDE") > 1 and state.prop.get("ARILOU_HOME_VISITS") <= 1 then state.prop.set("UMGAH_ZOMBIE_BLOBBIES", 1) state.prop.set("UMGAH_VISITS", 0) state.prop.set("UMGAH_HOME_VISITS", 0)
if state.prop.get("ARILOU_MANNER") < 2 then state.prop.set("ARILOU_MANNER", 3) end end end
This is more or less a straight translation from the C code, with most of the logic in Lua itself, while the interaction with the game is done with bindings to C functions. These bindings are often higher level than the original dialog code, and these functions are structured in namespaces. For instance, to add a lander, the original code would do 'GLOBAL_SIS(NumLanders)++; DrawLanders();', while the Lua code consists of 'state.sis.addLanders(1)'.
Right now, I have the following Lua bindings implemented:
comm.addResponse(phraseId, callback) comm.disablePhrase(phraseId) comm.doNpcPhrase(phraseId) comm.isPhraseEnabled(phraseId) comm.getSegue() comm.setSegue(what) event.addAbsolute(year, month, day, eventId) event.addRelative(years, months, days, eventId) event.register(eventId, fun) event.unregister(eventId, fun) log.debug(str) log.error(str) log.fatal(str) log.info(str) log.warn(str) state.escort.addShips(shipId, count) state.escort.canAddShips(shipId) state.escort.removeShips(shipId[, count]) state.escort.shipCount(shipId) state.escort.totalValue() state.prop.get(propName) state.prop.set(propName, value) state.race.isAllied(raceId) state.race.isAlive(raceId) state.race.setAllied(raceId, flag) state.race.setKnown(raceId, flag) state.sis.addCrew(delta) state.sis.addFuel(delta) state.sis.addLanders(delta) state.sis.addResUnits(delta) state.sis.getCaptainName() state.sis.getCrew() state.sis.getFuel() state.sis.getLanders() state.sis.getResUnits() state.sis.getShipName()
The 'string interpolation' I was talking about is the ability to but the following in the actual dialog text:
I am Captain <% state.sis.getCaptainName() %> of the starship <% state.sis.getShipName() %>.
I can also use the same scripting language to move the game event logic to the content (things like making the Mycon go to Organon and back), though this is not implemented yet. In the longer term, we could even put the ship intelligence code in there, so that everything needed to add a ship could be put into the content.
Note that all of this only exists on my local system; it has not been committed to SVN yet, though you can have a preview if you want.
It may be possible to combine the strengths of both approaches, by adding the option to your language to invoke Lua code (with the bindings which I already implemented) as a response to some dialog choice or as an expression for a condition to a dialog choice. That way, the dialog structure can be kept easy to understand in the most common case, by using your language, while it would be powerful enough to handle more complex situations, through the Lua bindings.
|
|
« Last Edit: May 28, 2012, 04:32:39 pm by meep-eep »
|
Logged
|
“When Juffo-Wup is complete when at last there is no Void, no Non when the Creators return then we can finally rest.”
|
|
|
Death 999
Global Moderator
Enlightened
Offline
Gender:
Posts: 3874
We did. You did. Yes we can. No.
|
The script has access to all of the global data in the game. If a variable exists, it can set it. It can also set an essentially unlimited number of variables that only it uses.
The text substitution system is Turing-complete and not that hard to use for any computations any normal person will ever need. Consider:
text factorial =fac_n<2 [fac_out] .
text factorial +fac_out=fac_out*fac_n +fac_n=fac_n-1 [factorial] .
to calculate the factorial of a number, set fac_n to whatever number you want the factorial taken of and fac_out to 1, and call this text item.
|
|
« Last Edit: May 29, 2012, 03:19:28 pm by Death 999 »
|
Logged
|
|
|
|
meep-eep
Forum Admin
Enlightened
Offline
Posts: 2847
|
Well, it is a very respectable job that you've done, and your syntax is much more accessible to non-coders than the Lua stuff (your factorial example would not be one though, imho). But don't you think that there would be circumstances where the ability to perform more complex tasks would be useful? How would you handle giving ships to the player, setting up an event for later, fading in, (or, I guess, have two factorials in a single text block), etc.? At the very least, I would expect that you would need to add some sort of function call capability to your language.
Note that the Lua scripting support is likely to eventually end up in UQM. Allowing Lua fragments in your own scripting language should not be much work. And even with your dialog system, there would be a need to script game events.
|
|
|
Logged
|
“When Juffo-Wup is complete when at last there is no Void, no Non when the Creators return then we can finally rest.”
|
|
|
Death 999
Global Moderator
Enlightened
Offline
Gender:
Posts: 3874
We did. You did. Yes we can. No.
|
Yes, the factorial example was chosen to show that it is a general-purpose language with branching, value storage, etc. You can even do arrays by evaluating values into variable names (this capability might not work yet). You're right that adding functions would be helpful in some cases. I can think of a few ways of doing that, with various advantages and disadvantages. We'll need to talk that out.
How would you handle giving ships to the player, setting up an event for later, fading in, (or, I guess, have two factorials in a single text block), etc.? Is the composition of your fleet stored in the game data array? if so, we already have the ability to give (or take) ships, etc. It might be useful to have a library of access functions in this case, though.
I'm not sure what you mean by setting up an event for later.
Fading in and other display/animation changes will be handled by a separate display directive system that reads commands embedded in the text in curly braces. These commands will be stripped from the text in the function that currently strips out the $ signs that surround computer-font text. We could more generally make the curly braces Lua bindings.
To evaluate the factorial twice in one block in the system as it stands... you'd have to wrap the second one in a separate text item that resets the values, OR enhance the factorial function with an argument queue (not at all a trivial task). Proper functions, mentioned above, would be nice - especially because they'd let you do this work inside a conditions and consequences block!
|
|
« Last Edit: May 29, 2012, 03:59:47 pm by Death 999 »
|
Logged
|
|
|
|
meep-eep
Forum Admin
Enlightened
Offline
Posts: 2847
|
How would you handle giving ships to the player, setting up an event for later, fading in, (or, I guess, have two factorials in a single text block), etc.? Is the composition of your fleet stored in the game data array? if so, we already have the ability to give (or take) ships, etc. It might be useful to have a library of access functions in this case, though. No, it's in one of the QUEUE structures. And even if it wasn't, the user interface will need to be updated after a ship is added to the fleet.
I'm not sure what you mean by setting up an event for later.
I'm referring to the code from gameev.c, set up from the individual comm files. For example, six months after you ally with the Spathi, they raise their shield.
|
|
|
Logged
|
“When Juffo-Wup is complete when at last there is no Void, no Non when the Creators return then we can finally rest.”
|
|
|
Pages: 1 ... 4 5 [6]
|
|
|
|
|