Competition! Best GameSalad tips!

ArmellineArmelline Member, PRO Posts: 5,354
edited May 2019 in Working with GS (Mac)

It's Humble Bundle time again, and I've been itching to play Day of the Tentacle Remastered for a while, so I just snapped the latest bundle up. There are several games in the bundle that I have no desire to play, though, so I thought I'd give them away on the forums for free!

To enter, write a comment with your best GameSalad tip. It can be a bit of logic you think is useful, or a way of better managing your workflow, or promoting your game - anything related to making games with GameSalad!

The three best responses will be chosen and given a key to one of the following games (entirely at my discretion - first place winner will get first pick etc.)

  • Grim Fandango Remastered
  • Worms Clan Wars
  • Borderlands: The Pre-Sequel
  • 80 Days

To be eligible to enter you must have a GameSalad account at least 1 week old (at time of posting). You do not require a subscription to enter. GameSalad is in no way associated with this giveaway.

This thread will be open for entries for 1 week, or until the thread drops off the front page, whichever comes sooner.

EDIT
Removed the Steam Code bit from the title since the contest is long over!

«1

Comments

  • Two.ETwo.E Member Posts: 599
    • You can make any actor Invisible by changing the self.Alpha Attribute to 0 (zero).
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Don't unlock actors in a scene unless you have a good reason for doing so. Unlocking an actor creates an "instance" that can have different rules (and even attribute values) than the original "prototype" actor. While sometimes useful, if unintentional this can make troubleshooting rules tricky because actors that appear the same can have unique rules.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • IceboxIcebox Member Posts: 1,485

    Esc key works as the back button on android devices. So if you want to use the back button on android to pause your game .

    when key esc is pressed
    pause game

  • AlchimiaStudiosAlchimiaStudios Member Posts: 1,069
    edited May 2017

    You can use the max function to compare many different numbers, not just 2 numbers like it shows by default. So not just max(x,y) but max(a,b,c,x,y,z). Same with the min function.

    Very useful for many things, such as a aggro system for an RPG, comparing enemy distances, comparing high scores, or maybe a targeting system for an RPG, shooter, TD, etc.

    Follow us: Twitter - Website

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    edited May 2017

    Tables. :# ;)

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Create an actor that is your master "controller" for each and every project you create. I call this actor RoundRules. My RoundRules actor is in charge of the "important" events in my game: saving and loading attributes, determining game over/level complete, resetting attributes and things like that. Localizing these events and behaviors can save you a lot of time later in development if you need to change something - Putting these "events" and behaviors in random actors can get extremely unorganized and can make you waste a lot of time looking for them, especially if you have a larger game with hundreds of actors.

  • gingagaminggingagaming FREELANCE GS DEV Member Posts: 1,685

    Name every rule or group in your actor in relevance to its job so when making changes or bug fixing, you know what it does!

    Already mentioned above but unlocking of actors in a scene unless needed is a massive no no as this always causes issues so if you do need to create an instance (an unlocked actor) then leave yourself a note stating why you unlocked it! For example to access scene layers or camera attributes. Always handy when tidying up.

    Finally if you experience a freeze, check you are not referencing a table row or column equal to 0. This is normally caused by using an attribute to locate a certain row or column and having it set or reset to zero.

  • pHghostpHghost London, UKMember Posts: 2,342
    edited May 2017

    @tatiang said:
    Don't unlock actors in a scene unless you have a good reason for doing so.

    I would add to this that you can vastly expand the flexibility and functionality of your actors through self.attributes

    This way, you can have only one enemy actor, with all the necessary rules, with references to self.attributes as needed. You do NOT need to unlock an instance of an actor to change its self.attributes! So you can easily change the power, animation, etc. of each instance without breaking stuff by unlocking it. And you will only need to edit one master actor to update behaviours of the whole group!

  • fmakawafmakawa Member Posts: 565

    Ask and ye shall receive. The forums are a great resource, ask clearly and you will receive an answer, even ones you dont like but you will get an answer.

  • fmakawafmakawa Member Posts: 565

    With tables, make sure you add as many rows or columns as you will ever need. Especially important for saved level data. If not, you data will be rewritten when you make updated tables and you will lose your progress.

  • NklrcadeNklrcade Member, PRO Posts: 95

    Sometimes I had many commands overlapping when I only wanted them to happen at certain times, so I added a game.Action attribute. Imagine making a slot machine...

    For instance when game.Action = 1, then Spin button can be pressed. Once pressed, then set game.Action = 2.

    If game.Action = 2, then wheels will spin and stop. Once all wheels stop, then game.Action = 3

    If game.Action = 3, then check for win. If win then payout. If payout is complete, then game.Action = 1

    Thats the basic idea... Before I had many True/False statements, but for me this is easier to see how things work in the order they're supposed to happen.

  • JSprojectJSproject Member Posts: 730

    @Armelline Good idea :)
    I need nothing for myself but instead I'll now pm you with gift links for "Her Story" and "80 Days", you are free to give them to whoever you want that contributes in this thread.

  • ToqueToque Member Posts: 1,188

    Often I made actors in a scene but I didn't want them visible so I changed them to alpha 0. But looking for them was difficult during edetting because they were well invisible. So now I leave the alpha to 1 but the first rule in them is alpha 0. So you can't see them during game play but during editing they show up...........

  • SEMASEMA Member Posts: 161

    Make sure you create your tags before adding the actors to the game. If you don't do it the engine won't detect the tags and you will have to delete EVERTHING and make it again.

  • ArmellineArmelline Member, PRO Posts: 5,354

    @JSproject said:
    @Armelline Good idea :)
    I need nothing for myself but instead I'll now pm you with gift links for "Her Story" and "80 Days", you are free to give them to whoever you want that contributes in this thread.

    Thanks @JSproject! That makes for five prizes to be given away!

  • HopscotchHopscotch Member, PRO Posts: 2,782
    edited May 2017

    Super nice idea @Armelline

    When you spawn actors and need to pass a value to them, use the Rotate, X or Y attributes to send a value.

    e.g. to set the type of enemy spawned

    In the Spawner Actor

    Spawn Enemy / Rotation = 2

    In the Enemy Actor

    self.ThisEnemyType = self.Rotation ---set enemy type to the passed value
    self.Rotation = 0 ---set the rotation value back to its default

    Now you can have rules in your enemy setting its image, health, speed, etc. depending on its type.

    This saves you from creating multiple actors for each enemy type.

    Not my idea, but learnt in this excellent forum.

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2017

    Great idea @Armelline ! . . . . not only is it a nice idea for a competition, but you also create a thread full of really useful tips ! (Why on earth are GameSalad not engaged like this ?)

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2017

    One of my favourite pieces of logic is . . .

    1-X

    Where X is an attribute and starts out as 0 or 1, repeatedly changing X to 1-X toggles X between 1 and 0, which is really useful for things like flashing lights . . .

    Every 1 second
    Change Alpha to 1-Alpha

    . . or for things like sound/mute buttons . . .

    When pressed
    Change Sound volume to 1-Sound volume

    . . and so on.

  • CasualEvolutionCasualEvolution Member Posts: 529

    @Armelline very useful idea! :)
    When spawning to many instances of one object and you need "identify" each instance:
    Create a global variable "counter" as integer, to number and counting these instances and in object a local variable "whoiam" as Id for this instance.
    Then at the beginning of rules of this object:
    counter= counter +1
    whoiam = counter

    You can use "whoiam" has Id for this instance, to index parameters in table, etc

  • IceboxIcebox Member Posts: 1,485
    edited May 2017

    Here is a general tip (more like a mistake i used to make alot).Putting a rule inside a rule can save you alot of time. I used to complicate things when i started gamesalad. For example , If I wanted to do something like this

    ( if AAA or BBB is true and x is true play animation1)
    ( if AAA or BBB is true and x is false play animation2)

    I would create 4 different rules

    If AAA is true and x is true
    do Animation 1

    if BBB is true and x is true
    do Animation 1

    if AAA is true and x is false
    do Animation 2

    if BBB is true and x is false
    do Animation 2

    Then few months later i realised i can just put a rule inside a rule , this made alot of things much easier and allowed me to use "or" & "and" together in a rule.

    When any AAA is true , BBB is true
    then do
    If x is true
    do Animation 1
    otherwise
    do Animation 2

    2 different ways to do the same thing, but you will have less code to handle and it will be easier to change and organise.

  • HopscotchHopscotch Member, PRO Posts: 2,782

    My favorite way of picking a random left/right movement

    Direction = random(0,1)*2-1
    Movement = SomeSpeed * Direction

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2017

    @Hopscotch said:
    random(0,1)*2-1

    Yeah, I often use that one too !

    It's also useful for selecting a random number from a range that spans negative and positive numbers . . . without getting a zero.

    So something like . . . . (random(0,1)*2-1)*random(1,100) . . . will give you a random value between -100 and 100 except for zero.

  • ElemetAppsElemetApps Member, PRO Posts: 55
    edited May 2017

    Every 5 minutes click that save button or after being successful with a difficult logic. Also duplicating your gamesalad file before opening a just updated gamesalad software is a great idea.

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408

    You can use your own sql server to send and receive anything you can think of:
    Sending and Receiving data using your own SQL Server

    You can also generate your own Unique Identifier for your game to track how often people play, how far they get, etc... It does reset if they delete and re download the game however. http://forums.gamesalad.com/discussion/66786/generating-a-unique-id-for-asyc-metrics-whatever#latest

  • ArmellineArmelline Member, PRO Posts: 5,354

    One day left for submissions!

  • HopscotchHopscotch Member, PRO Posts: 2,782
    edited May 2017

    Use inline LUA functions to perform string operations in the expression editor:

    e.g.

    Convert a string to Uppercase

    self.UppercaseText = self.LowercaseText:upper()

    Convert a string to Lowercase

    self.LowercaseText = self.UppercaseText:lower()

    Reverse a string

    self.BackwardText = self.ForwardText:reverse()

    Here is just one example of how to use it, although it works anywhere where you use the expression editor - like in a Change Attribute behavior.

  • fmakawafmakawa Member Posts: 565

    @Hopscotch said:
    Use inline LUA functions to perform string operations in the expression editor:

    e.g.

    Convert a string to Uppercase

    self.UppercaseText = self.LowercaseText:upper()

    Convert a string to Lowercase

    self.LowercaseText = self.UppercaseText:lower()

    Reverse a string

    self.BackwardText = self.ForwardText:reverse()

    An example, struggling to implement this.

  • CasualEvolutionCasualEvolution Member Posts: 529
    edited May 2017

    You can open 2 projects in 2 instances of GS and copy rules from one actor from project 1 and paste in other actor of project 2 :)

Sign In or Register to comment.