Page 2 of 4 FirstFirst 1 2 3 4 LastLast
Results 11 to 20 of 34

Thread: Matter of Time - Single-Player and Multi-Player Map (First Map)

  
  1. #11

    Default Re: Matter of Time - Single-Player and Multi-Player Map (First Map)

    Quote Originally Posted by YourMaster View Post
    The thing is, each script command will fire only once. Unless you put a 'NEXT_COMMAND_REUSABLE' in front.
    Almost got it working now. There were no problems when I tested the script below in 20 minute gameplay sessions (except for the expected script delay), but when I played a whole match just now, after completing the level, my Create Imp spell didn't get disabled when I went above 40 imps, and my Quick Info message didn't get displayed either this time. Going below the limit and back above did not help. The only differences from my initial testing is that this happened after I had stolen the enemy library with another Create Imp spellbook while having 15+ imps. I also went below the 15 imps mark after having reached it at one point. I don't know how that could bug the script, can you spot it?

    Code:
    IF(PLAYER0,​TOTAL_DIGGERS >= 15)
    	IF(​PLAYER0,​TOTAL_DIGGERS <= 39)
    		NEXT_COMMAND_REUSABLE
    		MAGIC_AVAILABLE(PLAYER0,POWER_IMP,		1,			1)
    	ENDIF
    ENDIF
    
    IF(PLAYER1,​TOTAL_DIGGERS >= 15)
    	IF(​PLAYER1,​TOTAL_DIGGERS <= 39)
    		NEXT_COMMAND_REUSABLE
    		MAGIC_AVAILABLE(PLAYER1,POWER_IMP,		1,			1)
    	ENDIF
    ENDIF
    
    IF(​PLAYER0,​TOTAL_DIGGERS >= 40)
    	NEXT_COMMAND_REUSABLE
    	MAGIC_AVAILABLE(PLAYER0,	POWER_IMP,		0,			0)
    	QUICK_INFORMATION(​1,​"A Keeper has reached the maximum number of imps allowed on this map. Do not attempt to glitch above the limit of 40.", ALL_PLAYERS)
    ENDIF
    
    IF(​PLAYER1,​TOTAL_DIGGERS >= 40)
    	NEXT_COMMAND_REUSABLE
    	MAGIC_AVAILABLE(PLAYER1,	POWER_IMP,		0,			0)
    	QUICK_INFORMATION(​2,​"A Keeper has reached the maximum number of imps allowed on this map. Do not attempt to glitch above the limit of 40.", ALL_PLAYERS)
    ENDIF
    Last edited by Argonil; July 6th, 2020 at 01:36.

  2. #12

    Default Re: Matter of Time - Single-Player and Multi-Player Map (First Map)

    When you complete a level, scripts stop working. Unless you use the new script command that says scripts should continue after victory:
    https://github.com/Loobinex/keeperfx..._after_victory

  3. #13

    Default Re: Matter of Time - Single-Player and Multi-Player Map (First Map)

    Quote Originally Posted by YourMaster View Post
    When you complete a level, scripts stop working. Unless you use the new script command that says scripts should continue after victory:
    https://github.com/Loobinex/keeperfx..._after_victory
    Ah, thank you! That's great actually. One more thing, I got the idea of placing a secret level 1 Avatar in an inaccessible torture chamber, giving you a chance to steal him if you get to a Steal Hero special before he becomes a ghost. But unfortunately, the Steal Hero special doesn't work on Avatars or Knights. I tried modifying the Avatar's file and removed the "LORD" keyword, I also tried setting his scavenging value to 1, even tried changing his name, but the Steal Hero special still won't work on him. So I guess I'd need to edit the Special itself, but I can't find it anywhere, can't even find which data archive the dungeon specials are supposedly packaged into. Can you find them or tell me how to make the Steal Hero special work on the Avatar?
    Last edited by Argonil; July 8th, 2020 at 00:23.

  4. #14

    Default Re: Matter of Time - Single-Player and Multi-Player Map (First Map)

    You can't make the special work on the avatar without changing the source code of the game. That's all hard coded.

    You should think of a way to accomplish this without using the special. You could somehow give the player access to the torture room to get the avatar, or there's script commands to change ownership of either the room or the unit. You can force the avatar through your portal, based on if the player has gotten towards some place and/or if the white avatar is still alive. These are just some examples, the new script commands are quite powerful, you should be able to think of some solution that works for whatever you want to accomplish.

  5. #15

    Default Re: Matter of Time - Single-Player and Multi-Player Map (First Map)

    Quote Originally Posted by YourMaster View Post
    You can't make the special work on the avatar without changing the source code of the game. That's all hard coded.

    You should think of a way to accomplish this without using the special. You could somehow give the player access to the torture room to get the avatar, or there's script commands to change ownership of either the room or the unit. You can force the avatar through your portal, based on if the player has gotten towards some place and/or if the white avatar is still alive. These are just some examples, the new script commands are quite powerful, you should be able to think of some solution that works for whatever you want to accomplish.
    Unfortunately the Steal Hero special was perfect for this, as I want it to be based on luck. The commands can't set the "grow up" property on creatures right? Because otherwise I'm thinking I could put a Fly in the torture chamber and make it grow up into an Avatar, since flies otherwise aren't obtainable on the map. Would also make it extra secret! If that property can't be set directly, is there a way to manually script it? Replacing a fly that hits level 10 with a level 1 Avatar in the same spot?
    Last edited by Argonil; July 8th, 2020 at 02:17.

  6. #16

    Default Re: Matter of Time - Single-Player and Multi-Player Map (First Map)

    Woo, I found a solution and it's better than I hoped! He announces his presence like a Lord of the Land this way. But there's just one problem: PLAYER_NEUTRAL doesn't work for me. This is the script I was trying to use:

    ADD_CREATURE_TO_LEVEL(PLAYER_NEUTRAL,​AVATAR,​ PLAYER0,​1,​1,2000)

    I want it to be neutral even though it spawns on the player's dungeon heart, because if you convert a neutral then it gives you the notification that says you got a new type of creature. Here's my log:

    Error: script_command_param_to_number(line 129): Invalid player name, 'PLAYER_NEUTRAL'
    Error: script_recognize_params(line 129): Parameter 1 of command "ADD_CREATURE_TO_LEVEL", type P, has unexpected value; discarding command

    My log also says I'm using KeeperFX 0.4.7u.


    Edit: It seems it's all the new commands from the Unofficial version that don't work for me. SET_GAME_RULE(GhostConvertChance,0) doesn't work either, it doesn't recognize the command. I don't have to put LEVEL_VERSION(2) for those commands, right? The reference page only mentions level version 1. I overwrote my KeeperFX version with the Unofficial version, and the log says I'm using the unofficial version, so it should work...
    Last edited by Argonil; July 8th, 2020 at 07:21.

  7. #17

    Default Re: Matter of Time - Single-Player and Multi-Player Map (First Map)

    Well, sorry. Those commands are new for the work-in-progress alpha builds, and will be released with the future 0.4.8 version. They work for you if you update to the latest alpha.

  8. #18

    Default Re: Matter of Time - Single-Player and Multi-Player Map (First Map)

    Quote Originally Posted by YourMaster View Post
    Well, sorry. Those commands are new for the work-in-progress alpha builds, and will be released with the future 0.4.8 version. They work for you if you update to the latest alpha.
    Wow, so if I had tried to make my map just a few months ago, it wouldn't have been possible. But now it's done, I've made a lot of changes and reuploaded it, I'm even a bit impressed by how I could make things work thanks to the improved scripting. I never expected to find all this 'ongoing support' for my favorite game from childhood. Thank you very much!

  9. #19

    Default Re: Matter of Time - Single-Player and Multi-Player Map (First Map)

    You're welcome. I'm happy too that I managed to add some script commands, they allow for a lot more complicated mapmaking.

    Keep in mind you force a lot of units now in your script. For example where you've got:
    Code:
    CREATURE_AVAILABLE(	ALL_PLAYERS,	DARK_MISTRESS,	1,			1)
    I suspect you simply want:
    Code:
    CREATURE_AVAILABLE(	ALL_PLAYERS,	DARK_MISTRESS,	1,			0)
    This way you only get a mistress when you have a torture room, like normal.

  10. #20

    Default Re: Matter of Time - Single-Player and Multi-Player Map (First Map)

    Well, if I don't force 1 of each creature, both players will disproportionately attract the creatures that are available to them in the beginning, and initially you can only attract 4 extra creatures (if you turtle). If I force 1 of each, those 4 extra creatures could be anything. It shouldn't be a rush to construct the torture chamber and barracks for a chance to get an early mistress or orc, only if you want more of them. I want this sandboxy map to have as much variation as possible from match to match. It also reduces the chance that a keeper gets the 1 dragon in the pool as one of his first 4 creatures, so you should consider yourself extremely lucky if you get a dragon early. It'll prove to be a very helpful unit in the beginning, albeit expensive.
    Last edited by Argonil; July 9th, 2020 at 14:56.

Similar Threads

  1. My first single player map: Nostalgia 2016
    By TeoHD Arg in forum DK1 Maps
    Replies: 9
    Last Post: April 23rd, 2016, 01:34
  2. Many AI against one player skirmishes
    By kirbyking in forum Dungeon Keeper 2
    Replies: 2
    Last Post: October 14th, 2014, 18:51
  3. Custom Single Player on Wineskin
    By Chag in forum DK2 Troubleshooting
    Replies: 1
    Last Post: May 6th, 2014, 10:10
  4. Hard - A new player looking for DK2 multi fights!
    By Hard in forum Dungeon Keeper 2
    Replies: 3
    Last Post: November 21st, 2012, 18:45
  5. Dark Angels in Single Player
    By d4rklqrdnem3sys in forum Dungeon Keeper 2
    Replies: 2
    Last Post: November 1st, 2010, 14:31

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
  •