placing a rule with if scene.attribute is true gives crashes! BUG?
-Timo-
Member Posts: 2,313
in a scene I made a attribute. inside this scene I have a lot of actors that have to move when I click on a button. I didnt want to make a game attribute because it only was for this scene. in the button I made the rule when touch is pressed change scene.attribute to true
in all the other actors there had to be a rule with if scene.attribute is true interpolate self.position.X to self.startX-256.
now I placed this in the prototype but now when I open the prototype it all crashes.
video:
hope I explained enough
thanks!
-Timo-
in all the other actors there had to be a rule with if scene.attribute is true interpolate self.position.X to self.startX-256.
now I placed this in the prototype but now when I open the prototype it all crashes.
video:
hope I explained enough
thanks!
-Timo-
Best Answer
-
gyroscope I am here.Posts: 6,598
I was a bit lazy and didn't actually watch your vid., sorry! But as you say, it's difficult to read the rules anyhow…
Why are you copying a rule to place in a Prototype? and the original actor you drag out (in this test example do you unlock it before you put the Rotate attribute change in?
EDIT:
Make a new project, make a scene,an actor and a scene attribute. Place the actor in the scene and make a rule something like this. If scene.attribute is true do rotate. Copy this rule and place in the prototype of the actor. Now when you open the prototype again you cant do anything...
OK, even though I'm not fully understanding what you're doing with your example, instead of copying the rule, try putting it in the custom behaviours then dragging it out to the prototype (which I'm presuming you mean the original Prototype still in the Inspector? Or an unlocked actor dragged onto the scene?
------
Edit: just thought: check your scene attribute is a boolean; possibly if you've made it an integer by mistake and set it to true that might crash it...""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Answers
Hi Timo, is your attribute self.startX constrained? If so could be the reason for the crashes… if not, I'm not sure why then, but try altering your rules slightly to see if you get a better result:
Rule: When scene.attribute is true
Change Attribute GoPos to self.startX-256
interpolate self.position.X to GoPos
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
You can see my rules in the video (EDIT: I now see you cant really read them but for the story it doesnt matter) and I am not constraining anything. I am sure my rule is working fine as it also does in preview. The only problem is when opening the prototype actor gamesalad crashes as you can see in the video. In the prototype I am using of SCENE.attribute is true do somerhing. I think using a scene attribute in a prototype gives crashed as it will only work in one scene. I can edit the prototype so I cant delete the rule. Is there a way to fix this?
EDIT:
Make a new project, make a scene,an actor and a scene attribute. Place the actor in the scene and make a rule something like this. If scene.attribute is true do rotate. Copy this rule and place in the prototype of the actor. Now when you open the prototype again you cant do anything...
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
I already had some actors in this scene and this rule had to be in all of them. So the easiest way was just copying the rule and place it in the prototype (the rule was made in an unlocked actor)
Copying will be the same as placing in custom behaviors and dragging to the prototype actor.
Its an integer attribute and starts with zero.
Shouls I send a bug report?
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
Prototypes don't have access to scene attributes, only unlocked instances do. That might be your culprit right there, but hard to say.
It's safer to make a game attribute. It doesn't matter if you use it only for one scene -- that is often the case, actually.
Yes thats probably the crash but now I already placed it and I cant delete it. What now?
(in windows it did work )
Thanks for info
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
Dunno about that prototype. You might need to delete it completely, hard to say. Try copy-pasting it and opening the new copy, if it still crashes.
@timolapre1998
Hi Timo, I can't add anything more to what @pHghost wrote other than to underline the fact that there's no access to scene attributes or attributes belonging to another actor via the Rules section in a Prototype actor.
Maybe you somehow "tricked" GSC into accepting scene attributes via paste so it crashed then? Really don't know…
As @pHghost said, remake another attribute but make it a game attribute that can be "seen" by Prototypes, and replace accordingly in all your actors, seems the best best. Anyhow, hope you get it sorted.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps