I don't know what to do about a certain game im making!
To do a certain function/extra - animation - I put in an alarm for the object to perform that certain animation BUT im running outof alarms. I tried to use scripts but that didnt seem to workan example of code I have at the moment is this!EVENT: PRESS ENTERtext=get_string("talk",0)if text='handstand'{alarm[0]=1text=''}EVENT: ALARM[0]if keyboard_check(vk_right)==falseif keyboard_check(vk_left) == false{if dir=0{change_sprite}else if dir=180{change_sprite}So How do I do that alarms actions without using alarms?N.B I just thought to do it in the EVENT: PRESS ENTER but thenit would eventually get confusing and annoying. So what else can I do?
There's probably a better way, but I would think you could do something like this:
EVENT: CREATEvar my_alarm[0] = -1;EVENT: PRESS ENTERtext=get_string("talk",0)if text='handstand'{my_alarm[0]=1text=''}EVENT: STEPif (my_alarm[0] > 0){if (my_alarm[0] == 0){if keyboard_check(vk_right)==falseif keyboard_check(vk_left) == false{if dir=0{change_sprite}else if dir=180{change_sprite}}my_alarm[0] -= 1;}I haven't used GM in a year or two, so it may need some tweaking, but the basic idea is that you use a seperate variable that you decrement every step. (Just like an alarm does)hmmmmmm if you want something simple, I would just set a variable to the amount of seconds you want times the amount of frames in your room (default is 30) and then in step you could just subtract 1
but thats a really simple way of doing it, why don't you want to use alarms?@Ferret - "but im running out of alarms"
oh ok! thank you! ^_^
timelines could also work
Variable's with there own time (every step +1 )
so like when VAR = [certain time] then do this.:P//EXAMPLE CODE.[CREATE]global.time=0[STEP]global.time+1[END STEP]if global.time=60 { f keyboard_check(vk_right)==false}//ETC ETC.Thanks everyone =)
ok reading back on this i'ts now baby stuff, common knowledge, food for the dogs and the like…