Results 1 to 7 of 7

Thread: How to make a hero attacking loop on my map?

  
  1. #1
    Imp
    Join Date
    Sep 2014
    Location
    Germany
    Posts
    7

    Question How to make a hero attacking loop on my map?

    Greetings everyone :-)

    Nice to be here. I just found this forum. I had no idea that it exists. I know DK1 since the 90s, too. I found a way to get the original map editor work with a virtual win95 machine.

    Scripting help needed:
    I made a single player map. It should be an endless fight against hero parties. I'm a real newbie in scripting those things. I can tell you what should happen. I hope you can help me out with the script.

    Download the map
    Look at the script

    The player starts in the center of the map. It contains 4 Hero doors and 4 action points. The hero doors and action points are together. Example: Action point 1 is at the same place as hero door 1. They are placed in the middle of north, south, west, east.

    Please tell me. Are the IF settings for the win correct? I mean the syntax. I want that it needs much time before you win. Kinda good for a loop fight. Or?

    I tell you what the script has to do. How the hero player should work.

    If the player reaches action point 1, has minimum 50 creatures and hero player has 0 creatures then start a timer. Lets say 5 minutes. After those 5 minutes place a party on hero door 1. After all heros are beaten and the creatures of hero player are 0 start a timer for 10 minutes. After those 15 minutes place the same party at the same hero door. And that again every 15 minutes. And this with different parties for each hero door / action point.

    Please write that IF syntax for me. Use Action Point / Hero Door 1 and Party "RPG" from the script. After that i can copy it for the other hero doors.

    I think it takes a lot of time to win on this map but its okay. I want it :-)

    Beside, i use KeeperFX on Win7 64bit and it works fine. Is it stable enough to manage this many creatures? I mean. When i have about 230 creatures and there are 4 or 5 hero parties coming. Can the game crash or will it work?

    Thank you so much for help! I appreciate it.

  2. #2

    Default Re: How to make a hero attacking loop on my map?

    Greetings.

    The original editor works in Win7, you don't need a virtual machine. See this topic. But when it works, it works, so using the VM is fine.

    KeeperFX won't crash with the 230 creatures. However, I'm not sure your level will work, note there is an ingame limit of 255 creatures which includes workers, and you're limited to 48 if-statements in your level script. Easiest would be to make separate loops for the 5, 10 and 15 minutes, but if you want that with different parties and different action points, you'll quickly reach the limit. Also, be aware that like the original, there is the 'thing limit', if there is too much stuff, no new things can be created, which includes creature spells, so if you build too big a dungeon and have too much stuff, you basically can't play on. Even new parties won't spawn.
    In any case, you can take a look at level 18 in the keeperfx campaign, that features a loop where creatures continue to come.

    What you could do, if you make it a KeeperFX map, is to use the If_control command to see how many heroes there are, this helps speed up the level a lot, as the timer will start again as soon as they are imprisoned, instead of when they are skeletons/converted.

    I think your victory condition works, but if I were you, I'd test it with 15 battles won and without the other conditions to make sure it works.

    Edit: Here you go:
    Code:
    LEVEL_VERSION(1)
    REM ********************************************
    REM
    REM             Script for Level 202
    REM
    REM ********************************************
    
    START_MONEY(PLAYER0,5000)
    SET_GENERATE_SPEED(250)
    MAX_CREATURES(PLAYER0,250)
    
    ADD_CREATURE_TO_POOL(HORNY,200)
    ADD_CREATURE_TO_POOL(ORC,200)
    ADD_CREATURE_TO_POOL(TENTACLE,200)
    ADD_CREATURE_TO_POOL(GHOST,200)
    ADD_CREATURE_TO_POOL(HELL_HOUND,200)
    ADD_CREATURE_TO_POOL(SPIDER,200)
    ADD_CREATURE_TO_POOL(VAMPIRE,200)
    ADD_CREATURE_TO_POOL(BUG,200)
    ADD_CREATURE_TO_POOL(BILE_DEMON,200)
    ADD_CREATURE_TO_POOL(SORCEROR,200)
    ADD_CREATURE_TO_POOL(DARK_MISTRESS,200)
    ADD_CREATURE_TO_POOL(FLY,200)
    ADD_CREATURE_TO_POOL(DEMONSPAWN,200)
    ADD_CREATURE_TO_POOL(DRAGON,200)
    ADD_CREATURE_TO_POOL(TROLL,200)
    ADD_CREATURE_TO_POOL(SKELETON,200)
    
    CREATURE_AVAILABLE(PLAYER0,HORNY,1,0)
    CREATURE_AVAILABLE(PLAYER0,ORC,1,0)
    CREATURE_AVAILABLE(PLAYER0,TENTACLE,1,0)
    CREATURE_AVAILABLE(PLAYER0,GHOST,1,0)
    CREATURE_AVAILABLE(PLAYER0,HELL_HOUND,1,0)
    CREATURE_AVAILABLE(PLAYER0,SPIDER,1,0)
    CREATURE_AVAILABLE(PLAYER0,VAMPIRE,1,0)
    CREATURE_AVAILABLE(PLAYER0,BUG,1,0)
    CREATURE_AVAILABLE(PLAYER0,BILE_DEMON,1,0)
    CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,0)
    CREATURE_AVAILABLE(PLAYER0,DARK_MISTRESS,1,0)
    CREATURE_AVAILABLE(PLAYER0,FLY,1,0)
    CREATURE_AVAILABLE(PLAYER0,DEMONSPAWN,1,0)
    CREATURE_AVAILABLE(PLAYER0,DRAGON,1,0)
    CREATURE_AVAILABLE(PLAYER0,TROLL,1,0)
    CREATURE_AVAILABLE(PLAYER0,SKELETON,1,0)
    
    MAGIC_AVAILABLE(PLAYER0,POWER_CHICKEN,1,0)
    MAGIC_AVAILABLE(PLAYER0,POWER_OBEY,1,1)
    MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,1,0)
    MAGIC_AVAILABLE(PLAYER0,POWER_HOLD_AUDIENCE,1,0)
    MAGIC_AVAILABLE(PLAYER0,POWER_PROTECT,1,0)
    MAGIC_AVAILABLE(PLAYER0,POWER_DESTROY_WALLS,1,0)
    MAGIC_AVAILABLE(PLAYER0,POWER_HAND,1,1)
    MAGIC_AVAILABLE(PLAYER0,POWER_SLAP,1,1)
    MAGIC_AVAILABLE(PLAYER0,POWER_CAVE_IN,1,1)
    MAGIC_AVAILABLE(PLAYER0,POWER_LIGHTNING,1,0)
    MAGIC_AVAILABLE(PLAYER0,POWER_CONCEAL,1,0)
    MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)
    MAGIC_AVAILABLE(PLAYER0,POWER_SIGHT,1,1)
    MAGIC_AVAILABLE(PLAYER0,POWER_HEAL_CREATURE,1,0)
    MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,1,0)
    
    ROOM_AVAILABLE(PLAYER0,GRAVEYARD,1,1)
    ROOM_AVAILABLE(PLAYER0,TRAINING,1,1)
    ROOM_AVAILABLE(PLAYER0,BARRACKS,1,1)
    ROOM_AVAILABLE(PLAYER0,TREASURE,1,1)
    ROOM_AVAILABLE(PLAYER0,WORKSHOP,1,1)
    ROOM_AVAILABLE(PLAYER0,GARDEN,1,1)
    ROOM_AVAILABLE(PLAYER0,RESEARCH,1,1)
    ROOM_AVAILABLE(PLAYER0,SCAVENGER,1,1)
    ROOM_AVAILABLE(PLAYER0,LAIR,1,1)
    ROOM_AVAILABLE(PLAYER0,PRISON,1,1)
    ROOM_AVAILABLE(PLAYER0,TEMPLE,1,1)
    ROOM_AVAILABLE(PLAYER0,BRIDGE,1,1)
    ROOM_AVAILABLE(PLAYER0,TORTURE,1,1)
    
    TRAP_AVAILABLE(PLAYER0,ALARM,1,0)
    TRAP_AVAILABLE(PLAYER0,POISON_GAS,1,0)
    TRAP_AVAILABLE(PLAYER0,LIGHTNING,1,0)
    TRAP_AVAILABLE(PLAYER0,BOULDER,1,0)
    TRAP_AVAILABLE(PLAYER0,WORD_OF_POWER,1,0)
    
    DOOR_AVAILABLE(PLAYER0,BRACED,1,0)
    DOOR_AVAILABLE(PLAYER0,STEEL,1,0)
    DOOR_AVAILABLE(PLAYER0,MAGIC,1,0)
    DOOR_AVAILABLE(PLAYER0,WOOD,1,0)
    
    CREATE_PARTY(RPG)
    	ADD_TO_PARTY(RPG,WIZARD,10,900,ATTACK_DUNGEON_HEART,0)
    	ADD_TO_PARTY(RPG,BARBARIAN,10,900,ATTACK_DUNGEON_HEART,0)
    	ADD_TO_PARTY(RPG,KNIGHT,10,900,ATTACK_DUNGEON_HEART,0)
    	ADD_TO_PARTY(RPG,WITCH,10,900,ATTACK_DUNGEON_HEART,0)
    
    CREATE_PARTY(BIG)
    	ADD_TO_PARTY(BIG,AVATAR,10,900,ATTACK_ENEMIES,0)
    	ADD_TO_PARTY(BIG,KNIGHT,10,900,ATTACK_ENEMIES,0)
    	ADD_TO_PARTY(BIG,AVATAR,10,900,ATTACK_DUNGEON_HEART,0)
    	ADD_TO_PARTY(BIG,KNIGHT,10,900,ATTACK_DUNGEON_HEART,0)
    
    CREATE_PARTY(AGGRO)
    	ADD_TO_PARTY(AGGRO,GIANT,10,500,ATTACK_DUNGEON_HEART,0)
    	ADD_TO_PARTY(AGGRO,MONK,10,500,ATTACK_ENEMIES,0)
    	ADD_TO_PARTY(AGGRO,BARBARIAN,10,500,ATTACK_DUNGEON_HEART,0)
    	ADD_TO_PARTY(AGGRO,ARCHER,10,500,ATTACK_ENEMIES,0)
    
    CREATE_PARTY(MAGIC)
    	ADD_TO_PARTY(MAGIC,WIZARD,10,550,ATTACK_ENEMIES,0)
    	ADD_TO_PARTY(MAGIC,FAIRY,10,550,ATTACK_DUNGEON_HEART,0)
    	ADD_TO_PARTY(MAGIC,WITCH,10,550,ATTACK_DUNGEON_HEART,0)
    	ADD_TO_PARTY(MAGIC,SAMURAI,10,550,ATTACK_ENEMIES,0)
    
    CREATE_PARTY(DWARVES)
    	ADD_TO_PARTY(DWARVES,DWARFA,10,650,ATTACK_ENEMIES,0)
    	ADD_TO_PARTY(DWARVES,DWARFA,10,650,ATTACK_DUNGEON_HEART,0)
    	ADD_TO_PARTY(DWARVES,THIEF,10,3000,ATTACK_ENEMIES,0)
    	ADD_TO_PARTY(DWARVES,ARCHER,10,3000,ATTACK_DUNGEON_HEART,0)
    
    
    REM Trigger Timer for continuous spawning of party RPG
    IF_ACTION_POINT(1,PLAYER0)
    	IF_CONTROLS(PLAYER0,TOTAL_CREATURES >= 50)
    		IF_CONTROLS(PLAYER_GOOD,TOTAL_CREATURES <= 0)
    			SET_TIMER(PLAYER0,TIMER1)
    		ENDIF
    	ENDIF
    ENDIF
    
    REM Spawn Party RPG every 5 minutes
    IF(PLAYER0,TIMER1 >= 6000)
    	NEXT_COMMAND_REUSABLE
    	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,RPG,-1,1)
    	QUICK_INFORMATION(1,"Your long wait is over Keeper, the role playing party has arrived",-1)
    	NEXT_COMMAND_REUSABLE
    	SET_TIMER(PLAYER0,TIMER1)
    ENDIF
    
    IF(PLAYER0,TOTAL_CREATURES >= 245)
    	IF(PLAYER0,MONEY >= 95000)
    		IF(PLAYER0,BATTLES_WON >= 1500)
    			IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
    				WIN_GAME
    			ENDIF
    		ENDIF	
    	ENDIF
    ENDIF
    
    REM *****  End of Script  **********************
    Personally I would take the condition of having 0 heroes on the map before the timer resets out. How it is now, you have to wait 5 minutes, but there is nothing to do as you have no rival creatures. You could simply go out for a walk or something until the 5 minutes are up.
    Last edited by YourMaster; September 27th, 2014 at 20:28.

  3. #3
    Imp
    Join Date
    Sep 2014
    Location
    Germany
    Posts
    7

    Default Re: How to make a hero attacking loop on my map?

    Thank you very much!

    I used this and it works brilliant! Ive overwritten the map download and script from the start posting. Look at it. I played and the win syntax worked.

    One question. What exactly is a won battle? Does that mean if you kill a party or amount of killed creatures?

  4. #4

    Default Re: How to make a hero attacking loop on my map?

    The script you have right now shouldn't work,....you'll probably trigger the timer even if you don't have enough creatures or if there are still heroes. You've taken out the 'Level_version(1)' which enables KeeperFX commands, but kept the 'IF_CONTROLS' which is a KeeperFX command,... If you don't want to make it KeeperFX only, simply use an IF command instead.

    You've also reintroduced some of the other mistakes I've taken out, like the misspelling of HELL_HOUND.

    I don't know what counts as a battle won.
    Last edited by YourMaster; September 28th, 2014 at 17:51.

  5. #5
    Imp
    Join Date
    Sep 2014
    Location
    Germany
    Posts
    7

    Default Re: How to make a hero attacking loop on my map?

    Oh tanks for the info! I corrected it. Sorry

  6. #6

    Default Re: How to make a hero attacking loop on my map?

    Now you've reintroduced the Level_version(1), but you've kept the non-FX Creature_available command. This way you'll receive creatures even if you don't have the rooms for it. See the script I posted, or look here for the description.

  7. #7
    Imp
    Join Date
    Sep 2014
    Location
    Germany
    Posts
    7

    Default Re: How to make a hero attacking loop on my map?

    I understand. I played it yesterday and in that map im building every room. So its not important.

    Beside, i think won battles means how many creatures you killed. Not parties.

Similar Threads

  1. How do I create a hero party from a hero gate?
    By darkkingkongman in forum DK1 Mapmaking
    Replies: 3
    Last Post: March 29th, 2014, 14:58
  2. How do you make a Campaign?
    By Bj007pro in forum Dungeon Keeper 2
    Replies: 19
    Last Post: February 20th, 2014, 18:27
  3. loop problems
    By veroba in forum KeeperFX
    Replies: 6
    Last Post: July 19th, 2013, 06:42
  4. How to make map thumbnails?
    By Beeb in forum DK2 Mapmaking
    Replies: 4
    Last Post: March 9th, 2013, 14:35
  5. Replies: 8
    Last Post: February 19th, 2013, 21:06

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •