PDA

View Full Version : Ids Habbening



Woudo
February 5th, 2015, 18:12
I need some clarity on a few things;

How do I go about testing campaign maps? I need to test with a few creature config changes so I can't just do it how I normally do which is to dump it in the Free Play folder.
Related to above, is Lava Immunity a trait I can give to creatures?

I'm going to use this thread as a dump for my current questions until I finally poop out this campaign.

YourMaster
February 5th, 2015, 18:25
You can make your own campaigns, so you can test them that way.

In the KeeperFX\campgns folder you will find 'Keeporig.cfg' Make a copy of that and rename it to 'Woudo.cfg', then use a text editor to configure your own campaign. For example set "LEVELS_LOCATION = campgns/woudo", and place your own campaign levels in that folder.

In the config you can also configure the name (E.g. NAME = Woudo), this is the name under which it will show up in KeeperFX.
If you have multiple levels to test, use the -alex parameter to play the game so you can go to the next campaign level with Ctrl+F10.

This document will also help you out with your future questions: https://code.google.com/p/keeperfx/source/browse/trunk/keeperfx/docs/creating_campaigns.txt

Edit: And yes, lava immunity is a property in the creature config: HurtByLava = 0

Woudo
February 5th, 2015, 20:01
It doesn't talk about creature config files, just a global "campaign configuration file".
I need to enable lava immunity to a few creatures and add some spells.

Looking at the questth_ctr folder, I can see it's definitely possible;


[experience]
Powers = SWING_WEAPON_FIST NULL NULL NULL SPEED NULL NULL ARMOUR NULL INVISIBILITY
PowersLevelRequired = 1 0 0 0 5 0 0 8 0 10
LevelsTrainValues = 20 40 90 175 350 700 1300 700 350
GrowUp = 0 NULL 0

But how do I go about doing it?

YourMaster
February 5th, 2015, 22:11
Yes, like I said, that is something you can do with the campaign config file.
In your woudo.cfg look at this line:

;CREATURES_LOCATION = campgns/keeporig_crtr

Change it to this:

CREATURES_LOCATION = campgns/woudo_crtr

And copy all the creature config files from the creatrs folder to the campgns/woudo_crtr folder. Then in campgns/woudo_crtr/ghost.cfg set "HurtByLava = 0" to get Ghosts on your campaign to be immune to lava.

Woudo
February 6th, 2015, 01:06
So i've configured the creatures; Thankyou. Haven't tested it yet but i'll get to that.

Butt-problem.
How do I go about making a spell do more damage? I only want it to be stronger for one creature, not for every creature using that spell.
I'm seeing a lot of different stuff in these .cfg files but the only one that seems relevant is;


; Percentage of creature damage increase for every experience level
SpellDamageIncreaseOnExp = 8


Spells don't scale with strength right, that's just basic attacks?

YourMaster
February 6th, 2015, 01:45
Short answer, you can't.

Long answer, you can if you give up one of the other similar spells. For example if you take out the guided missile, you can add a fireball spell with more damage and give that new spell to only one creature.
You can't give up any of the non-fully-implemented spells like 'light' for this as creatures won't cast those, although they would work in first person. I had fun once where I gave one of my creatures the ability to casts boulder traps.
I'm guessing this is not something you'd want, but if so, I could explain further - you'd have to manipulate the magic.cfg and creature.cfg files.

Spell damage is not affected by the creature casting it, like its strength or intelligence, correct.

Woudo
February 6th, 2015, 02:50
What do you think are the most visually spectacular rarely used spells then? At least one of them would need to be AoE.
-- I'll consider this later, it'll be the last thing that gets done anyway.

Can you think of a way I can forbid an AI from digging? If I turn on the AI, it'll put the imps to work and potentially ruin the flow of the map. If I don't turn him on, his creatures walk around like Heroes looking braindead. I'd like them to be working, sleeping, training or just otherwise acting normal.
Forbidding him from worker units isn't doable.

YourMaster
February 6th, 2015, 09:59
What do you think are the most visually spectacular rarely used spells then? At least one of them would need to be AoE.
-- I'll consider this later, it'll be the last thing that gets done anyway.

Well, I really think there isn't much you can do. This is because the most important things are still hard coded, and if you have to give up a spell to make another spell you might as well simply redistribute the powers.

You have a few options.
In the magic.cfg you could change the spell15 to this:
[spell15]
Name = SPELL_MISSILE
CastAtThing = 1
ShotModel = SHOT_GRENADE
Duration = 0
Now creatures that used to shoot missiles shoot grenades instead. (You can use any shot here, like SHOT_BOULDER or SHOT_FIREBALL).
Downside is nobody shoots missiles anymore.

Alternatively, in the creature.cfg you could change instance19 to this:
[instance19]
Name = MISSILE
Time = 10
ActionTime = 6
ResetTime = 6
FPTime = 5
FPActionTime = 3
FPResetTime = 2
ForceVisibility = 100
Graphics = ATTACK
Function = creature_cast_spell SPELL_FIREBOMB 0
Now creatures that have the missile spell assigned shoot meteors instead, but do so really quickly and as such do a lot more damage over time.
Again, the downside is there are now no creatures who cast missile. Note it isn't possible to simply change the straight up damage for this new missile attack without also changing the damage of the meteor spell.

Notice you can't combine the two. If you make both changes meteors will be used, not grenades.
Clear?


Can you think of a way I can forbid an AI from digging? If I turn on the AI, it'll put the imps to work and potentially ruin the flow of the map. If I don't turn him on, his creatures walk around like Heroes looking braindead. I'd like them to be working, sleeping, training or just otherwise acting normal.
Forbidding him from worker units isn't doable.

Yes, you can manipulate the computer players by modifying keepcompp.cfg

Woudo
February 7th, 2015, 06:15
I could have sworn Skeletons were immune to disease. They could carry it but it did no damage to them.

How about that? Making someone immune to disease or giving them a permanent disease.

YourMaster
February 7th, 2015, 09:58
I've just tested it in the original game, and both skeletons and vampires take damage from disease.
And no, it is not possible either to make creatures immune to disease, this would be a creature property and this one does not exist. Check the imp.cfg for all the properties there are.

It would be better that instead of a few hard coded properties like 'immune to boulder' and 'immune to chicken' we could simply list all powers and shots on the creature immunities, perhaps in a future version this is something we'll get.

Woudo
February 8th, 2015, 11:46
Having trouble getting the campaign to work. It fails to load the level entirely.



Sync: reenter_video_mode: Switched video to 640x480x32 (mode 28)
Warning: Map file "map00000.txt" doesn't exist or is too small.
Error: load_level_file: The level "map00000" doesn't exist; creating empty map.
Sync: Created menu ID 1 at slot 0, pos (0,0) size (140,400)
Sync: Created menu ID 2 at slot 1, pos (0,0) size (140,400)
Warning: Map file "map00000.txt" doesn't exist or is too small.
Warning: update_dungeon_scores_for_player: Total score for turn is too low!
Warning: update_dungeon_scores_for_player: Managing score for turn is too low!
Sync: set_player_as_lost_level: Player 0 lost
Sync: Created menu ID 38 at slot 1, pos (0,0) size (140,400)
Sync: Created menu ID 8 at slot 2, pos (236,170) size (308,120)
Sync: Created menu ID 10 at slot 3, pos (258,172) size (264,116)
Warning: parse_campaign_common_blocks(line 19): Levels list empty in "MULTI_LEVELS" command of Campaign config file.


I don't know why it's trying to load "map 00000". I have this in the .cfg which is just the default with the name changed. Clarity will come later.



NAME = Sir Denten
LEVELS_LOCATION = campgns/sirdenten
LAND_LOCATION = campgns/sirdenten_lnd
CREATURES_LOCATION = campgns/sirdenten_crtr
;CONFIGS_LOCATION = campgns/sirdenten_cfgs
; If you wish your campaign to have custom in-game speeches or movies, you should set their location
MEDIA_LOCATION = ldata
; Single player level numbers, and bonus levels for 'Reveal hidden land' boxes
; Note that, for now, only up to 6 bonus levels is supported
SINGLE_LEVELS = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
BONUS_LEVELS = 0 0 0 0 0 0 0 100 101 0 0 0 0 0 102 0 103 104 0 0
; Multiplayer level numbers (you may also define multiplayer levels using .LOF files)
MULTI_LEVELS = 50 51 52 53 54 60 61 62 63 64 70 71 72 73 74
; Extra levels: full moon, new moon
EXTRA_LEVELS = 105

[map00001]
NAME_TEXT = Siege
NAME_ID = 202
ENSIGN_POS = 808 546
ENSIGN_ZOOM = 808 546
PLAYERS = 1
SPEECH = good01 bad01
LAND_VIEW = rgmap01 viframe01
OPTIONS = tutorial

YourMaster
February 8th, 2015, 12:26
Do you have the folder names exactly match how you've configured them?
Also, perhaps try shorter names,... your names are longer then the other campaign folder names,...

Woudo
February 8th, 2015, 12:52
nvm fixd it ;)
I had the land_location set to sirdenten_lnd which didn't exist because i'm still using default for now. Changed it back to keeporig_lnd and it worked.
It loaded the original DK map just fine but caused errors with the actual levels. Figures it'd be the other way around.



IF(PLAYER0,TIMER0 >= 1500)
IF(PLAYER0,BATTLES_WON <= 60)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,GRETCHINS,-4,1)
NEXT_COMMAND_REUSABLE
SET_TIMER(PLAYER0,TIMER0)
ENDIF
ENDIF


Let's talk about basic script. I want to talk about layered IFs, sort of.
In the above it says that party will keep spawning every 1500 ticks until the player has killed 60 creatures overall. When the player has killed 60 creatures, that script 'dies'.
Is there a way I can turn that script into spawning a different party after the 60-kill limit is used up, sort of like an ELSE command (which I know the script doesn't support) by layering IFs a bit better?

I'm just looking at the script so far and it's very basic in what it does.

YourMaster
February 8th, 2015, 14:58
IF(PLAYER0,TIMER0 >= 1500)
IF(PLAYER0,BATTLES_WON <= 60)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,GRETCHINS,-4,1)
NEXT_COMMAND_REUSABLE
SET_TIMER(PLAYER0,TIMER0)
ENDIF
ENDIF


Let's talk about basic script. I want to talk about layered IFs, sort of.
In the above it says that party will keep spawning every 1500 ticks until the player has killed 60 creatures overall. When the player has killed 60 creatures, that script 'dies'.
Is there a way I can turn that script into spawning a different party after the 60-kill limit is used up, sort of like an ELSE command (which I know the script doesn't support) by layering IFs a bit better?

I'm just looking at the script so far and it's very basic in what it does.

Not really no, the only variables you have are flags, but in your situation it would just add another IF statement. In some situations the below would be more efficient though:



IF(PLAYER0,BATTLES_WON <= 60)
SET_FLAG(PLAYER0,FLAG1,1)
ENDIF

IF(PLAYER0,FLAG1 == 0)
IF(PLAYER0,TIMER0 >= 1500)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,GRETCHINS,-4,1)
NEXT_COMMAND_REUSABLE
SET_TIMER(PLAYER0,TIMER0)
ENDIF
ENDIF

IF(PLAYER0,FLAG1 == 1)
IF(PLAYER0,TIMER0 >= 1500)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MUGLINS,-4,1)
NEXT_COMMAND_REUSABLE
SET_TIMER(PLAYER0,TIMER0)
ENDIF
ENDIF

Woudo
February 8th, 2015, 16:44
IF(PLAYER0,FLAG0 == 1)
SET_TIMER(PLAYER0,TIMER0)
SET_TIMER(PLAYER0,TIMER1)
ENDIF

IF(PLAYER0,BATTLES_WON >= 60)
SET_FLAG(PLAYER0,FLAG1,1)
ENDIF

REM ################################################## ####
REM ################################################## ####
REM ## GRETCHINS -> GROTZ HARASS ##

IF(PLAYER0,FLAG1 = 0)
IF(PLAYER0,TIMER0 >= 1500)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,GRETCHINS,-4,1)
NEXT_COMMAND_REUSABLE
SET_TIMER(PLAYER0,TIMER0)
ENDIF
ENDIF

IF(PLAYER0,FLAG1 = 1)
IF(PLAYER0,TIMER0 >= 1500)
NEXT_COMMAND_REUSABLE
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,GROTZ,-4,1)
NEXT_COMMAND_REUSABLE
SET_TIMER(PLAYER0,TIMER0)
ENDIF
ENDIF

REM ################################################## ####
REM ################################################## ####


It's adding both parties simultaneously, as if it's ignoring the FLAG call.

EDIT: Fixed
IF(PLAYER0,FLAG1 = 1)
should be
IF(PLAYER0,FLAG1 == 1)

YourMaster
February 8th, 2015, 16:59
Yes sorry, was wrong in my example.

Woudo
February 14th, 2015, 04:26
How do you give a creature a unique name? I remember reading somewhere that you could do that, but I don't remember where.
I think it might have been the .cfg.



; ONE_OF_KIND - Only one creature of that kind may exist on a specific map. Creature name is set to kind name.


"Creature name is set to kind name". Okay, how do I go about doing that?

YourMaster
February 14th, 2015, 10:17
I think you misunderstand. The avatar has this property, so his name is avatar because there is only 1 avatar. If you give this property to a Spider, all spiders would just be named 'Spider'.
And you go about that by setting the one of a kind property in spider.cfg.


You can't decide you want a Spider called 'Susan'.

Woudo
February 14th, 2015, 14:23
But if in Avatar.cfg I change it to "NAME = CAPTAIN BUTTPIRATE", then he'll be a buttpirate. Correct?

YourMaster
February 14th, 2015, 16:03
Nope. It would still be called avatar ingame, but you would have to introduce buttpirates in your level scripts.

Woudo
February 14th, 2015, 22:45
So there is no way to make the Avatar's name "Captain Buttpirate, Scourge of the Butt Seas".

If you're not absolutely certain, I can always pray to a higher power through private message.

YourMaster
February 14th, 2015, 23:11
I'm absolutely certain.

Well, that is the way to change it of course, pray to your higher power to make the change, or make a branch of the source code and implement it yourself.

Woudo
February 15th, 2015, 00:19
Well I won't do that. I want to exploit all available options to their fullest extent as I can, but I don't want to harass Mef over something so menial that'll probably go unnoticed anyway.

How does it work then? Surely it has to pull the names from a list somewhere.

- -

Truly map balancing is worse than diet cordial.

10 minutes into a game before a handful of faults is found. Quit out and change them.
10 minutes in, handful of faults. Quit out and fix them.
This part of the map isn't working well. Quit out and change it.
10 minutes in, nope now it's worse. Quit out and change it.
Oh look, all the traps I just put down are in numpad-9 instead of numpad-5. LET'S DO IT ALL AGAIN.
OH LOOK, NOTEPAD++ WANTED TO RELOAD THE SCRIPT AND I HIT YES. NOW I HAVE TO FIGURE OUT WHAT NEEDS TO BE REWRITTEN. WHY LORD.

YourMaster
February 15th, 2015, 00:48
There are 3 naming algorithms (male, female, bugs) which are used to generate names. Simply put, those algorithms pick one of the possible starter bits, one or more middle bits, and an ending of a name.

I can't say I have ever tried diet cordial, but I must confess I too have pressed 'Yes' when I meant 'No' in Notepad++ before.
Small tip; don't restart the level every time you see something that can be improved, just take notes on what you want changed and do it after retesting everything. Use the cheat-menu if it is blocking you, or if you just want to try with a few more creatures or something.

Woudo
February 15th, 2015, 12:32
Okay so in the level, a bunch of heroes are dropped in to attack an enemy keeper. They're initially allied so the heroes can 'build up strength' and then after a timer, the alliance is broken. The issue is, the hero force doesn't bother to attack.
The alliance is definitely being broken. Nearby wandering heroes have broken down the front door before and i'm sure if I put some heroes directly in the lair, they'd fight anyone nearby. The heroes have a clear path to the keepers heart, no guardposts or lava.

They seem to fall in, see that nobody is available to attack and then go AFK indefinitely, ignoring when the alliance is dropped.

YourMaster
February 15th, 2015, 14:24
Perhaps this simply doesn't work, that when they are dropped they want to attack, see it is a friendly player so drop the plan for attack. When the alliance is broken they no longer want to attack.

If you want them to 'build up strength' by receiving multiple parties,... you could use the 'countdown' in the add_to_party command, use a big delay for the creatures in the first one you drop, and a small delay for the later ones.

Woudo
February 19th, 2015, 14:37
8.4 ADD_TO_PARTY
(​[party name],​[creature],​[experience],​[gold],​[objective],​[countdown])

This command adds a number of creatures to a party (maximum seven).

[party name] - The name of the party. This must have been declared with the CREATE_PARTY command.
[creature] - The creature’s name, e.g. HORNY. See creature names section for more information.
[experience] - The creature’s experience level.
[gold] - The amount of gold the creatures are carrying.
[objective] - The target of the creatures and where they will make for when they enter the level. You will not need to specify the target player yet. This will be done when you place the party on the map.
[countdown] - Number of game turns before the leader of the party start moving to the objective. Even if this is set to zero, there usually is a little delay (approx. 200 game turns) before the leader starts moving.

Note: You can only have a maximum of 7 in a party. The leader is selected based on the creature types and their experience level (best and most experienced). Because only the leader will react on [objective] and [countdown] parameters, and you may be not certain which member will become a leader, it is wise to set these parameter to same values for all members of the party.

"You will not need to specify the target player yet. This will be done when you place the party on the map."



ADD_PARTY_TO_LEVEL(​[player],​[name],​[action point],​[a])

Very similar to the ADD_TUNNELLER_PARTY_TO_LEVEL command, this adds a party to the level but does not include a Tunneller Dwarf. This means the party will not be able to tunnel to their target.
[player] - The name of the player, e.g. PLAYER1, that the creatures belong to. See players section for more information.
[name] - The name of the party. This must have been declared with the CREATE_PARTY command.
[action point] - The number of the Action Point where the party will appear. Positive integer value. See action points section for more information.
If you want the party to appear at a Hero Gate, you will need to enter the Hero Gate’s number here. The number must have a minus sign in front of it to distinguish it from the normal Action Points. For example, if you want the party to appear at Hero Gate 4, the [action point] number will be -4.
If you want the party to appear at player's Dungeon Heart, you need to enter the player's name instead of the number (see players section).
[a] - The number of copies of the party to be placed down at the Action Point.


It's the same for ADD_CREATURE_TO_LEVEL as well. Apparently only tunneller parties can be directed to attack a certain player or head towards an action point. Sure, I can direct the party to ATTACK_DUNGEON_HEART in the party settings but not whose dungeon heart it is they attack.

I'm going to try putting them in a Tunneller party and then killing the tunneller immediately as he spawns. I have no doubt losing the tunneller will break the party though.

YourMaster
February 19th, 2015, 14:55
What is it you want exactly? Why do you want to 'build up strength' instead of just spawning everything you want at the same time?

Woudo
February 20th, 2015, 02:34
This is a different level. I'm trying to direct a party of creatures to attack a certain player but because only tunneller parties can take direct navigation orders, I either need to give them a tunneller which would look weird or find some other way around it. I haven't tested myself into a corner yet, I stopped yesterday because the map froze which killed my spirits.

I swear man, every time I try to make a map centered around flies, it dies on me and needs to be neutered.

YourMaster
February 20th, 2015, 08:52
Well, that is possible. Simply spawn the party when the player triggers the action point. They will see the creature that spawned them make their way to that dungeon.

Woudo
February 21st, 2015, 04:48
Wouldn't work with what i'm trying to do i'm afraid. I've decided to drop the 'build-up' part of level 1 by just swapping it to waves. The player was supposed to be able to look up and see the hero army growing in size before it went marauding through the allied keeper bases. As it is now however, the player has too much to do in their own section to spend time looking up at the top half of the map anyway. Mef acknowledged the hero laziness was a bug or just generally not what they were supposed to be doing and asked me to post it to the issues list with a savefile, but i'm having trouble reproducing it in a test map. It's probably some fault on my end.

Do you happen to know how the TOTAL_GOLD_MINED variable works? Is a block of gold worth X amount? Does it count gold that isn't dropped off at a treasury?

YourMaster
February 21st, 2015, 08:18
Total gold mined works, the first level of the campaign uses it, as does level 18.
There is a recent fix where it also works in first-person mode. It gets counted from mining, not dropping in treasury.

How much gold is in each block is stipulated in the rules.cfg. (1024)

Woudo
February 25th, 2015, 19:42
DISPLAY_INFORMATION

DISPLAY_INFORMATION(​[a],​[place])

where:

[a] - The number of the message, assigned to it in .po or .pot translation file.


what .po .pot
where .po .pot
how get .po .pot

me want professionalism
me want clean script
if not me just use quick_objective
ooga booga

many moons spent
progress slow
campaign finish maybe never
pour life into crap :(

YourMaster
February 25th, 2015, 23:03
Ooga booga to you too.

If you're not doing multiple languages, then using quick information/objectives is just fine. Your script won't be less clean for it - when using translation files it is best to still include the message as a remark in the script.

If you do want to make translations, or hope that somebody else will add them, check the wiki: https://code.google.com/p/keeperfx/wiki/CreateNewPot

Woudo
February 26th, 2015, 13:15
PLAY_MESSAGE

Allows to play any SOUND or SPEECH from the game. Example:

PLAY_MESSAGE(PLAYER0,SPEECH,107)

Anywhere I can find a list of these? I need the alert for your dungeon heart being attacked, specifically. With how spammy messages are, it's just not good enough to use a green indicator. They're too often ignored and as it is currently, it's too easily for the player to be stealth-defeated without some kind of audio cue.

I also need the correct number representing Hold Audience for the Tutorial_Flash_Button command.

YourMaster
February 26th, 2015, 14:36
PLAY_MESSAGE

Allows to play any SOUND or SPEECH from the game. Example:

PLAY_MESSAGE(PLAYER0,SPEECH,107)

Anywhere I can find a list of these? I need the alert for your dungeon heart being attacked, specifically. With how spammy messages are, it's just not good enough to use a green indicator. They're too often ignored and as it is currently, it's too easily for the player to be stealth-defeated without some kind of audio cue.

I also need the correct number representing Hold Audience for the Tutorial_Flash_Button command.

You want this one:
PLAY_MESSAGE(PLAYER0,SPEECH,8)
But when your heart is being attacked the sound plays automatically right?

I don't know if there is a list somewhere. But with DKSOUND.exe from the tools ('http://keeper.lubiki.pl/html/dk_keeperfx_devel.php') you can open sound.dat and speech.dat from your keeperfx sound folder and play all the messages in there. (You have to rename speech_eng.dat to speech.dat for the DKSOUND.EXE to see the file).

And don't ask me why, but for some reason you cannot flash Call to Arms, Chicken and Hold Audience.
If it is really important to you, you could move the spells around by changing the 'PanelTabIndex' in magic.cfg.

Woudo
February 26th, 2015, 15:19
If it is really important to you, you could move the spells around by changing the 'PanelTabIndex' in magic.cfg.

Unfortunately it is pretty important. It's both required to finish the level and on somewhat of a timer.
What else would that screw with exactly?

---
On an unrelated note, i'm using some code that i'm unsure of;



REM ## ADVANCING THE HORDE SPAWN POSITIONS ##

IF_ACTION_POINT(5,PLAYER_GOOD)
IF(PLAYER1,DUNGEON_DESTROYED == 1)
SET_FLAG(PLAYER0,FLAG3,1)
ENDIF
ENDIF

IF_ACTION_POINT(6,PLAYER_GOOD)
IF(PLAYER1,DUNGEON_DESTROYED == 1)
IF(PLAYER3,DUNGEON_DESTROYED == 1)
SET_FLAG(PLAYER0,FLAG3,2)
ENDIF
ENDIF
ENDIF


These are one-time triggers, right? No NEXT_COMMAND_REUSABLE so it should be one-time. If one of the heroes decides to walk all the way back to hero gate (as they currently feel like doing), I don't want him to re-trigger the action points.

YourMaster
February 26th, 2015, 16:22
Technically everything would work perfectly. It is just that players know when spells/rooms are not yet researched which spells they are going to get by the locations of the question marks. When you move spells around, they will be surprised.

See image:
1571

And your code works,... every action point will always be triggered just once ('http://keeper.lubiki.pl/dk1_docs/dk_scripting_ref.htm#scrpt_cmd_reset_action_point' ).

dayokay
February 26th, 2015, 16:25
I don't know if there is a list somewhere. But with DKSOUND.exe from the tools ('http://keeper.lubiki.pl/html/dk_keeperfx_devel.php') you can open sound.dat and speech.dat from your keeperfx sound folder and play all the messages in there. (You have to rename speech_eng.dat to speech.dat for the DKSOUND.EXE to see the file).

For a list of PLAY_MESSAGE(PLAYER0,SPEECH,?), see enumeration TbSpeechMessages here:
https://code.google.com/p/keeperfx/s...ui_soundmsgs.h

YourMaster
February 26th, 2015, 16:31
For a list of PLAY_MESSAGE(PLAYER0,SPEECH,?), see enumeration TbSpeechMessages here:
https://code.google.com/p/keeperfx/s...ui_soundmsgs.h

Your link doesn't work.

dayokay
February 26th, 2015, 16:45
https://code.google.com/p/keeperfx/source/browse/trunk/keeperfx/src/gui_soundmsgs.h

try again

YourMaster
February 26th, 2015, 17:14
Yeah ok, seen that one before. It's not a full transcript but it works well enough I guess. Note this doesn't work well for sounds.

If you want to alert the player, these work very well too:

PLAY_MESSAGE(PLAYER0,SOUND,84)
PLAY_MESSAGE(PLAYER0,SOUND,89)
PLAY_MESSAGE(PLAYER0,SOUND,90)

mefistotelis
February 26th, 2015, 22:00
It's not a full transcript but it works well enough I guess.

Full script is here:
https://code.google.com/p/keeperfx/source/browse/trunk/keeperfx/lang/speech_eng.pot

YourMaster
February 26th, 2015, 22:52
See, that's better. Now to do the same for the sounds:

#: sound:1
msgctxt "Movement sound"
msgid "Plonkk"
msgstr ""

#: sound:94
msgctxt "Creature noise"
msgid "Pfflfflle"
msgstr ""

#: sound:104
msgctxt "Room ambient sound"
msgid "pwaahpwk"
msgstr ""

#: sound:436
msgctxt "Vocalisation"
msgid "oeaagaahaaa"
msgstr ""

835 more to go.

Woudo
March 2nd, 2015, 17:44
So I went back and tested map1. I was hoping I could finish it and lock it away in the campgn folder so I NEVER HAVE TO SEE IT AGAIN. Unfortunately not the case. I've fixed a few issues and i'm still debating whether or not to implement the magic swap or not but for now, I got this overflow problem;



SET_FLAG(PLAYER0,FLAG3,0)

REM ################################################## ####
REM ## SET HORDE CONSTANT HARASS ##

IF(PLAYER0,TIMER3 >= 4500)
IF(PLAYER0,FLAG3 == 0)
NEXT_COMMAND_REUSABLE
ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DRAGON,-1,2,5,0)
NEXT_COMMAND_REUSABLE
ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DEMONSPAWN,-1,6,4,0)
NEXT_COMMAND_REUSABLE
ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,HELL_HOUND,-3,3,4,0)
ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,HELL_HOUND,-3,4,3,0)
SET_TIMER(PLAYER0,TIMER3)
ENDIF
ENDIF

*OTHER GROUP*

*OTHER GROUP*

REM ################################################## ####
REM ################################################## ####
REM ## ADVANCING THE HORDE SPAWN POSITIONS ##

IF_ACTION_POINT(5,PLAYER_GOOD)
IF(PLAYER1,DUNGEON_DESTROYED == 1)
SET_FLAG(PLAYER0,FLAG3,1)
ENDIF
ENDIF

IF_ACTION_POINT(6,PLAYER_GOOD)
IF(PLAYER1,DUNGEON_DESTROYED == 1)
IF(PLAYER3,DUNGEON_DESTROYED == 1)
SET_FLAG(PLAYER0,FLAG3,2)
ENDIF
ENDIF
ENDIF


The idea is the first block of creatures spawns every 4500 ticks until they've beaten down the first keeper and hit the action point. The spawns are then upgraded in strength and the spawn point is moved ahead.

The very first spawn of that group works fine but the second spawn produces this; http://i.imgur.com/p8tGhH9.jpg
If I put SET_TIMER at the top of the instruction block, would it make any difference compared to it being at the bottom?

YourMaster
March 2nd, 2015, 18:10
So I went back and tested map1. I was hoping I could finish it and lock it away in the campgn folder so I NEVER HAVE TO SEE IT AGAIN. Unfortunately not the case. I've fixed a few issues and i'm still debating whether or not to implement the magic swap or not but for now, I got this overflow problem;
The idea is the first block of creatures spawns every 4500 ticks until they've beaten down the first keeper and hit the action point. The spawns are then upgraded in strength and the spawn point is moved ahead.

The very first spawn of that group works fine but the second spawn produces this; http://i.imgur.com/p8tGhH9.jpg
If I put SET_TIMER at the top of the instruction block, would it make any difference compared to it being at the bottom?

Without looking at your script, just from the picture it looks like you forgot to put "next_command_reusable" before the "set_timer" command, so after the first loop, the second time it will keep spawning parties indefinately.
It does not matter in which order you place the commands.

Woudo
March 3rd, 2015, 02:27
Yeah ignore that post. I don't know why I didn't think of it immediately but I did as soon as I was trying to get to sleep.

Woudo
March 6th, 2015, 05:35
Currently i've been mapmaking with Z (Paint tool) and F (random wall) when it comes to building dungeons and fortifications but i'm really, really not feeling it anymore. The random \ (torchwall) tiles placing torches in weird spots which eventually end up floating on nothing when I redraw the area. I have to either remove them manually or refresh things entirely, which can cause problems with unusual but intentional placed things. Other times you get patches of dungeon where it's super dark because no torches spawned. I really think I might just use ^ (drapewall) for everything from now on and start placing torches manually, at least when it comes to hero castles. Random wall makes it a bit harder to read the map in Adikted as well.

Can you tell me what Column mode in Adikted does? Press C while in slab mode.

YourMaster
March 6th, 2015, 10:15
I've never used column mode, but I think the adikted help text about it is pretty clear(press F1 when you are in column mode):

"[...]The only difference is that instead of seeing the slab key, you now see the column data for the highlighted subtile[...]
Manually setting a column allows you to create illusions and hide objects.[...]"

Woudo
March 16th, 2015, 09:52
Brainfart - Do multiple portals spawn creatures faster than having just one?

YourMaster
March 16th, 2015, 10:48
No.

You could script it out of course by changing the generate speed when the player claims an additional portal, but this will affect all players.

Woudo
March 16th, 2015, 12:32
LOOB SHUT UP
EMERGENCY

I NEED A USEABLE VERSION OF THE ORIGINAL DUNGEON KEEPER MAP IN JPEG OR PNG FORMAT

YourMaster
March 16th, 2015, 13:26
Please allow me to shut up, and give you this image:1593

If this is not the one you want, download this file: http://keeper.lubiki.pl/releases_big/gfx_sources_v9.7z
Look in the keeporig_lnd folder.

Woudo
April 3rd, 2015, 02:26
Hey Loob, do you know what "PERSUADE" does? It's an AngerJob I saw in the vampire.cfg.

Decreases happiness in creatures near to the vampire?

YourMaster
April 3rd, 2015, 07:18
Warlock has it too. It is starting a rebellion, having other creatures join him in anger.

mefistotelis
April 3rd, 2015, 13:50
Warlock has it too. It is starting a rebellion, having other creatures join him in anger.

Yup, he will gather a party of creatures and unless the player intervenes, he will heave the dungeon with them.

Woudo
April 11th, 2015, 04:49
I'm fairly certain it is, but SET_TIMER and GAME_TURN operate in the exact same way correct? Using SET_TIMER at the start of a map isn't any more reliable than GAME_TURN is?

I remember reading about GAME_TURN being unreliable depending on the quality of the players computer.

YourMaster
April 11th, 2015, 08:05
I'm pretty sure this is not the case and best practice is to use gameturn when relevant.

Woudo
April 11th, 2015, 08:11
Since when did you not know the answer to something DK1 related? Why GAME_TURN over SET_TIMER?

- - - -

Alright, here's a problem to solve.

I want a Tunneler party that will randomly tunnel to point A, B, C, D or 1, 2 or Y, Z.
That's easy enough to do with the DRAWFROM command, but I want to remove a possibility from the list when it has been tunneled to.

I can achieve that by assigning a flag to each action point and triggering it when reached by the party but due to the high number of variables, it'll become a bit too bloated.

- - - -

Nevermind, I think I got something that will work.



IF(GAME_TURN >= 5000)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(2,3,6),3,0)
SET_TIMER(PLAYER0,TIMER0)
ENDIF

IF(PLAYER0,TIMER0 >= 5000)
IF_ACTION_POINT(2,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(3,6),3,0)
IF_ACTION_POINT(3,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(2,6),3,0)
IF_ACTION_POINT(6,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(2,3),3,0)
SET_TIMER(PLAYER0,TIMER1)
ENDIF
ENDIF

IF(PLAYER0,TIMER1 >= 7500)
IF_ACTION_POINT(2,PLAYER3)
IF_ACTION_POINT(3,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,6,3,0)
IF_ACTION_POINT(3,PLAYER3)
IF_ACTION_POINT(6,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,2,3,0)
IF_ACTION_POINT(6,PLAYER3)
IF_ACTION_POINT(2,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,3,3,0)
ENDIF
ENDIF
ENDIF


That should work. It'd be bloated and unusuable if I was picking between all 8 in one draw but i've separated the action_points into 'difficulty levels'. 2,3,6 are easy-tier so I just need to write out the same sort of stuff for the other tiers and then piece all the timers together.

- Is having SET_TIMER under the original IF going to work or do I need to add SET_TIMER after every ADD_TUNNELLER command?

YourMaster
April 11th, 2015, 12:18
I'm sorry to have disappointed you.

Game turn works the same as timer, so when you want it from the start it saves you from setting the times. Also, when you set the timer from the beginning it might take a few game turns for it to start. Works either way though.

As far as I can see, your script should work. You could probably make a more efficient version by resetting the action points.

Timer1 will be only triggered now on AP6. If you'd want it on 2 and 3 as well you can indeed just move it down a single line to be under the original IF statement.


IF(PLAYER0,TIMER0 >= 5000)
IF_ACTION_POINT(2,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(3,6),3,0)
IF_ACTION_POINT(3,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(2,6),3,0)
IF_ACTION_POINT(6,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(2,3),3,0)
ENDIF
SET_TIMER(PLAYER0,TIMER1)
ENDIF

Woudo
May 2nd, 2015, 17:22
Pretty sure i'll need to throw the concept of a storyline into the bin. Even after I reduced dialogue to monologue + occasional snarky comment, it was just bloated, chewed up too many IF commands and it slowed the pace of the game down (and that's saying something considering what game we're talking about.)

Question; According to my ability to 1+1+1, I have 44 IF's in my script but the log is reporting that i've hit the 48/48 limit. Why?
Apparently ADD_CREATURE_TO_LEVEL counts as a party trigger, which while i'm pretty sure I did read that somewhere, I neglected to take notice of until now.

Beginning to realize i've dreamed to big; knife goes in, script comes out.

YourMaster
May 2nd, 2015, 20:04
Is the answer to your question that you simply can't count? Or have forgotten to include the IF_AVAILABLE and the IF_CONTROLS commands?

I tend to dislike the stories in DK campaigns as well,... it is annoying to read the small message windows and there is very little to connect the story to the choices the player makes or to what happens during gameplay. And in general I really like stories in my games.

The vanilla campaign had it just right: "This realm is controlled by 4 wizards, kill them all".
Level 20 had a lot more story, and it already failed at that.

Woudo
May 3rd, 2015, 12:13
I suspected most people felt that way and as i've already said, it's such a hassle to get it to work that I just won't bother.

I CTRL-F'd "IF" in Notepad++ and counted all of those pertaining to the script. A count of 44, not including ENDIF's. Although IF( lines were highlighted, IF_ were not and as such I hadn't counted the six IF_ACTION_POINT lines. At least now I know how much needs to be cut.

Woudo
May 15th, 2015, 10:18
SET_COMPUTER_PROCESS(​[player],​["process name"],​[priority],​[money minimum],​[turn scale],​[gold dug at once],​[max distance])

SET_COMPUTER_PROCESS(PLAYER1,"DIG TO CLOSE GOLD",0,5000,20000,30,10)


"Blue AI, if you have at least 5000 gold, dig to a vein within 10 tiles and tag 30 gold tiles. Repeat this after 20000 game turns."

Am I correct in this? I'm trying to make a map similar to map00013 of the default campaign but the blasted AI BASTARDS keep tagging the gold right beside the player base and ignoring the fat juicy veins right beside them. At least two of the AI's are knocking on the front door before the player has even built their rooms. I have priority set to 0 but as I lifted the code directly from the map00013 script (which does work) I figured that meant 0 was first in line so to speak.

mefistotelis
May 15th, 2015, 20:47
SET_COMPUTER_PROCESS(​[player],​["process name"],​[priority],​[money minimum],​[turn scale],​[gold dug at once],​[max distance])



I just documented these in KeeperFX, with:


; <priority> - priority of the process, it is increased automatically evey time computer player lacks money
; <money_below> - gold amount; the process is started only if prediction of gold left after next payday falls below it
; <distance_inc_turns> - max digging distance increases with length of the gameplay; every given gameturns amount it expands one subtile
; <slabs_at_once> - amount of slabs marked for diggind during one run of the process
; <initial_distance> - initial max distance at which digging is allowed; in subtiles


Also, note that defaults are:
"DIG TO GOLD" - 0 10999 150 7 0
"DIG TO CLOSE GOLD" - 0 30999 500 5 71

One slab is 3x3 subtiles, btw.

YourMaster
May 16th, 2015, 02:27
SET_COMPUTER_PROCESS(​[player],​["process name"],​[priority],​[money minimum],​[turn scale],​[gold dug at once],​[max distance])

SET_COMPUTER_PROCESS(PLAYER1,"DIG TO CLOSE GOLD",0,5000,20000,30,10)


"Blue AI, if you have at least 5000 gold, dig to a vein within 10 tiles and tag 30 gold tiles. Repeat this after 20000 game turns."

Am I correct in this? I'm trying to make a map similar to map00013 of the default campaign but the blasted AI BASTARDS keep tagging the gold right beside the player base and ignoring the fat juicy veins right beside them. At least two of the AI's are knocking on the front door before the player has even built their rooms. I have priority set to 0 but as I lifted the code directly from the map00013 script (which does work) I figured that meant 0 was first in line so to speak.

See Mefisto's answer: You've got it set to 3 tiles(10 subtiles), not 10 tiles. Does it work as expected when you change it to 'SET_COMPUTER_PROCESS(PLAYER1,"DIG TO CLOSE GOLD",0,5000,20000,30,30)'?



Also, note that defaults are:
"DIG TO GOLD" - 0 10999 150 7 0
"DIG TO CLOSE GOLD" - 0 30999 500 5 71

The default distance for Dig to gold is 0? Does that mean infinite or right up against the dungeon?

Woudo
May 16th, 2015, 09:41
; <priority> - priority of the process, it is increased automatically evey time computer player lacks money
So higher priority makes it happen sooner? I'll raise the priority then.
This changed nothing.


; <money_below> - gold amount; the process is started only if prediction of gold left after next payday falls below it
Alright, so since they start with 12500, I should raise the money minimum in SET_COMPUTER_PROCESS to 50,000 or so. As they'll always be falling underneath the 50k minimum, they won't push out until their rooms are built and their gold costs are lower.
This changed nothing.


; <initial_distance> - initial max distance at which digging is allowed; in subtiles
This wasn't a problem to begin with as they're less than three slabs away from the gold.
Raising it to 30 also changed nothing.

Gonna quick try something.
- - -
Alright so I lifted the line from map000013 and implemented it into my map as is. The AI still acted the same.
- - -
I changed the computer AI from 1/0/0 to 10/10/10 just like in Map00013. The AI still acted the same.
- - -
I deleted the SET_COMPUTER_PROCESS scripts entirely. The AI still acted the same.
- - -
I copied my script and pasted it onto map00013. It worked, the AI no longer immediately tunneled to the player.

I'm not entirely sure what's wrong but it must be related to the slab placement.

====

https://www.mediafire.com/?hbctcvci1pq1ddd

I don't know what it's problem is. I've stripped it and rebuilt it so many times it's hit the point where it doesn't even remotely resemble what my original vision of it was.
Every single time both AI's will make a 'hand-shake' tunnel in the middle, build two or three of their core rooms, promptly run out of money (from imp spam mostly) and then decide the thin strips in the middle of the map are the ideal veins for replenishing their gold supply.

I've tried with the SET_COMPUTER_PROCESS and without it.
I've tried with a pre-built treasury and without it.
I've tried using different AI settings.
The player originally had neutral portals which I thought maybe attracted the computer. So I changed it.
The AI terrain originally had staggered water pools and dirt turf which I thought maybe conflicted with their build patterns. So I changed it.
I've inflated the gold veins near the computer player.
I've checked the distance between outer heart wall and gold vein in map00013 and compared it to mine.
The only thing I haven't tested is unlike in Map00013 where the player is on their own island, my map has the players dungeon connected to the major landmass by two thin stretches. I highly doubt it's relevant though.

I can fix the map somewhat, I think, by giving the AI inflated starting gold. Since I know they'll immediately tunnel to the middle when they run out of gold, I can just give them enough gold to last 15 minutes or so of gameplay. Hopefully then they won't tunnel to the middle until after that.
The map is attached if anyone wants to look at logs or take a stab at it themselves.

mefistotelis
May 16th, 2015, 11:45
The default distance for Dig to gold is 0? Does that mean infinite or right up against the dungeon?

This means "at start of the game, dig only gold veins touching the players rooms. But every 150 turns increase this max distance by one subtile".

Note that 150 turns is ~8 seconds. This means it takes 23 seconds for computer player to expand the search range radius by one slab. Within 30 minutes, computer player searches whole map for gold veins, even if he starts the game in a corner (if he's near center, then less than 15 minutes).

Woudo
May 16th, 2015, 15:09
I took Mef's above comment into account and made changes to the values. No change in behavior.
Implemented my previous suggestion and changed their starting gold to 100k each. This time they tunneled straight up the middle but didn't bother to dig the thin veins of gold.

This whole time I thought they were digging to the middle in search of gold, but I guess they're just doing it as an aggressive action. Still doesn't explain why they don't make any such tunnels on map00013 though.
Perhaps because map00013 has impassable lava?

Either way i'll step away from this for now and return to it later.

YourMaster
May 16th, 2015, 16:25
I've looked at your map and I don't see any reason why they won't dig for gold. It looks like the same problem I reported on issue #604 ('https://code.google.com/p/keeperfx/issues/detail?id=604'), where the AI just isn't interested in gold. I've attached your map to the issue.

You do have a scripting error in your victory condition, but fixing that makes no difference here.

Edit: I'm sure now it is bug #604 that is affecting this map. I changed your map on the level editor to make the blue/green hearth rooms square to see if that made a difference,...
It did, but they still wouldn't mine gold. Instead the 'tunnel' they made towards each other was now a single tile shorter, no longer touching each other. This is the exact same tunnel the CP also makes on #604.
I have no idea why on some maps the CP behaves like this and on some it does not.

Woudo
June 4th, 2015, 16:10
Referring back to the problem on page 6. I tried stepping back to it and have this;



REM ################################################## ####
REM ################################################## ####
REM ### AI TUNNELLER CONTROLS ###
REM ### EASY LOCATIONS ###

IF(PLAYER0,TIMER0 >= 2500)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(2,3,6),3,0)

IF(PLAYER0,TIMER0 >= 5000)
IF_ACTION_POINT(2,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(3,6),3,0)
IF_ACTION_POINT(3,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(2,6),3,0)
IF_ACTION_POINT(6,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(2,3),3,0)
ENDIF
ENDIF

IF(PLAYER0,TIMER0 >= 7500)
IF_ACTION_POINT(2,PLAYER3)
IF_ACTION_POINT(3,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,6,3,0)
IF_ACTION_POINT(3,PLAYER3)
IF_ACTION_POINT(6,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,2,3,0)
IF_ACTION_POINT(6,PLAYER3)
IF_ACTION_POINT(2,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,3,3,0)
ENDIF
ENDIF
ENDIF


Unfortunately the game doesn't spawn the second party citing "Conditions too deep in script" as the problem.
I also was worried about overspending the IF command budget but completely forgot there is a tiny 16 command limit for Tunneler parties.

I think i'm going to need to revise the level.

YourMaster
June 4th, 2015, 18:41
You're missing an ENDIF at line 8 and a lot of ENDIFs after the IF_ACTION_POINT commands.

Edit, this should work:
REM ################################################## ####
REM ################################################## ####
REM ### AI TUNNELLER CONTROLS ###
REM ### EASY LOCATIONS ###

IF(PLAYER0,TIMER0 >= 2500)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(2,3,6),3,0)
ENDIF

