Corby |
Does anyone know how to make a simple timer? What I use now is a transparent view that I move across the screen using move.obj. Is there a simpler way? Also, is it possible to have a sound file play through multiple screens without reseting? For example, like in Space Quest 3, when Roger walks through the trash frieghter, the music plays in each screen uninterupted. |
AGI1122 | SQ3 is SCI not AGI. AGI's sound engine doesn't support that... but I had suggested it to Nick for NAGI. |
Andrew_Baker |
First off, to make a timer, declare a variable. Start this variable at 0. When it reaches 255, have your timed event, then reinitialize the timer. Basically, it's a for loop, but if you don't have a for statement in your language, it ends up looking like. if (timer<255) { timer+=1; } if (timer==255) { //timed event stuff timer=0; } As far as having sound that wraps around screens, while this isn't particularly difficult, it would be difficult for me to explain fully. Basically, you can put this in a logic that is called every cycle. Within this logic you put the sound_done_flag. This is easy enough. The hard part is the memory management. AGI is very shady as far as handling resources. Sound files are notorious. Good luck, good games. |
Corby |
Thanks Andrew. I've got another question. I want to place a view using position.v and do something like this: I have a character o1, so I use get.posn(o1,v50,v51) then I use position.v(o1,v50,v51) After that view is done animating I load another view(o2) that is similar but 2 or 3 spaces to right of the original. The problem is that when loading this next view, the character looks odd appearing 3 spaces to the right. I want to do something like this to correct this: position.v(o2,v50 - 3, v51 -3) something like that, I'm sure it's possible to do this but I can't figure it out. |
Andrew_Baker |
Um... I don't really like multiple-topic threads, but I'll help you out. Basically you just need an offset when positioning the new view, because it's a different width? Math is pretty crude in AGI. A FEW AGI MATH RULES OF THUMB----> -Equations are not allowed as arguments -Equations can really only do one operation at a time -Generally, there can be only one variable in an equation. So, saying position.v(o2,v50-3,v51-3); just won't work. However, if you put in the right conditionals, then you can reinitialize v50 and v51 with the offset before you get to the position.v() command. So: if (second_view){ v50-=3; v51-=3; } AGISCI put together a great help file that's built into Agistudio. I use version 1.34, which has the most complete, up to date info. Also, you should pay extra attention to the sections on math and logic. These parts really describe the quirks you'll have to deal with in AGI. Peace out! |