August 22, 2019, 04:39:44 AM

Username
Password

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

Posts: 377


View Profile
« Reply #45 on: March 26, 2012, 02:12:38 PM »

I see,
Undead Chariots are Type 61 there btw.
Logged
Ghabry
Developer
*
Offline Offline

Posts: 1015



View Profile
« Reply #46 on: March 26, 2012, 03:47:27 PM »

Yes but as I said "The test looks at the Unit Type and removes the first 3 bits." And first three bits unset on 61 makes 56.
Logged

Ghabry
Developer
*
Offline Offline

Posts: 1015



View Profile
« Reply #47 on: March 26, 2012, 05:24:13 PM »

In the meanwhile I figured out how to change magic items:
Open the CLI Editor and then


> open (you get a list of map folders)
> open b1_05
> prj
b1_05.PRJ> inst
b1_05.PRJ: INST> help inst (you get a list of commands)
b1_05.PRJ: INST> list magic (everything in help under field codes can be listed)
# magic
...
12: 21
... (12 seams to be the house with the green smoke, 21 is book of ashur)
b1_05.PRJ: INST> 12 (select inst entry 12)
b1_05.PRJ: INST 12> set magic 0 (or whatever magic item you want)
b1_05.PRJ: INST 12> save
[yN] > y


I guess this can be used to add items to any game object, never tried it. For a free magic item (that is not in a building) take a look at SPARE9 (that's the tutorial). The Grudgebringer Sword is lying around their.
Logged

cuthalion
Campaign Creator
*
Offline Offline

Posts: 377


View Profile
« Reply #48 on: March 26, 2012, 05:50:06 PM »

Cool, thank you! I will try to use it.

By the way, I got yet another question.
Skeleton horsemen and black grail in .ARM files have armor 16, 17 or something. What is it about?
Logged
cuthalion
Campaign Creator
*
Offline Offline

Posts: 377


View Profile
« Reply #49 on: March 26, 2012, 06:26:09 PM »

Couldn't help sharing fun...I wanted to add a neutral-aligned mage to fight at my enemies. The result was the mage destroyed 3 enemy units of cavalry within 5 seconds. He seems to have infinite mana and can cast 10 fireballs a second.
Logged
olly
Global Spokesperson
*
Offline Offline

Posts: 1936



View Profile
« Reply #50 on: March 26, 2012, 06:39:46 PM »

Again, great progress being made that will benefit the whole community.

Many Thanks

Smiley

(Glad the BTB that I sent you works on your Win XP)
« Last Edit: March 26, 2012, 06:48:03 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)
Ghabry
Developer
*
Offline Offline

Posts: 1015



View Profile
« Reply #51 on: March 27, 2012, 08:51:34 AM »

Couldn't help sharing fun...I wanted to add a neutral-aligned mage to fight at my enemies. The result was the mage destroyed 3 enemy units of cavalry within 5 seconds. He seems to have infinite mana and can cast 10 fireballs a second.
That must be the real Dread king Smiley (or Volkmar on Killing Spree)

If you give an enemy twice the same magic item they can use it infinitly too btw (funny with hellfire sword)
Logged

cuthalion
Campaign Creator
*
Offline Offline

Posts: 377


View Profile
« Reply #52 on: March 27, 2012, 01:45:09 PM »

send_event_to_labelled 43971, 84

            on_event 84
                #99 66, 32768, 1
                end_event 6844

This forces a mage cast dispel magic.
I wonder what 66 stands for, dispel magic seems to be 56.
And I wonder what happens if to set it to an enemy infantry (provided that the infantry is set 'dispel magic' in the list of spells). This might work.

Also, there are similar events 81, 82 that trigger the following:

    on_event 82
        test_unit_flag2 2048
        iffalse
            #9b 0, 0
            iffalse
                #99 66, 512, 3
            endif
        endif
        end_event 6844
    on_event 81
        test_unit_flag2 2048
        iffalse
            #9b 0, 0
            iffalse
                #99 66, 1024, 3
            endif
        endif
        end_event 6844

#9b might be amount of mana check, and the events occur when a mage is attacked by spells or magical items. Or maybe this involves casting 'dispel magic' on friendly troops that might endure magic attacks.
Logged
Ghabry
Developer
*
Offline Offline

Posts: 1015



View Profile
« Reply #53 on: March 27, 2012, 03:01:43 PM »

Bit of topic, but because there is so much CTL testing in this topic:
#d7 n (used in B5_01 and B5_01B, thats black pyramide) checks your game if you defeated Carstein (n = 1), Hand of Nagash (n = 2) or Black Grail (n = 3). (Thats used to disable these units, but n = 1 is not used)

[And just for my reference: Dread King is func 10 + eventhandler 41]


#99 is an interesting find. I have a guess what the last parameter could be...
« Last Edit: March 27, 2012, 04:12:42 PM by Ghabry » Logged

cuthalion
Campaign Creator
*
Offline Offline

Posts: 377


View Profile
« Reply #54 on: March 27, 2012, 03:33:26 PM »

This isn't an offtopic, it will definitely be of value once I get my way to the last mission scripts Smiley
Though I already have a feeling that tough missions require only minor tweaks. If to add a lot of stuff to such missions, they become 'overloaded' and may seem even boring.
Logged
Darkmancer
Developer
*
Offline Offline

Posts: 406



View Profile
« Reply #55 on: March 27, 2012, 04:01:12 PM »

ya that #d3 is interestesting.  Presumeably it'll go to 0x1b0  in the save game and add n  * 4 bytes and check to see if its a 1 or 0.

That hopefully means you could use n=7 to see if you met lorean etc.

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

I've heard people say you get more units in the hand of nagash level if you go the long route.  Anyone confirmed this?  The codes from that be interesting if true.

PS
The Armour question.  Nobody knows, dues to the dice rolling nature of armour checks its impossible to check.  Supposedly to beat a 15 you'd have to roll a 6,6,then a 4.  Clearly this is not the case they arn't that tough. In the fourth edition i believe im correect in saying armour is limited to lvl5, which you only need three bits for, maybe the rest of the byte stands for something else?  It's the only vaguely sensible thing i could come up with, i originally thought it might be an anti-strength thing but the numbers dont make sense.
« Last Edit: March 27, 2012, 04:16:23 PM by Darkmancer » Logged

Cry woe, destruction, ruin, and decay:
The worst is death, and death will have his day.

[23:04:33] <*Ghabry> The internal design of Darkmancer is just strange
Ghabry
Developer
*
Offline Offline

Posts: 1015



View Profile
« Reply #56 on: March 27, 2012, 04:12:26 PM »

Okay, no idea what the arguments for #99 do. A call adds 1 dispel (up to 3) to the caller, that's all I could find out. And it crashes the game if its called outside of an event handler Wink

Some theories about other commands (don't guarantee the correctness)
#94 n Adds n magic points to the enemies global magic pool
#93 n Checks if the enemy has at least n magic points

Now, 14 years after release of the game, I can also finally answer what the purpose of the jewel of morslib is (If you lose against Carstein a different map is loaded at the end that contains the jewel):

test_unit_at_node 56 ; Is near the jewel (node only exists on map with jewel)
iftrue
    play 90 ; "Jewel, give me power"
    #94 3
else
    #94 1
endif

The jewel adds three magic points.


@Darkmancer:
Nope I would say the code only handles 1, 2 and 3. Returns 0 for 0 and -59?? for all other values.

And I wrote done the wrong code. It's actually #d7. I corrected it in my old post.
Logged

Darkmancer
Developer
*
Offline Offline

Posts: 406



View Profile
« Reply #57 on: March 27, 2012, 04:30:05 PM »

The Jewel also adds desire to punch level designer in face.

Shame about the check thou.  I suppose you might be able to hijack those 3 flags thou, and with a bit a luck be able to reset them to zero at various stages.

It's acually weird those flags even exist at all, I can't see any way of accidently losing a battle which wouldn't be totally devastating to your army. 
« Last Edit: March 27, 2012, 04:41:19 PM by Darkmancer » Logged

Cry woe, destruction, ruin, and decay:
The worst is death, and death will have his day.

[23:04:33] <*Ghabry> The internal design of Darkmancer is just strange
Ghabry
Developer
*
Offline Offline

Posts: 1015



View Profile
« Reply #58 on: March 27, 2012, 04:50:42 PM »

Good point.
Because you don't need to alter the content during the mission you could use WHMTG (campaign script executed between missions) commands WH_ReadVariable and WH_SetVariable to read/write values from/to these three slots on mission start (and recover the settings on end).

Yes the flags are a bit nonsense. The fastest way to lose is losing Morgan, but that is a game over. I would say everybody reloads after losing a mission anyway. And the last mission is already hard enough with Hand + Grail it would be even worse. But never tried it.

Edit:
Remember the Hand of Nagash mission. Klaus tells you that when you do sidequests you are losing important time. But I just checked the Hand of Nagash mission CTL script and there isn't really any check anywhere to disable an enemy unit.
« Last Edit: March 27, 2012, 05:01:54 PM by Ghabry » Logged

cuthalion
Campaign Creator
*
Offline Offline

Posts: 377


View Profile
« Reply #59 on: March 29, 2012, 07:44:50 PM »

I have a question about Campaign script, the flow between the battles.
I saw that page in Wiki and saw that long script, but didn't quite understand in what file it is situated and if there is an editor or xml format for it.

In particular, I have 2 ideas, maybe someone knows if they are possible or not.

1. Activate/deactivate my troops, like, allow Helmgart bowmen stay with me after I took the fortress, or something like this.

2. Change the game flow to capture all alternative missions. Like help Elrod, then help Treeman, then jump to Knights of the Realm branch. This can make the campaign longer.
Logged
Pages: 1 2 3 [4] 5 6   Go Up
Print
Jump to: