Doesn't make sense...

SingleSparqSingleSparq Member Posts: 1,339
edited November -1 in Working with GS (Mac)
So I have an actor that when an attribute is true creates a shield around itself. Now currently, when this happens ( shield = 1), the actor is safe from enemies and a shield image sitting off to the side is then constrained to the actors position. This works but I though about using another method.

The other method was when shield =1 change image of actor to shield and change size of actor attributes to match the shield image as it is bigger. Seems simple but when I start the level the actor size is always changed to the large size - even though the rule is false not true, how is it doing that? I even set a change size attribute outside the rule in to keep the actor it's normal size but it always resized to large.

Not that I want to use this method now but just bugs me that the logic doesn't seem right. If the rule is not active, how is it changing?

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You may have something hiding in an otherwise statement somewhere changing the sizes.
  • AppChogieAppChogie Member Posts: 503
    You need to put in the rule the Otherwise rules for when shield=0
  • AppChogieAppChogie Member Posts: 503
    if shield =1 change image to...
    change self.size.w to...
    change self.size.h to...

    otherwise
    if shield=0
    change image to... (reset back)
    change self.size.w to... (reset back)
    change self.size.h to... (reset back)
  • SingleSparqSingleSparq Member Posts: 1,339
    No only introduced the size change in two places, originally had the normal size set in the otherwise but still no change. Odd thing was when I play the level(with the now larger character) and invoke the shield, the image change (shield) appears briefly but should be retained for as long as the shield attribute is true.
  • SingleSparqSingleSparq Member Posts: 1,339
    AppChogie said:
    if shield =1 change image to...
    change self.size.w to...
    change self.size.h to...

    otherwise
    if shield=0
    change image to... (reset
    change self.size.w to... (reset back)
    change self.size.h to... (reset back)

    So are you saying in the otherwise I should create the actual rule if =0 or just include those items in the otherwise area?
  • SingleSparqSingleSparq Member Posts: 1,339
    I should also ask what the best method is for altering a actor with a different image (and size) breifly that's optimal for performance? Is there a better way than the 2 I describe above?
Sign In or Register to comment.