I hate it. Since there is is no source code for daggerfall available a lot of different people have worked on figuring stuff out about it and they used different words for the same things and the same words for different things. There have also been mistakes made along they way and there is still quite a bit unknown.BansheeXYZ wrote: ↑Sun Sep 22, 2019 3:28 pm I like how terminology changes between sections. Clock becomes timer... Person becomes npc...
A "start up task" is identical to any other task, except it doesn't have a name and it always runs.
That is not a very good translation.BansheeXYZ wrote: ↑Sun Sep 22, 2019 3:28 pm Translated:Code: Select all
If player goes inside this place WELL AFTER THE QUEST HAS STARTED, start this nameless task and mark as completed, which if you scroll down, is a single action to say something that can't directly go here for some reason.
Better would be: "Set up a trigger that sets state _S.05_ to TRUE whenever the player enters this location"
The original daggerfall code for that "action" is:
Code: Select all
0000002B000000030000FF0900000900FFFFFFFFF244000600050900000900050000000E000000000004000004000000000000C8F2440041CB430003C14300000000001277430000000000000000000000008B02F5036F
Code: Select all
opCode : 43
argCount : 3
arguments:
0: _
type : State
value : -1
not : False
index : 255
unknown1 : 100680946 [0x060044F2]
1: s_000033d7
type : State
value : 5
not : False
index : 5
unknown1 : 14 [0x0000000E]
2: l_qgiverhome
type : Location
value : 0
not : False
index : 0
unknown1 : 1156761600 [0x44F2C800]
messageId : 1013
flags : 0 [0x0000]
lastUpdate : 111
Code: Select all
WhenAtLocation (l_qgiverhome): set s_000033d7 [Msg 1013]
Code: Select all
pc at _qgiverhome_ do _S.05_ saying 1013
Maybe if you had read the pages I linked you you would have a better idea of where this came from.BansheeXYZ wrote: ↑Sun Sep 22, 2019 3:28 pm In other words, I don't get why a conditional thing is in the start-up section, or why a message has to act as a trigger for the spawn code instead of what the game should already know directly (whether the player is inside or outside of a predefined place).
There's some things in Tipton's Template decompiler that can be hard to grasp.
He merged all opcodes together that depended on the same state, he merged some opcodes together and split others apart.
For reference, this is a representation of that quest in a format a lot closer to what the actual daggerfall classic engine uses:
Code: Select all
>> StartTimer (t_000343a8); When it expires: set s_000343a8
=> EnsureNpcLocation (l_qgiverhome)
>> IfTimeOfDayBetween (21:00:00, 1.00:00:00): set s_0000d703
>> WhenAtLocation (l_qgiverhome): set s_000033d7 [Msg 1013]
>> If (s_000033d7 and s_0000d703): set s_00068f54
if s_00068f54 => CreateFoe(m_00006f7b, 10, 25%, 1)
>> IfMobsKilled (m_00006f7b, 2): set s_0006fd8a
if s_0000d703 => PlaceNpcAt (n_qgiver, l_qgiverhome)
>> IfMobHurtByPlayer (m_00006f7b): set s_0001aa84 [Msg 1011]
>> IfNpcClicked (n_qgiver): set s_0000d194
>> If (s_0000d194 and s_0006fd8a): set s_questdone
>> If (not s_0006fd8a and s_0000d194): set s_clearclick
if s_clearclick => Unset (s_0000d194, s_clearclick)
if s_questdone => QuestSuccess (i_gold)
>> If (s_questdone and not s_000033d7): set s_0000064e
if s_0000064e => EndQuest ()
if s_000343a8 => EndQuest ()
=> CreateLogEntry (1010, 0)
The engine runs through this whole stack on every tick.
Every line is a command and all of them are always run, except the ones with an if s_tate in front of them, those only run when that flag is set to TRUE.
Some commands only run once (like StartTime and CreateLogEntry), others all the time.
Because this format is hard to read Tipton created a decompiler that created a much more readable output and he called it Template.
Template became used by many modders and questwriters and so was a logical choice for DFU to implement.
The current questmachine that runs on this has has hundreds of hours of writing and testing and bugfixing done on it.
It is not going to be rewritten or replaced.
I get that you don't understand a lot of things, but the solution is not to complain about that here, but to educate yourself. It took me just a few hours of reading to get to the bottom of this.
So unless you create a script language that compiles to Template or you have an addition that is well thought out and requires no rewriting of any existing quest, there is not much sense in complaining here.
I also really really want a better quest writing script. And trust me, writing a tool that translates to Template is by far the easiest solution. So if you want to help, please come up with a readable script and a way to translate it to Template. If you're not a coder I or someone else can do the implementation for you.