This is a request for a script for a game i am slowly working on...
the script is meant to not allow the player to move up nor down while a switch is on.. this should not interrupt the "if the up button is being pressed" conditional branch.. thats basically all I need.. oh.. and the sprite shouldn't change either... if the switch is off than normal movement is used... it sounds pretty simple but its giving me problems with eventing... this is for XP
dude it only seems to work on switch one... but that doesn't matter..
:D it's perfect... you got what I wanted with amazing accuracy.. man!! :D expect big credit on my game if its released.. I will be working on it this summer.. :P thanks a lot...
its amazing :P
I don't necessarily understand if you're trying to tell me if I'm a criminal or not. But I have learned that just like events, in scripting there are more than one way to do things. One way might work, and another maybe simpler and clean. But they both work don't they? Unless maybe you're saying that an unclean version could and would be affected by other scripts put into the game, for which then I understand why you would want perfection. Is that what you're saying?
Well thanks to both of you... I would rather not continue this conversation the way it seems to be going..
on that side note: thanks for all of that blue scope.. eventing is probably the best thing i can do... I think it can be as efficient as scripting.. since it basically is... but events cant go through other events and that was getting the way of my plans so...
It would be a great thing to finish that game and include all of you on the credits.. thanks!
Don't worry here, I'm not looking for trouble at all ^^"
The thing is just that I'm trying to win a hopeless war against useless constant usage and cluttered coding. The criminal thing was a somewhat sarcastic thing, but yeah...
@Gundam: There are indeed more than one way to go about stuff, but just because something works doesn't mean it's good. I'm being picky about that because I see a lot of (especially PC-)Games released nowadays that are effectively in beta phase, simply because their makers didn't care all that much, and I also think that people being in these forums are likely to end up in game design something, so yeah...
As far as constants go, they're meant to be an array of stuff that doesn't changes ingame anymore (even though Ruby allows it - never think about doing it though!) and from which you can read at multiple places within the script. However, your constant is only used twice, within the same method even (allowing you to use a local variable if necessary) and therefore spawns a few more lines of coding ran through the interpreter than necessary. While this isn't much, it's still something worth thinking about.
As for the shortening, you can see I did this with an array. I can't go into detail right now, as I'm at work and don't have too much break time, however, aliasing greatly improves compatibility for "paste above Main" scripts (yours would be a "replace the original" script) as well as makes the whole thing downright more compact.
@rodas: No need to credit me, as I merely shortened Gundam's script... doesn't make it mine.
I actually tried your version blue scope but it doesn't work... or doesn't work for me... don't know why really..
soo.. I will be using gundams thanks though