GameSalad Heads are awesome!

finalcutbobfinalcutbob Member Posts: 130
edited September 2012 in Working with GS (Mac)
Hi,
I'm new to this, but I've been around computers and the web for a LONG time, and I just wanted to say that I am really impressed with the whole GameSalad community. Its very impressive to see how people around here are willing to help others.
Keep up the good work everyone.

With that said maybe someone can help me with a couple of problems.

The first is, I am making a FPS shooter game and for the actor to die it has to get shot twice. I know how to kill the actor on the first shot but I want two shots to kill. I've tried all kinds of things and cannot figure out how to do this. Is there anyone out there that can help?

The second is, where can I learn all about attributes and behaviors? I mean EVERYTHING. I'd even be willing to pay something.

Thanks very much!!

Comments

  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    Hey,

    welcome to the community. Check out the cookbook and all the tutorials on youtube.

    In the actor make an self attribute called "Shots". Set this one to 2. THen, when overlaps with bullet -> change self.Shots to self.Shots -1..

    Make a new rule: When self.Shots = 0, destroy actor.

    Alex
  • finalcutbobfinalcutbob Member Posts: 130
    Hi Alex,

    Thanks a lot for helping me out with this!

    I am going through the cookbook now and learning lots of stuff.

    Thanks again!

    Bob
  • UtopianGamesUtopianGames Member Posts: 5,692
    edited September 2012
    The cookbook vids are great and we also have loads of free videos and templates via our resource centre free.

    Also if you get stuck this forum is very active and helpful.

    Darren
  • finalcutbobfinalcutbob Member Posts: 130
    edited September 2012
    After trying this I realized its not going to work.

    My game is actually a cannon game where the player is on the deck of a ship standing behind a cannon. Boats are sailing in front of the cannon on the horizon from right to left. You fire the cannon and hit the boat. Pretty basic.

    Using the hit twice method works if the boat is in front of the cannon when its first fired and is still there when the ball comes back down (that being the second hit).

    But in the case of firing the ball just before the boat is in front of the cannon and the ball coming down and touching the boat (registering the first hit) this would not work.

    Since the ball is normal size when it leaves the cannon and gets smaller as it moves away from the boat, I guess what I need to do is somehow make the hit active after the ball has shrunk to a certain size.

    Can anyone help me with this?

    Thanks again everyone!

    Photobucket
  • quantumsheepquantumsheep Member Posts: 8,188
    Welcome! And that looks awesome btw! :D

    A quick and dirty way to do it is have a global attribute called 'LIVE' (for live round if you will!).

    When the fire button is pressed, make LIVE = 0

    When the ball is over a certain height, make LIVE =1

    In the ship actor, if the ship collides with the ball and LIVE =1 then register a hit and make LIVE = 0.

    This should make a nice cycle of setting LIVE to 0 when you press fire, and the hit only registering once the ball is over a certain height.

    Alternatively, you can unlock the ball actor so you can access its self.size attributes from another actor.

    In your ship you'd look for 'if attribute scene>level>ball>Width/length is equal or smaller than a certain number, and the ship collides with the ball, then register a hit.

    You can't access other actor's self attributes from a separate actor normally, so this is the way to go.

    Hope that makes sense, and good luck!

    QS :D


    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • finalcutbobfinalcutbob Member Posts: 130
    Thanks quantumsheep!
    I'll give it a go later and see if I can get it to work.
  • quantumsheepquantumsheep Member Posts: 8,188
    No worries.

    I think a lot of people get bogged down in technicalities, whereas I like to see developing games as more 'smoke and mirrors'.

    A friend once made a sunrise/sunset demo and a programmer said 'How did you work out all the math for that?'.

    The response?

    "I didn't. I just interpolated the X and Y positions"

    :D

    I think as long as the illusion is convincing, you can get around most problems with a little lateral thinking!

    Anyway, good luck!

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • debugdesigndebugdesign Member Posts: 886
    Good Advice QS... I'll have to remember that

    @finalcutbob - Game looks cool...
  • finalcutbobfinalcutbob Member Posts: 130
    Thanks debugdesign.

    Quantumsheep, are these attributes boolean or real? Or does it matter?
  • quantumsheepquantumsheep Member Posts: 8,188
    It doesn't really matter. You could probably use integers, as these are more flexible than booleans (and allow you to change the state to more than just on or off).

    But if you're pretty sure you just need 2 states, use a boolean :)

    QS

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • finalcutbobfinalcutbob Member Posts: 130
    Ahhh..... Integers sound like a good idea. 0 = off, 1 = on, 2 = dancing mermaids come out. ;)
  • quantumsheepquantumsheep Member Posts: 8,188
    Exactly! They'll do juuuuuust fine :)

    Good luck!

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

Sign In or Register to comment.