How to Check Two Unique Values at Once?
#1
Posted 28 February 2015 - 09:47 AM
So here is my problem, I'm trying to use an IF command with two counters to detect if they equal unique values and if that is true to go to a given label. For instance here is what I'm trying to do (that obviously doesn't work):
If "('Counter1'=7 and 'counter2'=3)" = 1 "youdidit"
What is the proper way of doing this?
#2
Posted 28 February 2015 - 10:04 AM
T-Bone, on 28 February 2015 - 01:47 AM, said:
What is the proper way of doing this?
if "(('counter1'=7)a('counter2'=3))" = 1 "youdidit"
Better Than Nothing - DOMINATION - Commander Keen: Heroes Lost - Welkin - A Confectioner's Recipe - random ThDPro music stuff
<Risu21121> if you're not going to make a good game, you might as well make a blatantly racist one.
<Kuddy> Testicles.
"Where are my folder?" - KKairos
#5
Posted 01 March 2015 - 07:33 AM
if "((('&$butpress&&_action2&'=1)a('&$butpress&&_up&'=0)a('a_hover'>0)a('rocket'=0)a('roll'=0)a('falling'=0)a('jump'=0))a(('&$butpress&&_left&'=1)o('&$butpress&&_right&'=1)))" = 1 then "top2"Which means if the action button is pressed & the up button is not pressed & servo has the hover ability & servo is not using the rocket ability & servo is not using the roll ability & servo is not falling & servo is not jumping & the left button or the right button is pressed, then goto "top2"
Without these expressions Servo wouldn't be possible, there are just to many variables to account for with all of these different abilities.
I learned how to use expressions from the MZX-Wiki article on them: MZX- Wiki, on Expressions
"Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you’re a mile away and you have their shoes."
-Jack Handey
#6
Posted 01 March 2015 - 09:55 AM
I'm curious to know why your button variables are of the form '&$butpress&&_left&' rather than a simple 'left_pressed'
This post has been edited by Old-Sckool: 01 March 2015 - 09:55 AM
<phthalocyanine> they make experiences.
<Nadir> demos, more like
<Nadir> a glimpse into what could have been if mzx wasn't such a bore to work with
<Nadir> actually, i'm being unfair
<Nadir> i would have made mzx games if it was capable of running on more than 20 computers worldwide in 1998
<Nadir> >:D
<%Alice> functor
<%nooodl> i hear C++ has a thing called functors and they're completely different from Haskell functors...
<rorirover> the result is the most horrid thing in C++, it's basically black magic and it transforms any code you're writing into some eldritch monstrosity
#7
Posted 01 March 2015 - 11:23 AM
<@Tixus> Anyway, I set the year to 1988 for some reason.
<@Tixus> And set the microwave to run for a minute and 28 seconds.
<@Tixus> But it failed to send me back in time, and I was disappointed.
<Insidious> Tixus accidentally microwaved the 80s
<Insidious> that is my takeaway from this
#8
Posted 01 March 2015 - 11:26 AM

<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
#10
Posted 01 March 2015 - 03:53 PM
Old-Sckool, on 01 March 2015 - 01:55 AM, said:
I'm curious to know why your button variables are of the form '&$butpress&&_left&' rather than a simple 'left_pressed'
Like Lancer & Insidious said. I mostly did it like this for cutscenes. During normal gameplay, "$butpress" is set to "key" and "_left" is set to whatever number the player wants left to be. During a cutscene however, simply setting "$butpress" to anything else, say "control", and the player loses control of the robot. Then a script can be run that sets "control&_left&" to 1 until Servo reaches a desired X position, at which point "control&_left&" is returned to 0 and he stops walking.
This post has been edited by Graham: 01 March 2015 - 03:56 PM
"Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you’re a mile away and you have their shoes."
-Jack Handey
#11
Posted 01 March 2015 - 09:50 PM

<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
#13
Posted 04 March 2015 - 11:04 AM
T-Bone, on 04 March 2015 - 01:24 AM, said:
if "(('mboardx'=<23)a('mboardy'=<13))" = 1 then "scene"With equal more or less than... in each contained expression?
Yes, but <= not =<
Better Than Nothing - DOMINATION - Commander Keen: Heroes Lost - Welkin - A Confectioner's Recipe - random ThDPro music stuff
<Risu21121> if you're not going to make a good game, you might as well make a blatantly racist one.
<Kuddy> Testicles.
"Where are my folder?" - KKairos
#14
Posted 04 March 2015 - 07:17 PM
I'm also going to give Graham's video a look.
This post has been edited by T-Bone: 04 March 2015 - 07:19 PM
#15
Posted 04 March 2015 - 08:04 PM
On the note of things not being intuitive, there's a whack of things like this. Subfolder access comes to mind, along with that, reading folder contents. Just a couple days ago, mzxrules of all people asked IRC how to read the contents of the root folder, and I basically just took a few educated guesses into a robot to eventually get
set "./" "fread_open"
I'm sure someone else knew that this was the case, but how are we (those who didn't develop the current version(or are lancer-x)) supposed to know that? Is it in the wiki? (just check, I don't think so)
I guess what I'm saying that we kinda need a new mzx encyclopedia...? I dunno what I'm saying really. I just wish it were more approachable on the whole.
Huh, just found this in the help file while digging through for refernce to directories, doesn't even matter a little bit, thought I'd mention it for blahblahblah reasons.
Quote
The above will play SHOT.WAV at 48KHz (F-sharp, 6th octave)
if digitized sound is on, OTHERWISE it will play the normal
shooting sound of "+C-C".
I think that's supposed to be 4.8kHZ, what with us not being able to hear above 20kHZ.
Better Than Nothing - DOMINATION - Commander Keen: Heroes Lost - Welkin - A Confectioner's Recipe - random ThDPro music stuff
<Risu21121> if you're not going to make a good game, you might as well make a blatantly racist one.
<Kuddy> Testicles.
"Where are my folder?" - KKairos
#16
Posted 04 March 2015 - 08:05 PM
Maybe the code you've done is causing lag or is buggy and cleaning it up would help, or maybe it's not a huge burden to fix (although it sounds like it is). But if being a perfectionist is going to slow you down and delay the project, is it really worth it?
Edit:had to read what I wrote to realize I'm full of it. This is my new policy. Haha
This post has been edited by Graham: 04 March 2015 - 08:09 PM
"Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you’re a mile away and you have their shoes."
-Jack Handey
#17
Posted 04 March 2015 - 08:22 PM
Graham, on 04 March 2015 - 12:05 PM, said:
Maybe the code you've done is causing lag or is buggy and cleaning it up would help, or maybe it's not a huge burden to fix (although it sounds like it is). But if being a perfectionist is going to slow you down and delay the project, is it really worth it?
Totally agree. I would never advocate redoing working code unless... well, those things you said. Furthermore, I'd never advocate perfectionism in MegaZeux, cause part of the fun for me at least is finding a way to make imperfection seem good, or at least good enough.
Mostly, I said that because I am certain that every single mzxer has had that moment where they learn a new thing and think to themselves, "Hours... DAYS of work... That I could have done with a single line in 2 minutes.... So much wasted time..."
Redoing code after you've gotten it to work seems pretty silly to me as well, I can't say as I've ever done that when it wasn't entirely necessary. Sometimes I didn't even do it when it WAS. Domination comes to mind.
EDIT: Bwahhahah!
This post has been edited by ThDPro: 04 March 2015 - 08:23 PM
Better Than Nothing - DOMINATION - Commander Keen: Heroes Lost - Welkin - A Confectioner's Recipe - random ThDPro music stuff
<Risu21121> if you're not going to make a good game, you might as well make a blatantly racist one.
<Kuddy> Testicles.
"Where are my folder?" - KKairos
#18
Posted 05 March 2015 - 01:30 AM
Quote
Precisely and I'm already discovering how to fix several bugs with just compounded expressions. It also just makes everything a lot more neater and easier to find. Won't be fixing all past games, just the ones that still contain bugs and require improvements.
Using expressions with sprite counters... has been of unimaginable help.
This post has been edited by T-Bone: 05 March 2015 - 01:31 AM
#19
Posted 05 March 2015 - 08:38 PM
If it really bothers you, update the wiki
<phthalocyanine> they make experiences.
<Nadir> demos, more like
<Nadir> a glimpse into what could have been if mzx wasn't such a bore to work with
<Nadir> actually, i'm being unfair
<Nadir> i would have made mzx games if it was capable of running on more than 20 computers worldwide in 1998
<Nadir> >:D
<%Alice> functor
<%nooodl> i hear C++ has a thing called functors and they're completely different from Haskell functors...
<rorirover> the result is the most horrid thing in C++, it's basically black magic and it transforms any code you're writing into some eldritch monstrosity
#20
Posted 05 March 2015 - 09:14 PM
Old-Sckool, on 05 March 2015 - 12:38 PM, said:
If it really bothers you, update the wiki
heh, that's the problem, it doesn't bother me, or anyone else cause we already know most of these weird ass eccentricities of mzx. for someone to actually learn these things, they would have to look into other people's code, and I've seen some of our Robotic nightmares... They 'aint exactly reader friendly. I can't remember the last time I saw KKairos actually comment something.... Or myself for that matter.
OH RIGHT! another good example of things no one would know given the help menu is the trick where you set something like
change char id 20 "(255)"
to make stillwater any char you want while it keeps its environmental properties. I think lache taught me that like 3 years ago, and I still use it all the time.
Better Than Nothing - DOMINATION - Commander Keen: Heroes Lost - Welkin - A Confectioner's Recipe - random ThDPro music stuff
<Risu21121> if you're not going to make a good game, you might as well make a blatantly racist one.
<Kuddy> Testicles.
"Where are my folder?" - KKairos
#21
Posted 05 March 2015 - 10:10 PM
"Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you’re a mile away and you have their shoes."
-Jack Handey
#22
Posted 05 March 2015 - 10:37 PM
the other side of knowing what mzx has is how to use it effectively, and that's something that can only be gained through experience. thankfully i was good at starting projects and having them die, which meant i coded fundamental engines many many times and with practice got better ideas of how certain things should be done. if you look at modern shooty games i've worked on (the TIs, nt(n), termination, taoyarin, ataraxia etc.) in the order of their development, there's a bunch of common concepts (sprite enemies, projectile engines etc.) that appear in all of them and as a result i've had a lot of time to refine the basic approaches behind those, and where the typical trouble spots are (e.g. deleting projectiles) and how to avoid problems caused by them. shooty stuff doesn't appeal to me as much as it used to-- i think i'm still on an rpg binge and i'll need to make at least one more game to get that out of my system.
what i'd like to see is more developer postmortems. you've learned lessons in the development of your game, so now that you've finished a game, why not get it off your chest with a postmortem thread, because some of this information could be usable by other people. i should write more myself. i made an attempt with the red postmortem thread, although i think there was actually a ton of stuff i wanted to go over but forgot by the time i finished.

<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
#23
Posted 06 March 2015 - 12:37 AM
Lancer-X, on 05 March 2015 - 02:37 PM, said:
Ditto, I mean I started a lot of projects that died. I feel like all of them have been in preparation for the game I'm making now. They've always been a variation on basically the same game, refined more with every iteration. The difference being, I've yet to complete a game.
Quote
Postmortems are a great idea! I was thinking about doing some similar stuff, but like you said, while it's still fresh in my head. Once I've finished explaining the basic systems of MegaZeux in the tutorials, Sprites, strings, subroutines, SuperMZX modes, files access, etc. I thought I'd try to explain some different game design theory stuff, using my game as an example. So those could include debugging, building a complex engine, good game design vs bad, the order of execution of code (reverse send and the like) and how to set up a sprite based side scroller.
"Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you’re a mile away and you have their shoes."
-Jack Handey
#24
Posted 06 March 2015 - 01:54 AM
Lancer-X, on 05 March 2015 - 05:37 PM, said:
I really liked your red postmortem and thought it was a stellar idea. There are a bunch of reasons why I like it, such as...
We can see where you're at when making the game. Those that can't express themselves as well in MZX can often feel intimidated after playing games like this. By sort of being on the level and real about what you did and why you did it, the developer can seem a lot less like a wizard and a lot more like a person that has just spent some time learning how MZX works and also general programming practices.
Another good thing is, well, what I just said: general programming practices. It's really great that we get to discuss algorithms that were used in different parts of the game. The kitschy MZX hacks are awesome to talk about, as are general CS algorithms and how they apply in a MZX environment. It's also nice to remember that the things from the "real world" of development apply to MZX development.
This is probably the same as the first reason, but it sort of demystifies the connection between the game and the amount of prowess needed to do something like this. Simple things, like talking about how you started and what inspired you, can become inspirations themselves.
Finally, it's going to be something great for YOU to look back on, probably!
#25
Posted 06 March 2015 - 07:04 AM
#26
Posted 06 March 2015 - 07:15 AM
T-Bone, on 06 March 2015 - 05:04 PM, said:
i dunno, i think they could still be useful. smzx limits you in other ways and that clean mzx look is hard to beat. your stuff looks pretty great and i'd be interested in seeing the techniques you use

<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
#27
Posted 06 March 2015 - 07:48 AM
Quote
I would be really interested in this.
This post has been edited by T-Bone: 06 March 2015 - 07:49 AM
#28
Posted 06 March 2015 - 08:01 AM
T-Bone, on 05 March 2015 - 11:48 PM, said:
Great! I've done two videos on sprites. I have to do another one or two more, then I will release them all at once. The videos are coming along. Have you looked at the video on expressions yet?
"Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you’re a mile away and you have their shoes."
-Jack Handey

Help











