March 28, 2024, 02:26:06 PM

Username
Password

Pages: 1 2 [3] 4 5 6   Go Down
Print
Author Topic: Enemy units in Campaign  (Read 49259 times)
0 Members and 2 Guests are viewing this topic.
Ghabry
Developer
*
Offline Offline

Posts: 1020



View Profile
« Reply #30 on: March 25, 2012, 01:08:32 PM »

You can convert the phrases (which are stored in MAD and SAD files) with the SAD-MAD-Audio converter to wav. The record your own voice and convert it back to MAD/SAD Smiley. The CTL commands are play and play_other_unit. But there is no list what number plays which file. Must be somewhere in the exe.

The items that are dropped from building can be altered. It is stored in the PRJ file. In the multiplayer maps I e.g. replaced all magic items with treasures.
The PRJ files can be edited with the command line tool SPARTAAn (Just uploaded it because I couldnt find it anywhere).
I guess olly has a tutorial somewhere how to edit items. Lets wait for him.
Logged

cuthalion
Campaign Creator
*
Offline Offline

Posts: 385


View Profile
« Reply #31 on: March 25, 2012, 06:59:17 PM »

Thank you indeed for the reply! I wonder if Olly as a native speaker would record tracks to my campaign Wink
Also, by tutorial for items edit do you mean turorial that helps with that command line editor or tutorial how to edit item properties? Smiley
Logged
cuthalion
Campaign Creator
*
Offline Offline

Posts: 385


View Profile
« Reply #32 on: March 25, 2012, 07:08:08 PM »

I still can't defeat that bug with enemy artillery in my campaign.

99% of the times the artillery is in 'god mode'. My units quickly down crew to 2/4 (or to 2/6 if I increase its crew) and then 40 mins nothing happens.
If after that moment of crew 2/4 I order my troops to flee, the artillery doesn't drop off combat and the game crashes in some 30 seconds. Within those 30 seconds I can defeat it with magic though.

The .arm and .btb files are alright, and as for .ctl - Enemy artillery scripts are simply copy-pasted throughout the whole campaign except for 3 fields:
-Unit Label
-some insifnificant field  like #3e 13, 35 (please correct me if it does influence something)
-Event Handler. The last field seems important even though I don't fully understand its connection with other scripts with numbers 100+
If I set a handler to my unit that is not one of other enemy troops' handlers in that mission, the game crashes right after units deploy.
However I noticed that in ctl scripts for missions where Artillery exists, all artillery units have the same Event Handler and no other unit in that mission has the same.

After reading all my compains, could anyone help me to spill light on my problem? W/o enemy artillery varying of missions is very limited. And I have already failed to insert mages to non-mage missions. Sad

Logged
olly
Global Spokesperson
*
Offline Offline

Posts: 2268



View Profile
« Reply #33 on: March 25, 2012, 07:09:04 PM »

Audio guide - > http://wiki.dark-omen.org/do/DO/Audio  and  http://wiki.dark-omen.org/do/DO/SFX

CLI Editor example -> will do proper guide on wiki soon but have never yet modded where items are placed

open B1_01
prj
FURN
FURN>list  (lists 0-10 records)

FURN>add house2.m3d
list        (shows new record, 11 now)

INST
INST>list livemodels   (shows record eg 36)

add

list livemodels (shows the new record eg 37)

INST>37

INST37>set livemodel 11

INST37>list livemodels    (should show 37: hosue2.m3d)

INST37>get pos

INST37>[0.00,0.00,0.00]
INST37>14                 (to see pos of existing object as reference)

INST14>get pos
INST14>[164.50,9.00,150.00]

INST14>37
INST37>set pos [166.00,9.00,155.00]
INST37>get pos
[166.00,9.00,155.00]

INST37>save
INST37>y

exit
exit


INST>help inst

INST37>get min
INST37>get max
INST37>set min [0.00,0.00,0.00]
INSt37>get max [0.00,0.00,0.00]

(Bounding box for solid buidlings)


INST>list ex_walk
INST37>set ex_walk 1
INST37>list ex_walk

exit

INST37>list deadmodel
INSt37>set deadmodel 8     (same as hut dead model)

save


INST37>list burning
INST37>set burn 1
INST37>list burning

save


INST37>list wounds
INST37>set wounds 6

INST37>list toughness
INST37>set toughness 1
INST37>

Save
Save


INST  info

INST> list livemodels

INST> remove 19

INST> remove 18  etc...

INST> save

INST> y

exit
exit



*Mikademus added macros to the CLI editor to help you repeat tasks much more effeciently, which i will include in my guide*
« Last Edit: March 26, 2012, 07:01:08 PM by olly » Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
cuthalion
Campaign Creator
*
Offline Offline

Posts: 385


View Profile
« Reply #34 on: March 25, 2012, 07:22:03 PM »

