September 21, 2017, 07:40:40 AM

Username
Password

Pages: 1 2 [3]   Go Down
Print
Author Topic: New Campaigns: Questions and suggestions  (Read 2042 times)
0 Members and 1 Guest are viewing this topic.
Ghabry
Developer
*
Offline Offline

Posts: 1008



View Profile
« Reply #30 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

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

Logged

Ghabry
Developer
*
Offline Offline

Posts: 1008



View Profile
« Reply #31 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 Wink).
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.
« Last Edit: April 20, 2017, 04:13:18 PM by Ghabry » Logged

cuthalion
Campaign Creator
*
Offline Offline

Posts: 370


View Profile
« Reply #32 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  Embarrassed

Anyways, I will try to pay more attention and share my experience in campaign building.
Logged
olly
Global Spokesperson
*
Offline Offline

Posts: 1828



View Profile
« Reply #33 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!

Smiley
« Last Edit: April 19, 2017, 09:28:50 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: 1008



View Profile
« Reply #34 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.
Logged

olly
Global Spokesperson
*
Offline Offline

Posts: 1828



View Profile
« Reply #35 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

Smiley
« Last Edit: April 21, 2017, 10:50:49 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)
Pages: 1 2 [3]   Go Up
Print
Jump to: