I'm still working on the same project but need some help with a subject. The game starts off with a guy with a small pistol, but this dude can use the machines around him. But how can I make it so that he can use them? At the start, there is only 1 guy but I want him to be able to use the enviroment around him (machines, turrets, etc). What is the way to do it? Counters? Disable/Enable groups?
It depends very much on what you want those machines (etc) to do. Exactly what are you trying to do? Do you want the guy to be able to pick up things or just flip switches and stuff, or what do you have in mind? We can't read thoughts, you know.
You can use any method you want really.
Flags, Counters, Alterable values, Disabling groups.
Some methods work better than others, for instance.
If there is a switch that turns the machine on or off, you can use a flag. because flags can only be on or off.
If it's a timed machine, that works for a set period, you can use a value or a counter (better to use an alterable value if there are a couple of the same object)
so you can put in the even editor
Upon pressing space + character is overlapping machine
Set value A to 300
If value A is greater than 0
subtract 1 from Value A
If value A is greater than 0
play animation (running)
Well the guy can use the machines around him. The machines are like aa turrets, perimeter towers,etc. So they are stable objects but have completely different movement for them. I'll try your method Andy
I'm doing something similar, and the best way is to indeed use flags. If these are "one use only" machines, like in order to get some sort of weapons / item / other reward, I would suggest that you couple it with an array to save the information.
Do something like this:
Start of Frame
+ Array(1) = 1 then
-> set Object("machine") flag 0 to ON
-> change animation of Object("machine") to "activated"
If character overlaps Object("machine")
+ Object("machine") flag 0 is OFF
-> Array(1) = 1
-> Set Object("machine") flag 0 to ON
-> Animate Object("machine") to "activated"
-> Make interesting sound effect
-> Give player the item / weapon / etc.
* * *
I do this all the time and it's never been a problem for me. DaVince has personally seen all the flags I use lol..
Edited by the Author.
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
Actually they won't use it for once. There are 3 options in the game. You can either not use any weapons and control the dude (normal platform movement) or you could use the 2 options (perimeter tower and aa-defense). The game will revolve around these 3 options. Because the enemy will both enter from the ground and from the sky.
Hmmm, well sounds like whatever you decide you should have a global variable that's set to what mode your guy is playing in and have that be a determining factor too.
You should be able to come up with something that'll work using what people here have said. It might take awhile but it'll be great when you work it out and see it in action later!
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
I'll probably use the "activate group" thingy. The perimeter tower and the aa defense is working well at the moment, only the platform movement left, then I'll add the enemy forces