The Daily Click ::. Forums ::. Klik Coding Help ::. How to interact with objects?
 

Post Reply  Post Oekaki 
 

Posted By Message

AvatarTR



Registered
  04/08/2007
Points
  45
10th August, 2007 at 15:22:30 -

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?

I would appreciate an answer a.s.a.p.
Thanks

 
avatarturkiye.com

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
10th August, 2007 at 17:34:16 -

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.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
10th August, 2007 at 17:56:41 -

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)

ok?

 
.

AvatarTR



Registered
  04/08/2007
Points
  45
11th August, 2007 at 04:09:33 -

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

 
avatarturkiye.com

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
11th August, 2007 at 06:47:23 -

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..

Image 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!

AvatarTR



Registered
  04/08/2007
Points
  45
11th August, 2007 at 07:02:40 -

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.

So does this change what you mention :S

 
avatarturkiye.com

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
11th August, 2007 at 08:55:43 -

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.

PlayerMode = 0 (platform, normal)
PlayerMode = 1 (aa defense)
PlayerMode = 2 (perimeter tower)

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!

AvatarTR



Registered
  04/08/2007
Points
  45
11th August, 2007 at 10:08:11 -

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

 
avatarturkiye.com
   

Post Reply



 



Advertisement

Worth A Click