Change Scene Attributes based on actor events

tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
edited November -1 in Working with GS (Mac)
Hello, I am new to game salad.
I have the general basis of my game setup with the actors and behaviors set. Now I am trying to make the game more unique as well as add dificultty to later levels. What I want to do is basically change the gravity setting of one scene if two specific actors collide. I can only find a way to change actor attributes on collisions.

Thanks
For any help you guys can give

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Ok I did figure out how i can make an actor inside a specific scene do this but is there any way I can set that actor to affect every scnen it is in the same way. basically so i dont have to set it 5 times for each level and them for 100 different levels
    Thanks
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi tenrdrmer, unfortunately you can't change any physics attributes while the game is running, gravity included. Whatever gravity amount is set pre-running, that'll be the fixed amount affecting every actor in the whole scene, if moveable.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Well now don't take this the wrong way but i found if you can edit the rules for an actor once it is in the scene and click that unlock and you can use the constrain attributes behavior and I set it to scene gravity y - 20 on collision of two actor types and it definitly works. I just would like to make that a default rule for the actor. Any ideas?
  • StusAppsStusApps Member, PRO Posts: 1,352
    The actor prototypes can not affect scene properties. Only unlocked individual actors already in it. So the actor would already need to be in the scene from the start and not spawned part way through.

    Couple of ways to achieve what you want though. I made the gravity continually change during a game by using accelerate instead of the gravity option. By giving an actor an accelerate behaviour in the direction you want gravity it has the same effect. This could then be changed when a global attribute is changed for all actors.

    The other option could be some sort of invisible controller character in the scene already that responds to some global attribute change and shifts the gravity. eg. when 1 and 2 collide change attribute ? to True. Then the controller would look out for ? being true and shift the gravity in that scene. You would need to have the controller already in the scene on every scene, but that's not too big a job.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Haha. I figured out how to do exactly what i wanted. For anyone interested, yes when you create the prototype actor you cannot make it change any scene attribute. Only it's own. (previously stated by StusApps). However, i found that once created and dropped into a scene you can unlock the actor and add some more rules that will edit the scene attributes. (Also previouslyNow what i did was once i got that rule set just how i wanted it, I dropped it onto my behaviors. then went back to the the actor prototype and put the new my behavior i created on the prototype and it worked. every time i place that actor into a scene it already has the rules of how it need to change the scene when it gets an event such as a collision. I case anyone is confused on why i want this the game i am building takes place in space and has "artificial gravity generators" and when a certain actor contacts that gravity generator it destroys it thus reducing the remaining gravity.

    Thanks For the help.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Glad you got it sorted; and thanks for correcting me! :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    No prob. I just didnt want to come across as a knowitall. lol. Cause i definitly don't. Now in another month i prob will be. lmao
Sign In or Register to comment.