Where is Else If and Else?
-
@Deeeds are you running the set gravity behaviour after setting the values? This should work:
-
Oops, forgot to add an @Jack8680 notification alerter... hope this edit does it...
Original:
This first output, from each of the receives, it does send. However the second outputs do not appear to send, when they're hooked up to something.I'm using the first outputs to change the jump characteristics, the second ones to change gravity. I've presumed (rightly or wrongly) that the second outputs of these receivers aren't firing, and therefore created the workaround, wherein I'm simply setting gravity inside the wall objects... each wall having its own Set Gravity Behaviour. This works, for now, but I'll have many more "walls" later, and wanted to simply centralise.
I could be doing something else wrong...
Or may things wrong, I presume.
-
@Deeeds I'm not sure what you mean by second output, receive message only has one output. You can use an array if you want to send multiple values through a single message though.
Edit: also, my screenshot is a bit double, you'd only need the set gravity attached to the second receive message (based on the order you send them) -
See attached. My terminology probably wrong:
-
@Deeeds oh I see what you mean now, so you're saying the second behaviour under a receive message isn't being activated? That sounds weird, maybe it's an issue with your game logic, although it could be a bug.
To make an easily expandable system for multiple vertical or horizontal walls, I'd put the walls in a tag called walls, then in the player have 4 collided behaviours that check for a collision with the tag, each with a different side selected. This way you can use as many walls as you want, and the system works on all sides of the wall.
If you want it to work for more than just horizontal and vertical, you'd have to use trigonometry. Here's an example that only works when the player collides on the left side of the wall relative to its rotation (would have it work both sides but the collided behaviour's sides aren't relative to rotation so it's not easy to detect which side the player is on): http://bit.ly/2y44obi (Paste the link in Safari). You have to rotate the walls differently for different sides, but I think this is close to what you wanted. All the behaviours are in the player (red object).
-
@Jack8680 This sounds like a VERY good idea for "code" organisation!
I was going to try it out but wanted to make sure I understand messaging (broadcast and receiving) in hyperPad first, so I rebuilt my rig of ideas on how I thought it should work and began testing it. Couldn't get it to work, changed positives to negatives and messed with a few settings that I thought might be the problem. Even swapped around the use of the first and secondary outputs and proved my theory that the secondary outputs aren't working.
Then, on the final build, to make sure I was certain it was always the same, one last time, switched back back to my ideal variation of setting that I dreamed should work... the one that's been failing all along, and decided to buy the enthusiast package... since I'm sick of seeing ads.
And then it resumed... and it worked properly.
So I suspect there's a limit to the number of outputs (to one) in a receiving behaviour in the free version, causing that second output to fail to operate.
-
It's me that's WRONG!
The reason it worked, that final run time, after buying, is that just before buying I'd cleaned up the Behaviour Editor, as I was going to send the project as a bug report.
What that cleaning up did was remove a couple of stray "Set Gravity" Behaviours that were being called right at the start of the game, since this was on the Main Layer, in the Hero Character, so on initialisation of the game they were getting called and screwing up the baseline physics setting so that nothing worked properly, or at all, afterwards.
I should have paid attention to this Main layer, and understood that all objects have an initialisation cycle during which anything in their Behaviour Editor is called/evoked.
I'm a moron.
Sorry to have wasted everyone's time!!!!
I owe. I owe.
If you need graphics, sing out. It's about the only thing I'll be useful for. Certainly not much else.
-
@Deeeds Hate it when you spend ages trying to fix something strange happening in your project when the problem is simply a stray behaviour or an accidentally cut wire (or behaviour connection).
-
@Deeeds something you could do in this type of situation(I think an admin has suggested this) is use like a “behavior on” and you could type “set gravity” to see if there are other set gravity behaviors interfering. And you would be able to see what object they are in.
-
@Aidan-Oxley It's the story of my life and code. To say it's infuriating is understating it.