Pages: 1
Topic closed
im making a game called ultimate shootout, and there is 4 bad guys and a boss, and all i need is to put in the AI programming (which i am half done with) and to make the boss appear when the bad guys all die. so i made a variable called remaining bad guys. when i click the flag, the game starts and it gets set to 4.(by the way, its a hidden variable) so i put in the script for each bad guy that when their health is 0 they die and it makes the bad guys remaining thing go down by 1. so i tested it and when i killed 3 bad guys in the test, i put up the variable, and it was a timer! all my other variables worked perfectly, but this one, created for a different purpose, was a TIMER!(i put the script where when the game starts it sets the variable to 4 in the stage if that did anything... i dont know).
another problem: i want the bad guys to disappear when they die so i tried to put in a script that made them disappear when they died, and when i put the hide thing in there, he disappeared on the spot! i reseted the game, but he was still invisible. i also tried using the ghost effect thing: same turnout. i tried the "when" and "if" controls for both as well... same turnout each time....
can anybody help me with these problems? if you can, please do, as this is my first game, and ive worked really hard to get this far, and i dont want it to fail horribly at the very end like my other "first game". thnx.
Offline
i think i tried that... whatever, either way, i still need help!
Offline
Well first of all, you need to have a show block in the green flag scripts for each of the enemies. That will make them appear at the start of the game. (Otherwise they'll stay hidden.)
As for your main problem, are you saying that it steadily counts down? If you've created a variable in the normal fashion, it should only change according to how you tell it to. You should check your scripts to see if it's used somewhere else. A common cause is that you've set something to happen under a given condition, but don't tell it to stop checking once the condition is true. (So if you have an "enemy1 dead" variable, for example, if you tell it to continually check if he's dead and lower "enemies remaining" variable, it will keep checking the variable, seeing he's dead, and lowering the other variable.)
Offline
no i have a health variable for each of the enemies nothing else. the enemies remaining one was only used in a script for each of the enemies...also, it doesnt count down steadily. i recreated it 4 times, each not working, then put it next to a real timer, and they counted the same rate. it was not used anywhere else. no matter what, it wont work. i also can put a stop script thing there, because then the script will never happen, and the variable still acts like a timer!(i tried that) in other words, its the most glitchy script ever. this'll be a hard problem to fix, but once i patch up this leak, im good to go. while i ponder what to do, ill develop my AI program in another file.(i copied the game into another file, for experimenting. i always do that)
Offline
Topic closed
Pages: 1