Q5: default messages

Pertex
14 Mar 2011, 07:55
Hihoo,
will it be possible to have several defaultmessages for one command, which are changed randomly?

Cryophile
14 Mar 2011, 13:53
From what I understand most of the default behaviour of Q5 will be written in ASLX and not coded into Quest. You should be able to rewrite nearly all of the default behaviours if this is the case.

Pertex
14 Mar 2011, 20:33
Ah, yes, I think it could be done in CoreCommands.aslx. But then I have a question. Isnt it a bit dangerous to let people change core-files? If I change CoreCommands.aslx, how and where will it be installed? Overriding the official version would be ugly.

By the way, Alex, while translating the english.aslx, I changed some entries from dynamictemplate to template. Does this cause problems?

Cryophile
14 Mar 2011, 21:06
They're not exactly 'installed'. The ASLX files will be parsed at runtime like all the other game files. There should be no difference in modifying the CoreCommands.aslx file than there would be modifying any .asl file in Q4. The ASLX files are not part of the interpreter itself and won't affect the actual program. You should be able to completely rewrite all of the ASLX files if you feel like it. They would need to distributed with your game, however.

The actual Quest interpreter is written in C# and VB.NET. Those are the only files to be compiled into the program and installed. Much of the core functionality that was built into the Q4 interpreter is now found in the ASLX files which can be modified as much as you like and redistributed. This gives the author MUCH more freedom.

Alex
14 Mar 2011, 21:47
There will be something similar to a CAS file which will be the distribution format for games. You'll be able to package up your game with all its included libraries, so even if you've modified the core libraries, as Cryophile says, it won't matter because that would affect your game only.

If you change a dynamictemplate to a "normal" template that would break things... why not just keep them as dynamictemplates? If you just put quotes around the value then it will be effectively a static template anyway.

Pertex
15 Mar 2011, 08:35
Alex wrote: If you change a dynamictemplate to a "normal" template that would break things...

Hmmm, I dont have problems with my Deutsch.aslx

Alex wrote: why not just keep them as dynamictemplates? If you just put quotes around the value then it will be effectively a static template anyway.

No problem, I will change it back. I thought I had a problem with dynamictemplates without objectdata (like object.article ), but I cant find it any more.

So dynamictemplate could replace the normal template? So why is Q5 not using dynamictemplate all the time? Performance?

Alex
15 Mar 2011, 12:58
Well, maybe it does work then - I haven't checked! :)

Yes we could probably use a dynamictemplate in place of all normal templates - but normal templates came first and we don't need to have dynamic templates for everything. But it probably makes sense for us to use dynamic templates wherever we can, because there may be situations where we'd always use the same string in English but will need to call functions to generate the strings for other languages. Also, as has been suggested elsewhere, if you want randomly chosen responses to errors for example, dynamic templates are the best way to go.

Pertex
15 Mar 2011, 14:53
Yes, it would be fine to have dynamic templates with all commands.

I managed to display random defaultmessages now by editing the english.aslx:


<dynamictemplate name="DefaultKill">DynamicTemplate ("DefaultKill" + ToString (random (1,3)) , object) </dynamictemplate>
<dynamictemplate name="DefaultKill1">"This would not be nice."</dynamictemplate>
<dynamictemplate name="DefaultKill2">"No, you won't do this."</dynamictemplate>
<dynamictemplate name="DefaultKill3">"You can't kill " + object.article + "."</dynamictemplate>


This must be done for all commands. Do you think, it is OK to do it this way or would you prefer an other way?

Alex
15 Mar 2011, 17:09
That looks reasonable to me given the way things currently work - it might be worth me thinking about this a bit more though as it's probably a reasonably common scenario, so it might be a good idea to have this as built-in functionality.

Pertex
15 Mar 2011, 20:11
I didnt dare to ask for this as built-in functionality :D I thought of something like this:


<dynamictemplate name="DefaultKill" variation=3/>
<dynamictemplate name="DefaultKill1">"This would not be nice."</dynamictemplate>
<dynamictemplate name="DefaultKill2">"No, you won't do this."</dynamictemplate>
<dynamictemplate name="DefaultKill3">"You can't kill " + object.article + "."</dynamictemplate>

Cryophile
15 Mar 2011, 23:09
This would be the time in development to start laying out any and all suggestions you have. I'm sure Alex has a lot he would like to add, but much of it won't come out until authors begin to code their own games and run into roadblocks, alternate roads, or bugs.