Thx, I will try to learn it. Though I don't need to place items on the missions. I rather feel like removing items from 'hidden' places and giving all I need to enemy troops. Or replacing them with 'potions of strength' or Coin Chests. That will be more than enough for me. If it can be done easily...
Even though it's somewhat less diverse, it's easier for game balancing, and I am not sure ppl enjoy shooting all the houses and stones on every mission
Logged
olly
Global Spokesperson
*
Offline Offline

Posts: 2268



View Profile
« Reply #35 on: March 25, 2012, 07:36:01 PM »

yep, i've received your B104 mod and am currently checking with Wh32Edit, BTB Editor and CTL script. I will post screenshots of each for others to follow.

Smiley

« Last Edit: March 25, 2012, 07:44:01 PM by olly » Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
cuthalion
Campaign Creator
*
Offline Offline

Posts: 385


View Profile
« Reply #36 on: March 25, 2012, 07:55:20 PM »


* Mortar.JPG (81.93 KB. 900x620 - viewed 800 times.)


Didn't quite get how to insert screenshots..I attached one of the Mortar and just posted extracts from btb/ctl scripts...
It's an ordinary mortar copied from 2PARM, its Unit Id is 257, Evil Alignment.

Then, the btb contains the following record:

         <SUBRECORD type="503">
             <INT type="5"> 16387 </INT>
             <INT type="1"> 525 </INT>
             <INT type="2"> 615 </INT>
             <INT type="6"> 48 </INT>
             <INT type="7"> 125 </INT>
             <INT type="11"> 0 </INT>
             <INT type="12"> 257 </INT>
             <INT type="13"> 3 </INT>
         </SUBRECORD>

Corresponding CTL script, as I posted above is the same for all enemy artillery throughout the campaign:

.func 3
    init_unit 128
    clear_ctrl_flag 32768
    set_label 43971
    #3c 240, 0
    set_event_handler 14
    #3e 13, 32
    wait_for_deploy
    saveip
    do
        test_unit_class 32
        iftrue
            #d6 128
            iffalse
                #d6 0
                iffalse
                    #cf 1
                    #ce 1024
                    send_event_to_this 12
                    sleep1
                endif
            endif
            search_and_shoot_enemy 58, 100, 512
        else
            search_and_attack_enemy 4, 0, 4096
        endif
        set_timer 10
        wait_for_timer
    always



Logged
olly
Global Spokesperson
*
Offline Offline

Posts: 2268



View Profile
« Reply #37 on: March 25, 2012, 08:01:44 PM »

Not sure if it matters (early investigations) but you could try putting the mortar in the top slot of Wh32Edit as it has the lowest ID maybe (257 and Halbediers have 259) and maybe even make them func 0 in CTL list rather than .func3 with #3e 13, 29

Smiley

(If still a problem with BTB Editor try .net 2.0)
« Last Edit: March 26, 2012, 07:06:42 PM by olly » Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
cuthalion
Campaign Creator
*
Offline Offline

Posts: 385


View Profile
« Reply #38 on: March 25, 2012, 08:26:20 PM »

BTB Editor: At home atm with Win-7 so it works. Will try .NET 2.0 tomorrow morning.

As for your advice: there are enemy armies where Ids aren't in ascending sequence, and same for btbs.
Anyway I tried it and its about the same. The artillery behaves alright which means the script works: it shoots, and if I flee before it's 2/4 it shoots again alright.

I want to try set a unique event handler to artillery, but Im not sure how to pick up one so that it didn't crash on battle start.
Logged
olly
Global Spokesperson
*
Offline Offline

Posts: 2268



View Profile
« Reply #39 on: March 26, 2012, 12:36:33 AM »

If you added a new BTB section for the mortar, did u have to update the header by +1?

http://forum.dark-omen.org/singleplayer/enemy-units-in-campaign-t1094.0.html;msg11188#msg11188

Or that might only be required when you add new regions and boundaries.
« Last Edit: March 26, 2012, 12:50:36 AM by olly » Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
cuthalion
Campaign Creator
*
Offline Offline

Posts: 385


View Profile
« Reply #40 on: March 26, 2012, 05:48:15 AM »

I have to increase the first field in the CHUNK 6000 by 1, yes.
The thing is if I don't do such stuff, it just won't deploy. If it IS deployed in a right position, if it shoots my troops, this means that .ARM and BTB are unlikely to be a problem, and CTL is correct to the most part. But in CTL at least there are points with unknown meaning.
 Will try a further investigation. Maybe it's my army that is buggy...I will try to test the things on B2_05, where default enemy artillery is deployed, and also will try default mercenary army instead of my own.
Logged
cuthalion
Campaign Creator
*
Offline Offline

Posts: 385


View Profile
« Reply #41 on: March 26, 2012, 09:03:00 AM »

Seem to have solved it. At least on the first approach. So if the information is of any use for someone:

I was on a right track that the problem is with that line in ctl: set_event_handler
   but I wasn't sure until now what exactly it meant. The answer is very simple, even though when I was wandering in darkness of unknown functions it didn't look so.

set_event_handler XX simply sets the .func XX from CTL file as handler of events for that particular unit.
   So there are 2 ways for the artillery: either copy-paste that artillery handler from any script where artillery exists, or modify the handler for archers on this mission and use it.

Artillery handler has a peculiar item: (example is given for B205, event handler  .func 26 for orc artillery)

            on_event 23
                clear_unit_flag2 1
                #bd 8
                set_event_handler 24
                test_unit_flag1 8192

The thing is on some event the handler is set to a different one. For mission B205 event handler 24 stands for Infantry units. The assumption then is that when artillery loses its Leader it becomes an infantry and works as infantry from that moment on.

I added this instruction to Archers event handler and the enemy Mortar died quickly to my guys. The bug had occured when my troops did kill the Leader (the mortar itself) but the game didn't know how to handle that situation.

2 further things to do:

1) I will have to test if enemy archers behave correctly with that fix in the Handler. It mayhap that their leader becomes mortal before the unit dies.  This won't do.

2) Probably, copy-pasting Wizard event handler together with the Wizard script function will make casting wizards on a missions where wizards didn't exist. I will test that thing on missions like B301 or other 'late' missions that don't have default wizards.



« Last Edit: March 26, 2012, 09:10:51 AM by cuthalion » Logged
Ghabry
Developer
*
Offline Offline

Posts: 1020



View Profile
« Reply #42 on: March 26, 2012, 10:05:43 AM »

Yes set_event_handler assigns the .func as an event handler. Isn't that mentioned anywhere? Cheesy
At least the OpCode-Table says "set_event_handler func Registers func as an event handler" Wink

Let's also take a look at the player artillery. They get event handler 103. (they pass the test_unit_class 32-test). The test looks at the Unit Type and removes the first 3 bits. So for artillery this will be 32 after unsetting the first 3 bits. (see also events).

Okay so event 23 is probably regroup. Good to know. Now I wonder how the cannon gets destroyed on retreat. MUst be also some event function. But I just tested it and couldn't trigger event 23 by regrouping a cannon. Strange.

Just for reference:
.func 120 checks test_unit_class 56 in on_event 23. That's a (undead) chariot. Have to check if undead chariots use this function because funcs >= 100 are usually not used by the map AI.

Logged

cuthalion
Campaign Creator
*
Offline Offline

Posts: 385


View Profile
« Reply #43 on: March 26, 2012, 11:02:52 AM »

Well, when you aren't familiar with overall structure of the ctl file it's not evident where to seek the problem, while when you've been working with it for quite a while, things become more evident.  Embarrassed
After I localized my problem should be in event_handler, I figured out its meaning relatively easy.

Now I have a few questions.

1) I don't quite understand what you mean by 'player artillery' with event handler 103. I thought all human troops have func 100. What file are you speaking of? is it some multiplayer stuff or?..

Modified my post: got it - seems I'm slightly overloaded. in func 100 there are event handlers for human troops depending on their class, and artillery has handler 103.

2) Also, why do you think 23 is Regroup?
Artillery never routs unless the leader is dead, but then they rout with chance=100%.
Event 23 should describe that very moment when the leader dies and the crew routs.

And a few more questions:

3) Where can I find table of unit classes with values? I figured out Class 32 is artillery but that's about it.

4) Im interested in undead chariots. But again you say '.func 120' - in what file? at least in the file I've been editing now .func 120 has nothing of the kind.
I remember I saw a post where someone complained that Chariots can't be added to the campaign as human troops because they become buggy after the mission. Is there a way to solve it by editing ctl func 100 or something?..

Thank you for replies.
Logged
Ghabry
Developer
*
Offline Offline

Posts: 1020



View Profile
« Reply #44 on: March 26, 2012, 12:25:11 PM »

2) Also, why do you think 23 is Regroup?
Artillery never routs unless the leader is dead, but then they rout with chance=100%.
Event 23 should describe that very moment when the leader dies and the crew routs.

No idea was just a theory. Wink. I tested it by adding play 64 to the function. Then the unit should say "get the loot" when the event happens. But the unit didn't say it.

3) Where can I find table of unit classes with values? I figured out Class 32 is artillery but that's about it.

There isn't really an article about this, but you can find a list in the ARM Talk Section Wink.

4) Im interested in undead chariots. But again you say '.func 120' - in what file? at least in the file I've been editing now .func 120 has nothing of the kind.
I remember I saw a post where someone complained that Chariots can't be added to the campaign as human troops because they become buggy after the mission. Is there a way to solve it by editing ctl func 100 or something?..

Chariots sometimes crash the unit editor in Dark Omen because it was never intended that you can control chariots. But their is a book description for chariots. Maybe they wanted to add it but reached the deadline ^^. And in multiplayer they cause disconnects. I talk about .func 120 in B1_01. I never really checked this but thought that all funcs >= 100 are identical for all CTL-files.


.func 120
    clear_ctrl_flag 8
    do
        get_event
            on_event 19
                #14 8, 4
                end_event 6844
            on_event 23
                test_unit_class 56
                iftrue
                    #88
                endif
                end_event 6844

Logged

Pages: 1 2 [3] 4 5 6   Go Up
Print
Jump to: