PDA

View Full Version : Creatures won't spawn from portal



Waltz
October 1st, 2016, 23:25
Hello, I'm relatively new to map making and although the majority of my level seems to be in proper in shape and working, i have problems getting creatures to spawn from my portal at all? I'll post my script maybe I have a small problem but I don't see anything. Thanks for replies and help!

REM ********************************************
REM
REM Script for Level 200
REM
REM ********************************************

SET_GENERATE_SPEED(500)

START_MONEY(PLAYER0,10000)

MAX_CREATURES(PLAYER0,20)

REM Creature pool
ADD_CREATURE_TO_POOL(SORCEROR,5)
ADD_CREATURE_TO_POOL(DRAGON,5)
ADD_CREATURE_TO_POOL(DEMONSPAWN,15)
ADD_CREATURE_TO_POOL(BUG,15)
ADD_CREATURE_TO_POOL(SPIDER,5)
ADD_CREATURE_TO_POOL(TROLL,5)
ADD_CREATURE_TO_POOL(ORC,5)

REM Creature availability
CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,DRAGON,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,BUG,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,ORC,1,0)

REM Room availability
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)
ROOM_AVAILABLE(PLAYER0,GUARD_POST,1,0)
ROOM_AVAILABLE(PLAYER0,TORTURE,1,0)
ROOM_AVAILABLE(PLAYER0,TEMPLE,1,0)
ROOM_AVAILABLE(PLAYER0,GRAVEYARD,1,0)
ROOM_AVAILABLE(PLAYER0,BRIDGE,1,0)

REM Spells availability
MAGIC_AVAILABLE(PLAYER0,POWER_HAND,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_LIGHTNING,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CONCEAL,1,0)

REM Doors and traps availability
TRAP_AVAILABLE(ALL_PLAYERS,ALARM,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,BOULDER,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,1,0)

CREATE_PARTY(LANDLORD)
ADD_TO_PARTY(LANDLORD,KNIGHT,7,3000,ATTACK_ENEMIES ,0)
ADD_TO_PARTY(LANDLORD,MONK,6,1000,ATTACK_ENEMIES,0 )
ADD_TO_PARTY(LANDLORD,MONK,6,1000,ATTACK_ENEMIES,0 )
ADD_TO_PARTY(LANDLORD,MONK,6,1000,ATTACK_ENEMIES,0 )
ADD_TO_PARTY(LANDLORD,MONK,6,1000,ATTACK_ENEMIES,0 )

REM ************************************************** **************************

REM "The heros of this realm sing of happiness and goodly cheer. It'd be a shame if their day was ruined..."
DISPLAY_OBJECTIVE(125,PLAYER0)

IF(PLAYER0,GAME_TURN >= 100)
REM "The heros of this realm are many. Train your forces and properly prepare them to utterly annhilate these doogooders."
DISPLAY_INFORMATION(120,ALL_PLAYERS)
ENDIF

IF_ACTION_POINT(1,PLAYER0)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,LANDLORD,2,1)
ENDIF

YourMaster
October 2nd, 2016, 00:18
I see nothing wrong with the script. Well, apart that in your remarks you misspell 'heroes', but that doesn't matter of course.
Please share your log file and the entire level you made and I'll have a look.



Edit: Wait, yes there is. It's the creature available command. If you want to make a KeeperFX map, you've got to add 'Level_version(1)' to your script. If you want to level to be playable in the original game, change the final 0 to 1 in your creature available command:

CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DRAGON,1,1)

Waltz
October 2nd, 2016, 02:04
Awesome so now creatures are spawning but they are spawning "freely" for lack of a better term.

For example my orcs spawn without a barracks and warlocks with a library etc... etc... what is causing this?

Woudo
October 2nd, 2016, 05:27
I'm going to assume you're using KeeperFX scripting because it's pointless not to.

CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,1)

The first 1 is whether or not the creature can be attracted. 1 for yes, 0 for no.
The second 1 is how many you want to force AKA allow to be attracted without fitting the requirements.

Set the second digit to 0 for all of the lines.

YourMaster
October 2nd, 2016, 08:22
Awesome so now creatures are spawning but they are spawning "freely" for lack of a better term.

For example my orcs spawn without a barracks and warlocks with a library etc... etc... what is causing this?

Seems like you did both changes. Either add Level_version(1) (https://github.com/dkfans/keeperfx/wiki/New-and-Modified-Level-Script-Commands#level_version) OR change the creature_available (https://github.com/dkfans/keeperfx/wiki/New-and-Modified-Level-Script-Commands#creature_available) command. Here (http://keeper.lubiki.pl/dk1_docs/dk_scripting_ref.htm#scrpt_cmd_creature_available) is the OLD creature available command.

In the past the command made no sense, you had two parameters, and you had to set both to 1 for it to do anything. KeeperFX changed that, so that the first parameter allows you to enable/disable creatures coming in, and the second one to state how many creatures will come in bypassing the room requirements.

But as KeeperFX also has to work with old maps, the level_version command allows you to define if you want to use the new commands or the old commands.