IF(PLAYER0,TIMER0 >= 5000)
IF_ACTION_POINT(2,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(3,6),3,0)
ENDIF
IF_ACTION_POINT(3,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(2,6),3,0)
ENDIF
IF_ACTION_POINT(6,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(2,3),3,0)
ENDIF
ENDIF

IF(PLAYER0,TIMER0 >= 7500)
IF_ACTION_POINT(2,PLAYER3)
IF_ACTION_POINT(3,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,6,3,0)
ENDIF
ENDIF
IF_ACTION_POINT(3,PLAYER3)
IF_ACTION_POINT(6,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,2,3,0)
ENDIF
ENDIF
IF_ACTION_POINT(6,PLAYER3)
IF_ACTION_POINT(2,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,3,3,0)
ENDIF
ENDIF
ENDIF

Woudo
June 5th, 2015, 05:11
This is why I gotta stop taking so many breaks. Missing the line 8 ENDIF + line 7 indentation is embarrassing; i'm completely forgetting how to even do the basics.
I went back into it and tried what you said but it unfortunately didn't work; only one party out of that block of three actually spawns. It claims "Warning: Missing ENDIF's in script file". I just don't think DKScript supports this kind of formatting.

What worries me now though is this;



Script(line 101): script_recognize_params: Function "DRAWFROM" returned value "3"
Script(line 106): script_recognize_params: Function "DRAWFROM" returned value "6"
Script(line 109): script_recognize_params: Function "DRAWFROM" returned value "6"
Script(line 112): script_recognize_params: Function "DRAWFROM" returned value "3"
Script(line 149): script_recognize_params: Function "DRAWFROM" returned value "5"
Script(line 153): script_recognize_params: Function "DRAWFROM" returned value "8"
Script(line 156): script_recognize_params: Function "DRAWFROM" returned value "1"
Script(line 159): script_recognize_params: Function "DRAWFROM" returned value "5"


Looks like DRAWFROM is decided at the start of level load like RAND. The entire idea was three tunneler parties would tunnel to the three spots in a random order, one at a time, and scratch a location off the list after it had been tunneled to.
I haven't actually seen parties go to the same place yet so I could be wrong, but as you well know I hardly have their functionality put together.

YourMaster
June 5th, 2015, 09:23
I did not just add 1 endif, I added about 5 in the script. Did you notice the ENDIF's after the 'IF_ACTION_POINT'?

And yes, DRAWFROM is done at the start of level. RANDOM will become truly random when it is implemented.

Woudo
June 5th, 2015, 09:58
I did, I fixed them all and went over it properly this time. Notepad++ shows dotted lines connecting each IF and ENDIF statement which i've noticed before but never really taken advantage of and there was some defunct code at the bottom i'd forgotten about that was causing the missing ENDIF's warning.
No change to the Tunnelers though. I only get three parties and those are the three not involved in the cascading IF statements.



REM ################################################## ####
REM ################################################## ####

LEVEL_VERSION(1)

SET_GENERATE_SPEED(800)

COMPUTER_PLAYER(PLAYER1,8)
COMPUTER_PLAYER(PLAYER2,1)

START_MONEY(PLAYER0,500)
START_MONEY(PLAYER1,100000)
START_MONEY(PLAYER2,25000)

MAX_CREATURES(PLAYER0,12)
MAX_CREATURES(PLAYER2,20)

ALLY_PLAYERS(PLAYER0,PLAYER2,1)
ALLY_PLAYERS(PLAYER0,PLAYER3,1)
ALLY_PLAYERS(PLAYER2,PLAYER3,1)

SET_TIMER(PLAYER0,TIMER0)

REM ################################################## ####
REM ################################################## ####

ADD_CREATURE_TO_POOL(WIZARD,3)
ADD_CREATURE_TO_POOL(ARCHER,4)
ADD_CREATURE_TO_POOL(DWARFA,30)
ADD_CREATURE_TO_POOL(THIEF,4)
ADD_CREATURE_TO_POOL(TUNNELLER,30)
ADD_CREATURE_TO_POOL(GIANT,30)

REM ################################################## ####
REM ################################################## ####

CREATURE_AVAILABLE(PLAYER0,WIZARD,1,0)
CREATURE_AVAILABLE(PLAYER0,ARCHER,1,0)
CREATURE_AVAILABLE(PLAYER0,DWARFA,1,0)
CREATURE_AVAILABLE(PLAYER0,THIEF,1,0)
CREATURE_AVAILABLE(PLAYER0,TUNNELLER,1,0)
CREATURE_AVAILABLE(PLAYER2,GIANT,1,0)

REM ################################################## ####
REM ################################################## ####

ROOM_AVAILABLE(PLAYER0,TREASURE,1,1)
ROOM_AVAILABLE(PLAYER0,LAIR,1,1)
ROOM_AVAILABLE(PLAYER0,GARDEN,1,1)
ROOM_AVAILABLE(PLAYER0,TRAINING,1,1)
ROOM_AVAILABLE(PLAYER0,RESEARCH,1,1)
ROOM_AVAILABLE(PLAYER0,WORKSHOP,1,0)
ROOM_AVAILABLE(PLAYER0,BARRACKS,1,0)

REM ################################################## ####
REM ################################################## ####

DOOR_AVAILABLE(PLAYER0,WOOD,1,0)
DOOR_AVAILABLE(PLAYER0,BRACED,1,0)
DOOR_AVAILABLE(PLAYER0,STEEL,1,0)
DOOR_AVAILABLE(PLAYER0,MAGIC,1,0)

REM ################################################## ####
REM ################################################## ####

TRAP_AVAILABLE(PLAYER0,ALARM,1,0)
TRAP_AVAILABLE(PLAYER0,LIGHTNING,1,0)
TRAP_AVAILABLE(PLAYER0,WORD_OF_POWER,1,0)
TRAP_AVAILABLE(PLAYER0,BOULDER,1,0)
TRAP_AVAILABLE(PLAYER0,POISON_GAS,1,0)

REM ################################################## ####
REM ################################################## ####

MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_SIGHT,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_OBEY,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_DISEASE,1,0)

REM ################################################## ####
REM ################################################## ####

CREATE_PARTY(DIGLETT)
ADD_TO_PARTY(DIGLETT,DWARFA,2,0,DEFEND_PARTY,0)
ADD_TO_PARTY(DIGLETT,DWARFA,2,0,DEFEND_PARTY,0)
ADD_TO_PARTY(DIGLETT,DWARFA,1,0,DEFEND_PARTY,0)
ADD_TO_PARTY(DIGLETT,DWARFA,1,0,DEFEND_PARTY,0)

REM ################################################## ####
REM ################################################## ####
REM ### AI TUNNELLER CONTROLS ###
REM ### EASY LOCATIONS ###

IF(PLAYER0,TIMER0 >= 2500)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(2,3,6),3,0)
ENDIF

IF(PLAYER0,TIMER0 >= 5000)
IF_ACTION_POINT(2,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(3,6),3,0)
ENDIF
IF_ACTION_POINT(3,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(2,6),3,0)
ENDIF
IF_ACTION_POINT(6,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(2,3),3,0)
ENDIF
ENDIF

IF(PLAYER0,TIMER0 >= 7500)
IF_ACTION_POINT(2,PLAYER3)
IF_ACTION_POINT(3,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,6,3,0)
ENDIF
ENDIF
IF_ACTION_POINT(3,PLAYER3)
IF_ACTION_POINT(6,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,2,3,0)
ENDIF
ENDIF
IF_ACTION_POINT(6,PLAYER3)
IF_ACTION_POINT(2,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,3,3,0)
ENDIF
ENDIF
ENDIF


REM ################################################## ####
REM ################################################## ####
REM ### CUSTOM LOCATIONS ###

IF(PLAYER0,TIMER0 >= 10000)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,7,3,0)
ENDIF


REM ################################################## ####
REM ################################################## ####
REM ### MEDIUM LOCATIONS ###

IF(PLAYER0,TIMER0 >= 12500)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(1,5,8),3,0)
ENDIF

IF(PLAYER0,TIMER0 >= 15000)
IF_ACTION_POINT(1,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(5,8),3,0)
ENDIF
IF_ACTION_POINT(5,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(1,8),3,0)
ENDIF
IF_ACTION_POINT(8,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,DRAWFROM(1,5),3,0)
ENDIF
ENDIF

IF(PLAYER0,TIMER0 >= 17500)
IF_ACTION_POINT(1,PLAYER3)
IF_ACTION_POINT(5,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,8,3,0)
ENDIF
ENDIF
IF_ACTION_POINT(1,PLAYER3)
IF_ACTION_POINT(8,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,5,3,0)
ENDIF
ENDIF
IF_ACTION_POINT(5,PLAYER3)
IF_ACTION_POINT(8,PLAYER3)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER3,DIGLETT,PLAYE R0,ACTION_POINT,1,3,0)
ENDIF
ENDIF
ENDIF


REM ################################################## ####
REM ################################################## ####
REM ### KEEP DENTEN ALIVE ###
IF(PLAYER0,KNIGHT == 0)
LOSE_GAME
ENDIF

REM ### THERE CAN BE ONLY ONE ###
SET_CREATURE_MAX_LEVEL(PLAYER0,THIEF,10)

REM ####################################
REM ####################################

REM #### TUNNELLER SPAWN ORDER ####
REM ## BUTCHER/FLY/BEETLE EASY
REM ## GIANT CUSTOM DUE TO PATHING ISSUES
REM ## CULTISTS/SPIDERS/TENTACLES MEDIUM
REM ## BUTCHER/FLY/BEETLE EASY
REM ## UNDEAD HARD
REM ## CULTISTS/SPIDERS/TENTACLES MEDIUM
REM ## BUTCHER/FLY/BEETLE EASY
REM ## DEMON ALTAR HARD
REM ## CULTISTS/SPIDERS/TENTACLES MEDIUM

REM #### ACTION POINTS ####
REM ## 1 = SPIDERS
REM ## 2 = FLIES ##
REM ## 3 = BUTCHER ##
REM ## 4 = UNDEAD
REM ## 5 = TENTACLES
REM ## 6 = BEETLES ##
REM ## 7 = GIANT ##
REM ## 8 = CULTISTS
REM ## 9 = DEMON ALTAR

REM #### TO DO ####
REM ## TUNNELLER SPAWNING
REM ## UNDEAD HARASS SPAWNING - TURN OFF WHEN LAIR DESTROYED OR SURVIVED 10 WAVES
REM ## UNDEAD BASE PROTECTION SPAWNING
REM ## DEMON HARASS SPAWNING - TURN OFF WHEN SCAVENGER ROOM DESTROYED
REM ## BUTCHER


The entire script as is, including all the useless crap. If you draw a blank i'll just harass Mef.

YourMaster
June 6th, 2015, 00:23
I found it,... you have 'PLAYER3' trigger your action points, but you do not have PLAYER3 defined in your script. If you add 'COMPUTER_PLAYER(PLAYER3,0)' it starts working.

Woudo
June 6th, 2015, 09:07
Having a computer player defined without them having a heart marks them as defeated at level start and kills any creatures they have on the map. Conversely, not defining a computer player has the monsters walk around aimlessly until they eventually die of starvation. The only way to simulate a dungeon (where creatures still eat/sleep/work/collect wages) without the keeper doing anything is to set AI 8.

I've experimented with this problem before and I may be able to fix it.

EDIT: I forgot to actually mention the problem. The dwarves immediately die as soon as they spawn although for some reason the tunneler doesn't.

EDIT: Alright, map is shaping up. Need to go through some finishing touches and all the super fun happy time balancing bullshit.
Have a problem when it comes to hiding yellows dungeon heart but it's only minor, as long as nobody looks at that section of impenetrable rock on the mini-map they'll be none the wiser.
Also some other stuff i'll need to work around.

Even though the script states DRAWFROM is decided at level start, the parties still seem to tunnel to every location. The script said a party would go to AP7 three times and never to AP1 or AP6, but the parties went to all three and never went to AP7 more than once.

YourMaster
June 7th, 2015, 10:06
So,... problems all solved? If the original problem is still there, you can reconsider having the conditions based on action points triggered by player 3. You could think of something else, like gold mined or perhaps creatures available (e.g. when specific heroes are destroyed) or whatever.

As for the tunneling,... try it without the drawfrom command and just pre-define it. I expect to see the same behavior.

YourMaster
June 27th, 2015, 19:32
I also need the correct number representing Hold Audience for the Tutorial_Flash_Button command.

It is number 34.

Woudo
July 26th, 2015, 14:26
Oi Loob, can you rename spells?

YourMaster
July 26th, 2015, 18:18
You can mod your own game and change the spell name(gtext_eng.dat), but you cannot change it on a per-campaign basis.

Woudo
September 12th, 2015, 04:29
How the fuck can I turn imprisoning off for an AI?
I have an AI with a prison that is supposed to be purely aesthetic, but I can't get him to turn imprisoning off. He has no imps so the heroes just clog up the hallways and never actually die.



IF(PLAYER0,DUNGEON_DESTROYED == 0)
SET_CREATURE_TENDENCIES(PLAYER1,IMPRISON,0)
SET_CREATURE_TENDENCIES(PLAYER2,IMPRISON,0)
ENDIF

Not even the above makes him turn the shit off.

And can you check if your possession is working, Loob. For some reason my M1 is reactivating mouselook so I just spin around in drunken circles while trying to claim a straight line.

YourMaster
September 12th, 2015, 08:52
Well, simple, don't use the nightly builds. In the full release of 0.4.6 and before imprisonment is always off by default and will only turn on by setting it in the script. In r1808 P_Hansson implemented prison management and Keepers will now not only imprison creatures, but also heal and torture them when they don't turn into skeletons. He has not gotten around to finishing the code though, and now in the nightlies there's no way for the mapmaker to control imprisonment.

And I just looked, yes, in r1903 I have the same problems (https://github.com/dkfans/keeperfx/issues/663) as you have in possession. So use the full version or r1896.

Woudo
September 12th, 2015, 13:15
I am a patient manchild. I'll sit on this level for now and make finalized balance changes later.

Woudo
October 3rd, 2015, 19:14
How much damage do boulders do to doors? I thought one boulder would knock down a wooden door but apparently not.

YourMaster
October 3rd, 2015, 22:49
240 damage. Two boulders for a wooden door, 4 for a braced door. It could be more if the boulder is already damaged.

Magic.cfg

[shot15]
Name = SHOT_BOULDER
Health = 240
Damage = 5000

Trapdoor.cfg

[door1]
Name = WOOD
Health = 400

[door2]
Name = BRACED
Health = 750

Woudo
October 17th, 2015, 12:18
With Adikted, Ctrl-M when you're in slab mode and pick an "unknown slab".
- Every single unknown slab except 50 will appear as empty unclaimed dirt path but turn into reinforced neutral wall when a nearby tile is modified.
- Slab 50 doesn't turn into anything. It remains as unclaimed dirt and imps will ignore it.
- Each "unknown slab" shows parts of a room (training/temple/library) at its edges.
- You can't drop an imp on any unknown slab even though it shows as unclaimed dirt path.
- When you hover over slab 50 with an imp in your hand, it shows a full red box whereas if you hover over any other unknown slab with an imp, it shows half a box. Slab 50 clearly isn't a full slab but rather a surface slab like water/lava.

Who gives a shit?

Slab 50 can be used to provide an open field of traverse between two keepers, but not result in direct territorial dispute. Normally this is handled by water and (to a lesser extent) lava but they both share the distinct disadvantage of blocking the player from freely building guardpost and temple (unless you pray the player doesn't or won't use the well-known exploit.)
Examples:
- Strong Keeper right next to a player -> Creator wants player to be harassed but not killed too early -> Creator wants AI to have bridge for other reasons // Creator wants player to attack AI from a certain direction // Creator wants guard posts to be used for GUARDING and not as a makeshift beaver dam.
- Opening attack paths for heroes whilst restricting trap placement (like dumping a boulder directly on a hero gate).
- Displaying a neutral area to a player (hey, there's some neutral beetles trapped in this cave up here, this is your quest) while blocking the player from just claiming through imp-dropping.

Other slabs can be... used as an invisible maze I guess? Pop-up walls?
- Long path that heroes travel down. -> Player has to claim dirt up until they reach the hero spawn. -> Slabs "materialize". -> Heroes can't reach player. -> (Heroes get redirected towards an AI player?).
- Possession level -> Player walks into wide open room with several doors around -> They try to move to door and get blocked. -> Eat shit buddy, it's an invisible maze. Have fun.

YourMaster
October 17th, 2015, 15:11
Very cool find. Best of all you can combine this with column mode to make the slabs look like anything else. Column mode is normally pretty useless because when you claim it it changes.

But now you can make slab50 look like whatever you want, and it stays like that forever. My suggestion is to make unclaimable path always look like 'ground level rock', that clearly looks like unclaimable ground. Or on some maps have water and 'fake lava', where bridges can only cross water, not lava.

Woudo
February 3rd, 2016, 06:03
Mark, I need some clarity on creatures destroying room tiles. Some creatures seem to start tearing the place up a lot faster than others do.

I know they'll destroy tiles if there are no enemies nearby and you have CTA cast on an enemy tile, but is there a way to manually destroy tiles in possession mode or to have followers destroy rooms when you're leading a barracks party?

YourMaster
February 3rd, 2016, 09:17
No.

Woudo
April 9th, 2016, 18:15
What's the quick way of painting long stretches in column mode. I know for certain it exists, but my brain is on smoko and I just can't remember.

YourMaster
April 9th, 2016, 22:44
From the adikted manual:




3.4 Marking

If you created any large rooms, you may have found it fairly timeconsuming. There must be a quicker way... it's a pretty big map, after all! Well, of course, having said that, there's bound to be. It's called marking, and you do it like this:

Find a spare bit of earth where you might want to create a big room... a large lair maybe.
Press ctrl+space. On the dividing line, it should tell you that you're now marking, and on the message line it will say, "Mark mode on".
Move around a bit... a white rectangle should appear between the cursor and where you first pressed ctrl+space.
Mark out a nice big area... you want your creatures to have lots of room, don't you?
Press L, and the white rectangle should be replaced by a lots of lair tiles.

If you've put the new lair over earth, it will be unowned... you need to set the ownership on the whole lot. Again, you can use mark mode.

Press ctrl+space to enter Mark mode.
Move around so the rectangle covers the whole lair, and press 0. Surprise surprise, the lair should now be white on a red background.


Edit: Sorry, column mode,.... I don't know, I use the brutally slow method.

Woudo
April 10th, 2016, 03:37
Paint, Mark and copy-paste don't work in Column mode. I swear I found a way a month or two back but now i've lost it completely. Oh well.

0etelaer
April 26th, 2016, 09:37
So i've configured the creatures; Thankyou. Haven't tested it yet but i'll get to that.

Butt-problem.
How do I go about making a spell do more damage? I only want it to be stronger for one creature, not for every creature using that spell.
I'm seeing a lot of different stuff in these .cfg files but the only one that seems relevant is;


; Percentage of creature damage increase for every experience level
SpellDamageIncreaseOnExp = 8


Spells don't scale with strength right, that's just basic attacks?

Lightning strike is by far the strongest spell.
That is why Dark Mistress, above lvl 6, is the strongest creature in the game.
Samurai's and Skeletons also have lightning, but they will attack the opponent with their swords after using the spell only once, making them loose fights.
Elves on lava can defeat a dragon, although they are very weak, but will keep distance, while the dragon is not fast enough to approach.

So what you want to achieve, is was already implemented.
Lightning Strike kills imps in one strike, it moves faster than all those projectiles.
The fastest way to take down Avatar Knight, is having some lightning strike creatures hitting him, while dragons or otherwise keep him put.
Lightning strike can also not be bounced, it killed wizards with ease.

0etelaer
April 26th, 2016, 10:09
Brainfart - Do multiple portals spawn creatures faster than having just one?

Creatures only get spawned faster, when a Vampire is in the Scavenger room.