Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: Kill all creatures from specific player? Script any?

  
  1. #1
    Demon Spawn UnknownMaster21's Avatar
    Join Date
    Jul 2010
    Location
    Finland
    Posts
    184

    Default Kill all creatures from specific player? Script any?

    I have heard about this command is able to make it out, but how?

    As I have started to actually enhance some of levels to be more interesting, I was looking for this.

    Able to make it out? If yes, how. Could not find it any, or I am totally blind.

    Thanks!

  2. #2

    Default Re: Kill all creatures from specific player? Script any?

    The script command is listed here: https://code.google.com/p/keeperfx/w...ScriptCommands

    So, this should be it:
    Code:
    KILL_CREATURE(​PLAYER1,ALL_CREATURES,​MOST_EXPERIENCED,255)
    Provided "ALL_CREATURES" works for this command, if not, use one row for each creature type, like this:

    Code:
    KILL_CREATURE(​PLAYER1,HELL_HOUND,​MOST_EXPERIENCED,255)
    KILL_CREATURE(​PLAYER1,VAMPIRE,​MOST_EXPERIENCED,255)
    .......
    Last edited by YourMaster; January 30th, 2015 at 12:30.

  3. #3
    Demon Spawn UnknownMaster21's Avatar
    Join Date
    Jul 2010
    Location
    Finland
    Posts
    184

    Default Re: Kill all creatures from specific player? Script any?

    Ahh, forgot that one wtach, but anyway. Thanks for the help.

    I have to say my interest is maximum at the moment.

  4. #4
    Demon Spawn UnknownMaster21's Avatar
    Join Date
    Jul 2010
    Location
    Finland
    Posts
    184

    Default Re: Kill all creatures from specific player? Script any?

    Does this work?
    Code:
    KILL_CREATURE(​ALL_PLAYERS,ALL_CREATURES,​MOST_EXPERIENCED,255)


    EDIT: BLAHFF... Double post, (sorry)


    EDIT: As my purpose is to make total creatures in area not to exceed more than 200. Otherwise that I want to make it happen!
    EDIT2: Or I can actually make it to happen in other way, but that would be lot easier
    Last edited by UnknownMaster21; January 30th, 2015 at 13:41.

  5. #5

    Default Re: Kill all creatures from specific player? Script any?

    Ok, I said 'All_creatures' but this is not a valid script command, I was thinking of 'Total_creatures'.
    Anyway, I've tested it and 'ALL_PLAYERS' works with the KILL_CREATURES command, 'TOTAL_CREATURES' does not.

    Also, there seems to be a bug that it only kills one creature max, I'll report that, but there is a workaround in 'NEXT_COMMAND_REUSABLE'. The problem you will run into is that you cannot count how many creatures all players together have. The command 'IF(ALL_PLAYERS,TOTAL_CREATURES >= 200)' does not mean all players together have 200 creatures, but every player has at least 200 creatures.

    What you could do is this:
    Code:
    IF(PLAYER0,TOTAL_CREATURES >= 50)
    	NEXT_COMMAND_REUSABLE
    	KILL_CREATURE(PLAYER0,SKELETON,LEAST_EXPERIENCED,1)
    	IF(PLAYER0,TOTAL_CREATURES >= 51)
    		NEXT_COMMAND_REUSABLE
    		KILL_CREATURE(PLAYER0,VAMPIRE,LEAST_EXPERIENCED,1)
    	ENDIF
    ENDIF
    This will kill of the weakest skeleton of the player whenever he gets a 50th creature, and if he runs out of skeletons whenever he gets a 51th creature he will lose his weakest vampire. This only works out well if you don't give the player a torture chamber to convert heroes of course, otherwise you can still convert 100 heroes if you want.

    -----------------------------------------------------------------
    Edit: Since version 0.4.5.1589 that bug is fixed and it is now possible to kill multiple creatures with one command.
    Last edited by YourMaster; February 1st, 2015 at 10:06.

  6. #6
    Demon Spawn UnknownMaster21's Avatar
    Join Date
    Jul 2010
    Location
    Finland
    Posts
    184

    Default Re: Kill all creatures from specific player? Script any?

    By the way:

    Code:
    IF(PLAYER0,IMP == 14)
    NEXT_COMMAND_REUSABLE
    KILL_CREATURE(PLAYER0,IMP,NEAR_OWN_HEART,14)
    ENDIF
    This does not work at all, no matter id used Imp, Imps, or Total_Diggers.

    We have talked about this before. What I am doing wrong ( again, if again) ?

    EDIT: Using 0.4.5.1604

  7. #7

    Default Re: Kill all creatures from specific player? Script any?

    Which bit isn't working,.... you can't kill imps or you can't kill creatures 'near heart'?

    The near_own_heart is really restrictive, the creature must be really really close to the heart the moment it is triggered. Try 'Least_experienced' instead.

  8. #8
    Demon Spawn UnknownMaster21's Avatar
    Join Date
    Jul 2010
    Location
    Finland
    Posts
    184

    Default Re: Kill all creatures from specific player? Script any?

    Does not work at all. Did I understood right, you can't kill Imps at all with Kill Creature command?


    EDIT
    The thing is: You are restricted to have Imps not more than 13, if you try to create new one, all imps will die!
    Log says no error, and nothing happens.


    EDIT: Found a reason:

    One IF- script was missing ENDIF statement, which was the only error. It affects to the "additional" script commands neutrally. Nothing happens, and nothing in log is created.

    I think I have to be even more careful, to look all the errors in all maps.
    Last edited by UnknownMaster21; February 24th, 2015 at 18:29.

  9. #9

    Default Re: Kill all creatures from specific player? Script any?

    ok, if you got it to work, fine.
    Try to use something that shows scripting errors before running it, that saves you a lot of trouble.

    And both should work, but I wanted to know with which bit you were having trouble.

  10. #10
    Demon Spawn UnknownMaster21's Avatar
    Join Date
    Jul 2010
    Location
    Finland
    Posts
    184

    Default Re: Kill all creatures from specific player? Script any?

    Actually, there is a problem.


    I want to limit Imp as to 13, but when I reach it, I can never create new imps anymore, It stays on zero. What I want is, that it stays on 13, if going over, it kills 1, not all of them.

    If I have 12, I can create one more, but I can't at all

Similar Threads

  1. Campaign specific Rules.cfg / Magic.cfg / etc
    By Zyraen in forum KeeperFX
    Replies: 3
    Last Post: June 7th, 2011, 06:10
  2. Replies: 7
    Last Post: January 3rd, 2011, 12:58
  3. Creatures Not Entering (Not Script Problem)
    By Metal Gear Rex in forum DK1 Mapmaking
    Replies: 3
    Last Post: December 6th, 2009, 00:57

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
  •