Warhammer Dark Omen Forum

Modifications => Campaigns => Topic started by: Leilond on April 06, 2017, 09:06:31 AM



Title: New Campaigns: Questions and suggestions
Post by: Leilond on April 06, 2017, 09:06:31 AM
I'm considering to create new campaings, most for the fun of doing it, but also to give others "new food to eat"

I will ask againg for your patience and kindness with some question

I want to create a first simple campaign, with no more than 5-6 battles plus 2-3 optional battles. New conversation, new plots and brand new story. This will be my "make experience" campaign, before creating the big one I've got in mind.
For now I'm not considering to create new maps... I've got enough of them from the original game and wood elf campaign. I  more or less undestood the "not battle" part (the "whmtg.txt" file)
I won't create new units too, because I can use all the units from the wood elf campaign, more than enough by now

What I need is this

How to create a battle from the beginning, that means:
1) Add a unit to a map (and eventually remove all units present on the map if copied by another campaign)
2) Add hidden units that appear on conditions (like those hidden in the trees or those zombies that come out from the ground)
3) Add conditional units (units that can be added depending on the plot choices, like black grail in the final battle if you do not kill them in the previous mission)
4) Enemy AI

These are the first issues I will like to learn. Thus, if someone can point me out in the right direction (suggestions, tutorials, an interesting battle from another mod that is the right one to learn because of the way it's done and so on) I will appreciate it a lot

Thanks


Title: Re: New Campaigns: Questions and suggestions
Post by: olly on April 06, 2017, 10:08:07 AM
http://forum.dark-omen.org/campaigns/how-to-create-new-mods-and-campaigns-t1251.0.html (http://forum.dark-omen.org/campaigns/how-to-create-new-mods-and-campaigns-t1251.0.html)


Title: Re: New Campaigns: Questions and suggestions
Post by: Leilond on April 06, 2017, 01:25:24 PM
Thanks for the link. Started to study. Hoped it could be easy as the whmtg file, but sadly it's not, but it surely helped to put me on the correct path.

When you wrote "Scroll to bottom and add in new SUBCHUNK using BTB to XML converter" I unzipped the btbxml.zip file and found two files. "btbxml.py" and "xmlbtb.py"... How do I'm supposed to use those files to make the conversion?

By the way
I choosed to open the Original Game files, because I know very well the campaign and thus I kmnow what to look for
I opened the B101NME.arm and B101MRC.arm with Wh2Edit
I opened B01_01.BTB with the BTB editor
Btb file is very hard to undestand. There are A LOT of 503 subchunk. I would like to change most of the units in the map and do not want to delete things that I should not.
1) Some 503 subchunk with the "<5>INTEGER = 16387" value but with an unknown id in the <12> value (example "<12>INTEGER=258" and I do not have any troup with that id in the B101NME and B101MRC files). What's the meaning of these subchunks?
2) What's the meaning of 503 subchunks with "<5>INTEGER=1" (or =3 and =5)?
3) How do I change the deploy zone for the player?
4) What's the meaning of this "and remember to increase the 6000 header by 1. "? What's the 6000 header?
5) How do I add to a unit a different banner taken from new mod Banner folder?
6) The B102NME file (Undead and Skaven mod), I looked at "Stormvermin" and found "Sprite 340"... where do I find that sprite? And how about banners? In the dropdown menu I see only the Orig Campaign banners and not all the mod added banners. How do I select them?
7) Is there any ".arm" file with ALL the troups of the game (players troups can be found in PLYR_ALL.ARM, but enemy troups don't) to make it easier to make copypaste on wh2Edit? I can find them in all BTB files, but if there is a "ENEMY_ALL.ARM" it could be easyer

I'm stuck with this part by now and trying to understand on my own (but help will be appreciated)... I will start with CTL and AI when I'm able to make all units deploy correctly.

There isn't any need to be quick in this, thus replay when you want and can, without pressure ;)

Thanks


Title: Re: New Campaigns: Questions and suggestions
Post by: olly on April 06, 2017, 02:32:26 PM
http://wiki.dark-omen.org/do/DO/Modding/Tools/BTBXML (http://wiki.dark-omen.org/do/DO/Modding/Tools/BTBXML)

http://wiki.dark-omen.org/do/Special:AllPages (http://wiki.dark-omen.org/do/Special:AllPages)


Title: Re: New Campaigns: Questions and suggestions
Post by: Leilond on April 06, 2017, 03:29:27 PM
Quote
[url]http://wiki.dark-omen.org/do/Special:AllPages[/url] ([url]http://wiki.dark-omen.org/do/Special:AllPages[/url])

This was EXACTLY was I was looking for...
I already found tons of things that clarified most of my doubt.

As always, you point directly to the right place instead of loosing time in unnecessary words. GREAT!

Thanks


Title: Re: New Campaigns: Questions and suggestions
Post by: Leilond on April 06, 2017, 10:46:59 PM
Things are goint pretty well by now.
I managed to change the deploy zone of battle 1 (trading post) to the upside. In my new campaign, the enemies will defend the village they conquered and you have to recapture it, thus, the deploys are reversed: empire up, enemies defend the village

By now I've got only two problems.
1) Troups facing wrong way at deploy
All my troups, when deployed, face the wrong way (the face the same direction as they were placed in the old deploy zone), no matter the value I try to put in the "type=7 node. Not a big issue till now, because I can face them another way but it's annoying. This is the Grudgebringer Cavallry node
Code:
        <SUBRECORD type="503">
             <INT type="5"> 16387 </INT>
             <INT type="1"> 1050 </INT>
             <INT type="2"> 1400 </INT>
             <INT type="6"> 48 </INT>
             <INT type="7"> 259 </INT>
             <INT type="11"> 0 </INT>
             <INT type="12"> 1 </INT>
             <INT type="13"> 100 </INT>
         </SUBRECORD>
259 is a value I copied from a goblin unit in original campaing, hoping to make my unit face that way, but it doesn't work

2) When the battle start, the camera finally stop at the old deploy zone, even if it's not there anymore. It's not a "blocking" problem, but annoying too, like the first problem. This is the deployment zone node
Code:
    <CHUNK type="4">
         <STR type="1006"> Mercdeploy </STR>
         <INT type="5"> 259 </INT>
          <TUP2 type="10"> (960, 1560) </TUP2>
         <TUP4 type="502"> (960, 1560, 1008, 1440) </TUP4>
         <TUP4 type="502"> (1008, 1440, 984, 1320) </TUP4>
         <TUP4 type="502"> (984, 1320, 1280, 1320) </TUP4>
         <TUP4 type="502"> (1280, 1320, 1264, 1432) </TUP4>
         <TUP4 type="502"> (1264, 1432, 1272, 1560) </TUP4>
         <TUP4 type="502"> (1272, 1560, 960, 1560) </TUP4>
     </CHUNK>

I can continue my job right know, but I'll have to solve those before or then, or I'll have to change my mind on this battle I've got in mind


Title: Re: New Campaigns: Questions and suggestions
Post by: Leilond on April 08, 2017, 01:45:51 PM
Didn't solved the troup facing issue nor the camera stopping at old deploy zone, but I can live with it
-
I understood a good part of CTL part, expecially the difference between teleport_to2 and teleport_to3 that are not documented on the wiki page, because in standard battle 01_03, teleport_to2 is used when zombies coum out from the ground, while tleport_to3 is used when troups appear near map border


Title: Re: New Campaigns: Questions and suggestions
Post by: olly on April 08, 2017, 01:48:45 PM
Good discoveries and you won't be able to alter the camera track to old deployment zone, until we can Edit the TRAC section of .PRJ

http://wiki.dark-omen.org/do/DO/PRJ (http://wiki.dark-omen.org/do/DO/PRJ)

The troops facing direction should work as I use it a lot when testing line of sight etc..

Goblin ID 131 direction now facing 90

[attachment=1]


Title: Re: New Campaigns: Questions and suggestions
Post by: Leilond on April 08, 2017, 03:14:00 PM
It works with enemies (I tried to put 90 in the 131 troup, and the goblins changed facing exactly as in your example)
It doesn't work if I try to put the same value (or any other value) on my cavallry


Title: Re: New Campaigns: Questions and suggestions
Post by: olly on April 08, 2017, 03:59:37 PM
This would be a good problem to trace in IDA since the engine source code must be setting their direction. However CTL does have

set_unit_r_direction (DD)
arg1: unit id arg2: register where direction of arg1 is written to.
Useful in the tutorial only.

http://wiki.dark-omen.org/do/DO/CTL/OpCodes (http://wiki.dark-omen.org/do/DO/CTL/OpCodes)

So maybe it could be used somehow to set direction perhaps.


Title: Re: New Campaigns: Questions and suggestions
Post by: Leilond on April 08, 2017, 09:12:43 PM
Perfect, I will try and let you know if it work

By now I'm trying to figure out some unit way of moving basing on events (like the first goblin archers unit that retreat to a safer positino when suffer some damage and so on). There are too many event id that are not on the page http://wiki.dark-omen.org/do/DO/CTL/Events (http://wiki.dark-omen.org/do/DO/CTL/Events) and I'm trying to see if I can undestand some

Also all those play_self make me curious


Title: Re: New Campaigns: Questions and suggestions
Post by: olly on April 08, 2017, 09:51:29 PM
Here are more useful CTL discussions, if I haven't already linked you to them ->

http://forum.dark-omen.org/singleplayer/further-ctl-investigation-t1105.0.html (http://forum.dark-omen.org/singleplayer/further-ctl-investigation-t1105.0.html)

http://forum.dark-omen.org/singleplayer/enemy-units-in-campaign-t1094.0.html (http://forum.dark-omen.org/singleplayer/enemy-units-in-campaign-t1094.0.html)

and updated BTBXML script

http://forum.dark-omen.org/tools/btb-and-ctl-files-t1277.0.html;msg13043#msg13043 (http://forum.dark-omen.org/tools/btb-and-ctl-files-t1277.0.html;msg13043#msg13043)

Also all the map pictures for you to plan new strategies

http://forum.dark-omen.org/maps/all-maps-t155.0.html (http://forum.dark-omen.org/maps/all-maps-t155.0.html)


Title: Re: New Campaigns: Questions and suggestions
Post by: Leilond on April 09, 2017, 10:25:36 AM
Thanks. That helped.

I will have to play around with CTL to better discover events ids and playself ids.

It,going on very well thanks again


Title: Re: New Campaigns: Questions and suggestions
Post by: Leilond on April 10, 2017, 09:31:37 AM
This would be a good problem to trace in IDA since the engine source code must be setting their direction. However CTL does have

set_unit_r_direction (DD)
arg1: unit id arg2: register where direction of arg1 is written to.
Useful in the tutorial only.

[url]http://wiki.dark-omen.org/do/DO/CTL/OpCodes[/url] ([url]http://wiki.dark-omen.org/do/DO/CTL/OpCodes[/url])

So maybe it could be used somehow to set direction perhaps.

Tried to add "set_unit_r_direction 1,X" with some different values to X, but it look like nothing changed at all

Well, I think I've got to live with it


Title: Re: New Campaigns: Questions and suggestions
Post by: olly on April 10, 2017, 01:41:07 PM
Unfortunately it is only a simple register that is only used in the Tutorial mission, to ensure you have moved your troops to face the correct direction. It's not setting a direction function that can be changed to a new direction, or checked anywhere else.

Therefore, it requires more IDA analysis to see if direction is used anywhere else and can then be set to a new direction.

I've been examining Ghabry's/Rob's IDA sub discoveries and also Aqrit's sub IDA discoveries and combining them into 1, in an attempt to explain it more clearly for us lesser mortals. However, as Ghabry mentions all the easy to discover subs have already been found.

The other issue with IDA is that the free version doesn't provide pseudo code compared with the paid for versions, so I'm copying all the pseudo code and documenting it against the free versions, to make it more accessible.



:)



Title: Re: New Campaigns: Questions and suggestions
Post by: Leilond on April 10, 2017, 03:08:09 PM
As I said, I can survive with that issue... players (if someone will play my campaign) will have to correctly face units during deploy

If I can use your patience again, I've got two question.
1) Is there a way to add "new weapons" or to change some of them?
I will like to add musketeers to my campaign, but "pistols" have too low range to simulate imperial musketeers.
2) Is there a way to REMOVE money from the army. I tried "AddCash -4000" to remove those 4000 golds the army starts with but it doesn't work

If not, not problem, I won't use musketeers


Title: Re: New Campaigns: Questions and suggestions
Post by: olly on April 10, 2017, 08:34:44 PM
We had a previous thought concerning modding spells, so weapons would work in the same way.

http://forum.dark-omen.org/tools/modding-spells-t1395.0.html (http://forum.dark-omen.org/tools/modding-spells-t1395.0.html)

Shame the AddCash -4000 didn't work, maybe try RemoveCash 4000 even though it's not listed. Perhaps you could automatically recruit an expensive unit and then remove him.


Title: Re: New Campaigns: Questions and suggestions
Post by: Leilond on April 11, 2017, 08:01:13 AM
We had a previous thought concerning modding spells, so weapons would work in the same way.

[url]http://forum.dark-omen.org/tools/modding-spells-t1395.0.html[/url] ([url]http://forum.dark-omen.org/tools/modding-spells-t1395.0.html[/url])

Shame the AddCash -4000 didn't work, maybe try RemoveCash 4000 even though it's not listed. Perhaps you could automatically recruit an expensive unit and then remove him.

That sounds an interesting solution
I tried to add 4000 to unit cost for treeman and then add it to the army with AddUnit 28. The treeman was correctly added to the army but the cash didn't go down and stay at 4000
Do I miss something?

By the way, I'm taking a census of all "play_self" matters. By now I wrote down from "play_self 1" and "play_self 50". Hope to finish it this evening and post it, so that you can add them to the wiki if you think it's useful. I'm primary doing it to better undestand all event ids


Title: Re: New Campaigns: Questions and suggestions
Post by: olly on April 11, 2017, 01:06:29 PM
Could you automatically add a large regiment who are injured and then automatically heal/reinforce them, so it costs 4000 and then remove them again.

Will look forward to more play_self info

:)   



Title: Re: New Campaigns: Questions and suggestions
Post by: Leilond on April 11, 2017, 01:43:48 PM
Could you automatically add a large regiment who are injured and then automatically heal/reinforce them, so it costs 4000 and then remove them again.

I tried to figure out how to heal/reinforce a unit, but I didn't find any command like that in http://wiki.dark-omen.org/do/DO/WHMTG/OpCodes (http://wiki.dark-omen.org/do/DO/WHMTG/OpCodes)

Quote
Will look forward to more play_self info

:)   

I will post it when I'll have all them finished... This evening or tomorrow is a trustable possibility

:D


Title: Re: New Campaigns: Questions and suggestions
Post by: Leilond on April 11, 2017, 10:30:17 PM
I think I found them all... at least the game started to crash at every "play_self" with argument bigger than 189, until 197... then I stopped to try
These are all the play_self value I found.
It would be nice to have a good way to know the audio file corresponding to each phrase, but I should have to decode all of them and ear every single file... and I really do not want to
By the way, from 91 to 169, they're all tutorial message... 78 messages, that are EXACTLY the audio files that start with "T_KZ" (from "T_KZ001.mad" to "T_KZ073" with some message with more than one version like "T_KZ040A.mad" and "T_KZ040B.MAD").
They're in the right order, thus we can use these file in our CTL and thus we have 78 free message to add to our campaigns
:D
Here are the values (add them to the wiki if you think it's usefull or you can send me the user and password to update it and I'll create a page with all this values). My English didn't allow me to understand every single pharse and I put three question marks in the place I didn't undestand
Code:
1    Attack!
2    Charge!
3    Crush them!
4    Retreat!
5    We fear the enemy
6    We terrified
7    Stand firm man
8    No mercy
9    Watch your back
10   Open fire
11   Hold fire
12   Enemy sighted
13   Forward
14   I protest my lord
15   Weapon pass through it
16   I have it
17   Regroup
18   Target destroyed
19   Hold!
20   We're under fire
21   ???
22   Target lost
23   Target recived
24   Enemy lost
25   Turn on them
26   Aiiiiieeeeeee
27   Flee the battle
28   Spell negated
29   ???
30   Help us
31   Enemy destroyed
32   All is lost
33   We are victorious
34   We're under attack
35   I see
36   The game crash
37   To the north
38   No, to the east
39   They're all around us
40   They're defiling the secret stone. Stop them
41   Man, to the slaughter. Let none of them escape
42   Stand far man. That still burn
43   What sorcery is this? The man in black seems to command them
44   They come from all side. Back to back we must fight these restless dead
45   Hold the high ground man. Purge the evil with steel, iron and fire
46   Helgart is ours. To the tower
47   Hey Bernard. This pass is ideal for an ambush
48   Stand fast man. It's a trap
49   Yha! Orcs. They come for my tank, they should not have it
50   This tower is plagued by a pestilence that I may cure, with stell and fire
51   Be ready blood sucker. I come to lay you rest once and for all
52   Eyes shot man. The forest is alive with goblins
53   Get thos goblins. They're running with the loot
54   Bye Kislev. My axe will tast troll blood before this day's done
55   Target the Hand, it must be destroyed
56   Protect your flanks. Undead on charriot approach
57   Beware man. Remember ??? warnings
58   The Grail ride out. Destroy the Grail
59   In the name of Sigmar, I will destroy you Dread King
60   One by one your minions follow. I come for you Dread King
61   The Black Grail il gone. Honor to victory
62   The Dread King is defeated
63   They're heading for the trading post. Let's spill that green blood
64   Get the loot (Greenskin voice)
65   It's an ambush (Greenskin voice)
66   We got the loot. Ron. (Greenskin voice)
67   Smash ??? (Greenskin voice)
68   More ????? Enemies everywhere (Greenskin voice)
69   ???? (Greenskin voice)
70   ???? (Greenskin voice)
71   Dead to the living (Undead voice)
72   Another time we shall meet ??? (Undead voice)
73   ??? When you will have the chance (Undead voice)
74   You will die horribly (Undead voice)
75   ??? kill them my slaves (Undead voice)
76   The power of darkness will ??? you all (Undead voice)
77   ??? soul will join our dark crusade (Undead voice)
78   ??? my army of darkness (Undead voice)
79   I live again (Undead voice)
80   Empty
81   Give up your life and lie with the dead, I've got you surrounded (Undead voice)
82   Rise brothers. Rise and feast upon the living (Undead voice)
83   ??? what blood feast ??? Slay the living (Undead voice)
84   Come with us, warm with the dead (Undead voice)
85   I live to destroy once more ahahahah (Undead voice)
86   ahahahah... death comes to all things (Undead voice)
87   ??? of the city of the dead (Undead voice)
88   ??? in the shadow of the Dread King (Undead voice)
89   ??? crush the living (Undead voice)
90   ??? give me power (Undead voice)
91   Tutorial message 1
92   Tutorial message 2
93   Tutorial message 3
94   Tutorial message 4
95   Tutorial message 5
96   Tutorial message 6
97   Tutorial message 7
98   Tutorial message 8
99   Tutorial message 9
100  Tutorial message 10
101  Tutorial message 11
102  Tutorial message 12
103  Tutorial message 13
104  Tutorial message 14
105  Tutorial message 15
106  Tutorial message 16
107  Tutorial message 17
108  Tutorial message 18
109  Tutorial message 19
110  Tutorial message 20
111  Tutorial message 21
112  Tutorial message 22
113  Tutorial message 23
114  Tutorial message 24
115  Tutorial message 25
116  Tutorial message 26
117  Tutorial message 27
118  Tutorial message 28
119  Tutorial message 29
120  Tutorial message 30
121  Tutorial message 31
122  Tutorial message 32
123  Tutorial message 33
124  Tutorial message 34
125  Tutorial message 35
126  Tutorial message 36
127  Tutorial message 37
128  Tutorial message 38
129  Tutorial message 39
130  Tutorial message 40
131  Tutorial message 41
132  Tutorial message 42
133  Tutorial message 43
134  Tutorial message 44
135  Tutorial message 45
136  Tutorial message 46
137  Tutorial message 47
138  Tutorial message 48
139  Tutorial message 49
140  Tutorial message 50
141  Tutorial message 51
142  Tutorial message 52
143  Tutorial message 53
144  Console tutorial message 1
145  Console tutorial message 2
146  Console tutorial message 3
147  Console tutorial message 4
148  Console tutorial message 5
149  Console tutorial message 6
150  Console tutorial message 7
151  Console tutorial message 8
152  Console tutorial message 9
153  Console tutorial message 10
154  Console tutorial message 11
155  Console tutorial message 12
156  Console tutorial message 13
157  Console tutorial message 14
158  Console tutorial message 15
159  Console tutorial message 16
160  Console tutorial message 17
161  Console tutorial message 18
162  Console tutorial message 19
163  Console tutorial message 20
164  Console tutorial message 21
165  Console tutorial message 22
166  Console tutorial message 23
167  Console tutorial message 24
168  Console tutorial message 25
169  Console tutorial message 26
170  Argh (dying)
171  Argh (dying)
172  Argh (dying)
173  Argh (dying)
174  Argh (dying)
175  Argh (dying)
176  Argh (dying)
177  Argh (dying)
178  Argh (dying)
179  Argh (dying)
180  Argh (dying)
181  Argh (dying)
182  Argh (dying)
183  Argh (dying)
184  Argh (dying)
185  Argh (dying)
186  Argh (dying)
187  Argh (dying)
188  Argh (dying)
189  Argh (dying)

Now to the harder task of trying to find event ids


Title: Re: New Campaigns: Questions and suggestions
Post by: Leilond on April 12, 2017, 09:39:06 AM
Is there a way to change the recruit cost for unit members?
I tryed to value the "Unit Cost" in "PLYR_ALL.ARM" and in "B101MRC.ARM" but the recruit cost stay at the standard value (for example 50gc for Grudgebringer Infantry)

Solved! It was "Point Value" to be changed and not "Unit Cost"


Title: Re: New Campaigns: Questions and suggestions
Post by: olly on April 12, 2017, 03:04:50 PM
Great discoveries and having the ability to add new voices will be fantastic for all the new characters in the Dark Omen 2 mod template.

Thanks

:)

http://wiki.dark-omen.org/do/DO/ARM (http://wiki.dark-omen.org/do/DO/ARM)


Title: Re: New Campaigns: Questions and suggestions
Post by: Leilond on April 12, 2017, 04:41:54 PM
Trying to figure out how to lessen the starting gold, I decided to include only 1 member to all starting units, thus the player will be forced to spend all coins for initial replenish
In this issue, I had to discover the right price for each unit and finally I come out with the right formula.
You probablyl already discovered this, but I didn't find the proper topic and didn't want to bother you with this
Here is my discover

1) Each unit type has a basic “Multiplier” that we will call “M”
Infantry: M = 1
Ranged Unit: M = 1,5
Cavalry Unit: M = 2,5
Didn't worked other units types, but i should not be too difficult

2) Each armor value add cost to the unit with this forumula. Only the "base armor" enter in the formula, thus if you buy an upgrade to the unit, the value stay unchanged at the Win32edit "Base armor" value
AV(0) = 0
AV(n) = AV(n-1) +  n*10
Thus we have these results
AV(0) = 0
AV(1) = 10
AV(2) = 30
AV(3) = 60
AV(4) = 100
AV(5) = 150

3) In Wh32Edit we can change the “Point Value”
It's a bit tricky, because it seems that in the unit cost calculation, this value is set to the closer value between 0, 10, 20 or 30. Thus, if you put 22, it will be 20, if you put 8, it will be 10
We call this PV

4) The final cost of a unit follow this formula
T = Unit type (Infantry, Ranged unit, Cavalry)
AL=Armor level
PV=Point Value (0, 10, 20 or 30)
Price(T,AL,P) = 10*M + PV*M + AV(AL)

Example:
A cavalry unit, with “Armor Level” equals to 4 (mounted to not change this value) with Point Value 28 (that will be converted to 30)
Price(Cavalry, 4, 30 ) = 10*2,5 + 30*2,5 + 100 = 25 + 75 + 100 = 200


Title: Re: New Campaigns: Questions and suggestions
Post by: olly on April 12, 2017, 07:40:39 PM
Very nice and sorry but I just remembered Wh32Edit Header info

[attachment=1]

http://wiki.dark-omen.org/do/DO/ARM (http://wiki.dark-omen.org/do/DO/ARM)


Title: Re: New Campaigns: Questions and suggestions
Post by: Leilond on April 12, 2017, 08:39:25 PM
hahahahah
Great, thanks. Problem solved!


Title: Re: New Campaigns: Questions and suggestions
Post by: Leilond on April 12, 2017, 09:59:46 PM
CTL EVENTS
By now I'm good confident about these
6   Charge button clicked (one way to charge, not the only one)
9   Target selected (spell or fire)
16   Regroup
25   Regroup after pursuing
61   Hit by ranged fire or spell
73   Spell cast
71   Seems to be enemy in range or approaching. Fire multiple times until the unit start to fire or is engaged
52   Unit suffered loss from range (do not fire always, probably when the loss are of some minimum value)
79   Hit by spell (Spells fire both this event and event 61)
58   Enemy approaching/charghing
65   Target lost/Enemy lost (ranged/melee)
64   Charged

It's very difficult to follow the path of those damn absurd function calling eachother on and back... I will like to meet these "great" programmers and ask them WHY LIKE THIS?

By the way

Event 3
Goblin archer event 3 change the return function to 110, where there are some "play_self 23" ("target recived"), conditioned to some unknown tests (probably somethig that always fail, like testing it's a player unit, because goblin never say "Target recived" with human voice). Does it means event 3 is "target recived" like event?

Event 4
Goblin infantry event 4 send back to 139 with some test that can send to 129 where it "play_self 2" (charge!) after a test (probably verify that it's a player and not an enemy)
I think event 4 can be the start of a charge obtained not clicking the charge button (that is event 6) but clicking on opponent banner or by a "search_and_attack_enemy"

Event 69
Goblin archers event 69 has the chance to send back to 111 that send to 115 where there are some "play_self 10" (Open Fire). 69 is probably the start firing event for archers

I think I've to give up on this... I cannot do more than this... too many nested and conditioned  calls (undocumented/untranslated conditions istructions)...

 :-\



Title: Re: New Campaigns: Questions and suggestions
Post by: olly on April 12, 2017, 10:12:32 PM
Great, I will update the wiki

http://wiki.dark-omen.org/do/DO/CTL/Events (http://wiki.dark-omen.org/do/DO/CTL/Events)



Title: Re: New Campaigns: Questions and suggestions
Post by: Leilond on April 13, 2017, 09:50:19 AM
Another event consideration
On b1_01, there is this code
Code:
on_event 66
        play_self 4
        #95 0
        iftrue
             play_self 5
            #8e
        endif
        end_event 6844
play_self 4 is "Retreat!"
play_self 5 i "We fear the enemy"

Thus, it look like event 66 is "route during battle" and #95 0 is something to do with "fear" (return true if the route reason is fear?)


Title: Re: New Campaigns: Questions and suggestions
Post by: olly on April 13, 2017, 11:04:10 PM
Cool!

:)


Title: Re: New Campaigns: Questions and suggestions
Post by: Ghabry on April 18, 2017, 04:47:45 PM
Here is the formula for unit replacement: http://forum.dark-omen.org/troops/troop-replacement-cost-formulas-t881.0.html;msg9110#msg9110 (http://forum.dark-omen.org/troops/troop-replacement-cost-formulas-t881.0.html;msg9110#msg9110)

Event 78 is sent to a fanatics owning regiment when somebody is close enough (also obvious by looking at the event script ;))



Title: Re: New Campaigns: Questions and suggestions
Post by: Ghabry on April 19, 2017, 06:33:13 PM
Havn't tested this:

#95 seems to be:

