PDA

View Full Version : script questions



Edwin
March 18th, 2015, 11:32
when using this code it works, but when the new imps die, the spell isn't available again.
also when using the next_command_reusable it lets me create multiple imps, instead of the max of 2 imps.
and lets me keep the imp spell

IF(PLAYER0,IMP ==0)
MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)
ENDIF

IF(PLAYER0,IMP ==2)
MAGIC_AVAILABLE(PLAYER0,POWER_IMP,0,0)
ENDIF

I also wanted to use the broken into command
assuming it means breaking down fortified walls with the destroy walls spell.


if(player_good,times_broken_into =1)
magic_available(player0,power_destroy_walls,0,0)
endif

tried >0 didn't work either

mefistotelis
March 18th, 2015, 17:25
You could create more imps because of "==" instead of ">=", not because of reusable comand.
Avoid equality, use ">" or "<", or ">=" or "<=" instead. Equality may lead to the game not noticing the condition (ie. if you will create several imps quickly, the game may check the "== 2" condition when you have already 3 or more imps).

If you're using KeeperFX - start the map in it, and then exit and look at log file - it will have warnings in case of any typos or other errors in script.

YourMaster
March 18th, 2015, 18:03
I also wanted to use the broken into command
assuming it means breaking down fortified walls with the destroy walls spell.


if(player_good,times_broken_into =1)
magic_available(player0,power_destroy_walls,0,0)
endif

tried >0 didn't work either

It means the number of times your dungeon has been breached, so simply whenever a hero or keeper has dug into one of your rooms and you hear the sound-effect. For you it doesn't work because you have '=' instead of '=='. Just to be sure it actually works, also use '>=' for this bit.

Edwin
March 20th, 2015, 10:35
the imps now work.
can't seem to destroy a player_good wall, and lose the destroy_walls spell.

when using this i get the icon with the information, but i don't get the new creature and new room available icons

IF(PLAYER0,MONK >0)
ROOM_AVAILABLE(PLAYER0,garden,1,1)
QUICK_INFORMATION(1,"Build a garden which is now available to you, to feed your creature.",PLAYER0)
ENDIF

YourMaster
March 20th, 2015, 17:14
the imps now work.
can't seem to destroy a player_good wall, and lose the destroy_walls spell.

when using this i get the icon with the information, but i don't get the new creature and new room available icons

IF(PLAYER0,MONK >0)
ROOM_AVAILABLE(PLAYER0,garden,1,1)
QUICK_INFORMATION(1,"Build a garden which is now available to you, to feed your creature.",PLAYER0)
ENDIF

I've tested the 'times broken into' variable, and it doesn't work for me either, so I've reported the issue ('https://code.google.com/p/keeperfx/issues/detail?id=530').
EDIT: Mefisto says this part of the game is still 'original dungeon keeper'. It indeed does not work in DK95 either, so most likely this will not be fixed for quite a while.

The second part should simply work, to be sure we didn't miss a typo or something I copied it to a testmap and it works as intended. As soon as you get a monk you should receive access to the garden and the info should be displayed. If that doesn't happen for you there must be something else in your script that prevents this. If you don't know what, please share your script.