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

Thread: any ideas?

  
  1. #1
    Imp
    Join Date
    Jan 2014
    Location
    Netherlands
    Posts
    43

    Post any ideas?

    in the first level of my campaign, when the player wins 3 battles it gets the power_destroy_walls available.
    the spell is used to get into a new area of the map where some hero's have to be battled. After the player wins 4 battles
    the power_destroy_walls is no longer available.

    The problem is that the player can also continue from the point where it gets the spell.
    If breaking down the door and continue along the path, some hero's are encountered.

    your creatures do not have ranged attacks but when in posses mode the 1 tile lava can be crossed to fight the hero's.
    using the heal spell, or just by winning one battle there, the win_game condition can no longer be reached.
    Because the win condition is player_good total creatures = 0.

    So how can i "force" the player to use the power_destroy_walls.
    or maybe better a lose condition where as if the player has not used the power_destroy_walls and won its 4th battle
    it loses.

  2. #2

    Default Re: any ideas?

    How about not removing the destroy_walls spell when you kill the 4th creature but when you reach an action point?

    Alternatively, if there are different hero types behind the wall than behind the lava you can count the heroes left. So for example remove the destroy_wall spell when player_good only has 3 archers left.

  3. #3

    Default Re: any ideas?

    I'd like you to bear in mind that a "battle" is actually a kill. Four battles won actually means four enemies killed. The same applies for battles lost; you can add one battle lost to your count by just slapping an imp until it dies.

    Secondly, there are a number of ways you can do this but more information would be nice;
    - Remove possession.
    - Put a guardpost/temple on the opposite side of the lava tile. Remove flying creatures.
    - Replace the lava tile with a wall. Give the player a reveal map special, use the REVEAL_MAP_RECT or REVEAL_MAP_LOCATION functions, or give the player Sight of Evil so they know where to dig.

  4. #4
    Imp
    Join Date
    Jan 2014
    Location
    Netherlands
    Posts
    43

    Default Re: any ideas?

    The first idea was to use the times_broken_into variable, but that one didn't work.
    the idea behind losing it after the 4th win is that you use it and lose it.

    The only creatures you find on this map with player_good are thieves, dwarfs and dragons.
    the only creatures you have are just 3 monks.

    action points sometimes aren't triggered by imps, or other creatures, when passing the action point.

    you can kill your imp, but when losing >2 times is a lose_game

    just checked it, and there are 2 tiles of lava between you and some dwarfs and thieves.
    the wall that has to be destroyed is the one north of the heart, there is a dirt path leading towards the wall.
    Click image for larger version. 

Name:	dkmap.png 
Views:	18 
Size:	459.9 KB 
ID:	1595

    added this to the script will this work or not?

    Code:
    IF_ACTION_POINT(1,PLAYER0)
    	IF(PLAYER0,BATTLES_WON >= 10)
    MAGIC_AVAILABLE(PLAYER0,POWER_DESTROY_WALLS,0,0)
    ENDIF
    ENDIF
    
    IF_ACTION_POINT(1,PLAYER0)
    	IF(PLAYER0,BATTLES_WON <10)
    LOSE_GAME
    ENDIF
    ENDIF
    edit: this code works
    Last edited by Edwin; April 16th, 2015 at 13:22.

  5. #5

    Default Re: any ideas?

    A recent change has been made that makes sure action points are easier to trigger.
    But for now sometimes they fails because the game checks every few game turns if a creature is inside the action point, and if it passed it before the check it is not detected. The solution is to make the action point a lot bigger or delay the creature in the action point by having him break down a door or something. This way you can get the action point to work 100%.

    Woudo's suggestions would work as well, simply make the player unable to go west before he gets the bridge, for example by placing the guard post next to lava and only giving the player a bridge when he has to go west.

  6. #6
    Imp
    Join Date
    Jan 2014
    Location
    Netherlands
    Posts
    43

    Default Re: any ideas?

    I placed the action point on a player_good tile, and when the imp claims it, it triggers the action point.
    Now I'm trying to create a loop that for each battle I win I get a 500 gold to a max of 5000, and when it drops below 500 it starts again.
    And for each battle lost I lose 1000 gold.
    This way I can't use the destroy_walls more than once before triggering the action point.
    The idea is that after the first three battles are won the money drops to 0, and then using the add_gold_to_player command to get 10000 for using the destroy_walls.

  7. #7

    Default Re: any ideas?

    If you have a very limited amount of creatures you could make it work, but you'd need to write down every possibility in a separate if-statement. This causes you to get to the If-limit quite quickly.

    There is a 'money' variable to detect how much money a player has, that's not the problem. Creating a loop to give 500 gold every x game turns also isn't a problem, but there is no way to use the script to indicate 'one won_battle more than last time'.

    Is this the code you are looking for?
    Code:
    IF(PLAYER0,MONEY <= 4500)
    	IF(PLAYER0,BATTLES_WON >= 1)
    		ADD_GOLD_TO_PLAYER(PLAYER0,500)
    	ENDIF
    
    	IF(PLAYER0,BATTLES_WON >= 2)
    		ADD_GOLD_TO_PLAYER(PLAYER0,500)
    	ENDIF
    
    	REM(Repeat this for 3 ~ total enemy creatures on map)
    ENDIF
    Code:
    REM When player wins 3 battles he ends up with 10000 gold.
    IF(PLAYER0,BATTLES_WON >= 3)
    	ADD_GOLD_TO_PLAYER(PLAYER0,-9999999)
    	SET_TIMER(PLAYER0,TIMER7)
    ENDIF
    IF(PLAYER0,TIMER7 >= 100)
    	ADD_GOLD_TO_PLAYER(PLAYER0,10000)
    ENDIF

  8. #8
    Imp
    Join Date
    Jan 2014
    Location
    Netherlands
    Posts
    43

    Default Re: any ideas?

    the code where you get the money for a battle_won worked, but to use it for every battle on the map it seems to much work.
    the code that gives the player -999999 gold didn't took all the gold away, it did add the 10000 gold.

    so for those I now used a timer0 that when it reaches 500 it adds -500 gold.
    and timer1 when it reaches 2000 it adds 1000 gold.

    I removed the gems in the treasure room, and added some gold to the map, I replaced the gem with a treasure room tile belonging to player_good.
    when the imp claims he tile it shows 2 treasure rooms.
    Click image for larger version. 

Name:	scr00000.png 
Views:	13 
Size:	95.9 KB 
ID:	1596

    I'm using Dungeon Keeper FX ver 0.4.5.1644

  9. #9

    Default Re: any ideas?

    Quote Originally Posted by Edwin View Post
    the code where you get the money for a battle_won worked, but to use it for every battle on the map it seems to much work.
    the code that gives the player -999999 gold didn't took all the gold away, it did add the 10000 gold.

    so for those I now used a timer0 that when it reaches 500 it adds -500 gold.
    and timer1 when it reaches 2000 it adds 1000 gold.

    I removed the gems in the treasure room, and added some gold to the map, I replaced the gem with a treasure room tile belonging to player_good.
    when the imp claims he tile it shows 2 treasure rooms.
    Click image for larger version. 

Name:	scr00000.png 
Views:	13 
Size:	95.9 KB 
ID:	1596

    I'm using Dungeon Keeper FX ver 0.4.5.1644

    The code should work.

    I just used this in a script:
    Code:
    REM When player wins 3 battles he ends up with 10000 gold.
    IF(PLAYER0,TREASURE >= 3)
    	ADD_GOLD_TO_PLAYER(PLAYER0,-9999999)
    	SET_TIMER(PLAYER0,TIMER7)
    ENDIF
    IF(PLAYER0,TIMER7 >= 100)
    	ADD_GOLD_TO_PLAYER(PLAYER0,10000)
    ENDIF
    When I built 3 tiles of treasure room, the 250000 starting gold I had disappeared and was replaced with 10000 gold.


    And yes, it is a bit much work to do so for every battle, especially because there is a limit on the total amount of if statements you can have. So if there are too many battles, you have to come up with an alternative.

  10. #10
    Imp
    Join Date
    Jan 2014
    Location
    Netherlands
    Posts
    43

    Default Re: any ideas?

    I'm trying to use some of the new level script commands.
    with either a beetle or giant as a creature with a level between 1 and 3
    and a single monk with level between 1 and 3
    Code:
    ADD_CREATURE_TO_LEVEL(PLAYER0,DRAWFROM(BUG,GIANT),DRAWFROM(PLAYER0,1,1~3,0)
    ADD_CREATURE_TO_LEVEL(PLAYER0,MONK),DRAWFROM(PLAYER0,1,1~3,0)
    got the creatures to appear, but the level range is not working
    Last edited by Edwin; April 25th, 2015 at 14: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
  •