Returns false when the current regiment is currently casting a spell or when the 1st argument is != 0. (I only see #95 0 usage in CTL)

Then #95 takes the last event the unit received and stores the following information:

(Note: An event can provide 5 arguments, the 1st is usually the origin, the other 4 depend on the event)

Code:
Source: (arg1) Becomes the spell target
counter: arg2
magic to use: arg3
target x: arg4
target y: arg5
x and y are only used when source is 0, otherwise source is the target.

So we need a CTL function that can populate args 3-5. I found two: cast_spell and cast_spell2 (badly named ;)).
cast_spell:
Code:
1st argument: Event to generate (usually 66). The counter is set to 1.
The event is sent to the caller of this function (makes sense).
The spell target is either the close combat target if available, or the x/y coordinates specified in that 95h-event (there are probably other ways to populate that 95h-event)
2nd argument: The flag the spell must have (I'm not sure yet how to specify exactly which spell you want exactly...)
3rd argument: Maximum amount of spell points of the spell (Wand of Jet is respected)
When 1st arg is "-1" the function checks if any magic item/spell fulfilles the condition (and sets true/false).

cast_spell2:
Same as cast_spell, but the target is the caller. When dispell magic is picked the counter is 3, otherwise 1.

#9c is able to replace arg4 and arg5 of that stored event (and does some other stuff, not investigated yet).

#8e is usually used after #95 returned true:
8e uses the data prepared by #95 and casts the spell when the unit has the specific spell and returns true in that case.
The counter is decremented by 1, when it reaches 0 the data stored by #95 is cleared.

#96: Returns true when the current unit is NOT a wizard or the magic specified by #95 is NOT a spell (so a magic item e.g.)
This is only used in func 124, for true it calls #8e, otherwise returns to func 117

func 117 invokes #81
#81: When the 1st argument is 1 (is the case for 117):
This function does some kind of distance check between the current regiment and the spell target. No idea what the purpose is.

Example usage: Necromancer in B1_04 (Bandit ambush before Bogenhafen):
Code:
init_teleport_spell 16 ; Use coordinates of BTB_6000 element 16
; init teleport also resets the CC target and sets arg4 and arg5 of the 95h event
; Maybe init_teleport_spell is actually a bad name, this is maybe to force a spell
; cast location even while in CC I guess.
set_unit_flag2 16 ; No idea
add_magic_points 3
cast_spell 66, 256, 3 ; Has no CC target, spell target will be the BTB_6000 obstacle

So I don't see a way yet how to reliable use a specific magic item...

Event 74: Broadcasted to the other regiments in the casters team. Unused it seems, arg3 is the magic (item) used.

Only used in tutorial:

#e5: Returns true when unitid arg1 is currently casting a spell at unitid arg2.

#e9: Return true when unitid arg1 has magic item/spell with id arg2.


Title: Re: New Campaigns: Questions and suggestions
Post by: cuthalion on April 19, 2017, 06:49:27 PM
Hey all,
pity I am a rare guest here. Or I would have helped Leilond to save his time. I encountered quite a lot of things he figured or asked questions about while I was an active campaign builder. For one, I tested all Play_self values in order to use Dwarvish and Skavenish phrazes from SoTHR. But I was too lazy to add them to Wiki  :-[

Anyways, I will try to pay more attention and share my experience in campaign building.


Title: Re: New Campaigns: Questions and suggestions
Post by: olly on April 19, 2017, 09:17:38 PM
Great posts and I think we sealed off the wiki to prevent bots spamming. Now we have new information to add we can unlock it for awhile.

I've also just fixed a game save issue when introducing our new maps B6_01, B6_02 into the Dark Omen 2 template mod. It was actually due to adding in more xslot characters into PLYRALL.arm which the game save doesn't recognise, since I thought the issue was due to the new maps but they are fine and save game now works. If we can only overwrite the original 24 characters in PLYRALL.arm then it's not the end of the world as we can duplicate the originals in xslots. I initially added all the new dwarfs and wood elves into PLYRALL.arm to preview them all together on the new map, so its not essential for new campaigns but if a fix could be found then so much the better, please.

Therefore we will have 24 new maps for new campaigns to use, as well as loads more custom maps that I will post easy to follow creation guides for. I will now add all the other new maps into Dark Omen 2 mod template, so we can start adding scenery and BTB boundaries.

All necessary mod tools have now been made to allow us all to finally create Dark Omen 2 so lets do it - Eternal thanks to everyone, as a real dream come true. This will keep us all going, while the Dark Omen Reborn Unreal Engine remake progresses to glory!

:)


Title: Re: New Campaigns: Questions and suggestions
Post by: Ghabry on April 19, 2017, 10:39:31 PM
The 24 chars in PLYR_ALL.arm is unfortunately hardcoded, extending this is tricky because you have to patch tons of locations in the code.


Title: Re: New Campaigns: Questions and suggestions
Post by: olly on April 21, 2017, 09:18:49 PM
Updated Mod Pack to include Dark Omen 2 mod template Game Save fix by removing extra new xslot characters from PLYRALL.arm and instead replaced all 24 originals with 24 new Dwarfs for testing. Campaign starts on new B6_01 map then B6_02 fortress map which all work fine, so will be adding the other 23 MoC maps.

http://forum.dark-omen.org/help-section/ultimate-dark-omen-xpvistawin7win81win10-game-fixes-t111.0.html (http://forum.dark-omen.org/help-section/ultimate-dark-omen-xpvistawin7win81win10-game-fixes-t111.0.html)

:)