dMZX Forums: "What's the command that does X" questions - dMZX Forums

Jump to content

  • (8 Pages)
  • +
  • « First
  • 6
  • 7
  • 8
  • You cannot start a new topic
  • You cannot reply to this topic

"What's the command that does X" questions Post them here.

#211 User is offline   Dr Lancer-X 

  • 電波、届いた?
  • Group: DigiStaff
  • Posts: 8,938
  • Joined: 20-March 02
  • Location:ur mom nmiaow

Posted 15 June 2016 - 01:31 AM

MZX's lack of any operator ordering other than parenthesis, while very weird for standard infix notation, is something that I'm starting to feel might be beneficial in programming languages in general. There's a slight mental load required whenever you need to work out what order *, >, && and ^ are evaluated in, especially when reading other people's code, and this is compounded when you're using a language you're not intimately familiar with (PHP, for example, is notorious for its left-associative ?: operator) or when dealing with non-standard operators.

Occasionally you need more parentheses in MZX than you would need in another language, but that downside is balanced by what I believe is the much bigger upside of _never_ having to wonder in what order something will be executed.
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#212 User is offline   Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,904
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 15 June 2016 - 02:21 AM

FWIW I usually need fewer parentheses in MegaZeux than I need in languages with standard infix.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
0

#213 User is offline   CJA 

  • «≡larch bucket≡»
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,262
  • Joined: 23-June 05
  • Gender:Male
  • Location:......@.c....

Posted 15 June 2016 - 04:33 AM

I have become so spoiled by MZX's lack of order of operations [mostly for things like color "('cycle'/8%2*3+12)"]
Need a dispenser here.
0

#214 User is offline   Exophase 

  • Laughing on the inside.
  • Group: DigiStaff
  • Posts: 7,155
  • Joined: 23-October 00
  • Gender:Male
  • Location:Cleveland, OH

Posted 15 June 2016 - 06:22 AM

I got some flak for the unordered operations way back when I added them, and I won't pretend that the real reason wasn't that it was a lot easier to implement that way. But I'm glad you guys are comfortable with it now :( Good thing because that's one of those decisions that you can't ever really undo.

I personally hate relying on order of operations, especially when it gets pretty hard to remember (and sometimes really non-intuitive) in C-like languages. Even worse when you throw in C++ style operator overloading. I almost always use parentheses when mixing operations in expressions, it makes it a lot easier for me to quickly parse the code I'm reading.
~ ex0 has a kickass battle engine, without it you sux0rz! without it you sux0rz! ~

"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay

Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
0

#215 User is offline   Dr Lancer-X 

  • 電波、届いた?
  • Group: DigiStaff
  • Posts: 8,938
  • Joined: 20-March 02
  • Location:ur mom nmiaow

Posted 15 June 2016 - 06:51 AM

View PostExophase, on 15 June 2016 - 04:22 PM, said:

Even worse when you throw in C++ style operator overloading.


brb, overloading operator,()
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#216 User is offline   MicMotorhead 

  • Member
  • PipPip
  • Group: Members
  • Posts: 144
  • Joined: 11-April 12
  • Gender:Male
  • Location:Denmark

Posted 15 June 2016 - 01:09 PM

@Wervyn

Allright, I'll keep the lack of decimals in mind when I figure out how to make the rest of my game.
Your suggestion of simply putting the * before the / actually did the trick for my current problem! :(/>

I have no programming knowledge unlike most long time MZX'ers. I have used MZX mostly unassisted since around
2003 or something, but only recently have I attempted making something slightly more complex, which is why
I'm now running into all sorts of issues.

MZX isn't really a "competitive" game engine, but I love it anyway like you guys do. It's just fun.
Making a game in MZX is almost like playing a game. I'm trying to learn Unity but... yeah, I'll keep
playing with MZX because I'd just hate to see such a neat little thing die. I hope at least a handful
new games will be released every year for a good while yet.

This post has been edited by MicMotorhead: 15 June 2016 - 01:10 PM

0

#217 User is offline   Dr Lancer-X 

  • 電波、届いた?
  • Group: DigiStaff
  • Posts: 8,938
  • Joined: 20-March 02
  • Location:ur mom nmiaow

Posted 15 June 2016 - 09:46 PM

With MZX you can make everything (except sound and music) from within MZX itself, although it can be useful to invoke external tools at times. If we could make something like that, but with the pizzazz to fill much the same niche as Unity and UE4 (keeping in mind that these engines are 99% used for horrific cookie-cutter games thrown together with barely any competence, that still end up on Steam for some reason) that would be pretty neat. If we had a basic 3D modeller along the lines of a simpler SketchUp, some basic tools for skeletal animation and a paint program suitable for texturing in place of MZX's char and palette editor...

I just find it pretty sad that there's still no GCSs that can really equal MegaZeux for rapidly prototyping game concepts.
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#218 User is offline   MicMotorhead 

  • Member
  • PipPip
  • Group: Members
  • Posts: 144
  • Joined: 11-April 12
  • Gender:Male
  • Location:Denmark

Posted 15 June 2016 - 11:16 PM

View PostDr Lancer-X, on 15 June 2016 - 10:46 PM, said:

With MZX you can make everything (except sound and music) from within MZX itself, although it can be useful to invoke external tools at times. If we could make something like that, but with the pizzazz to fill much the same niche as Unity and UE4 (keeping in mind that these engines are 99% used for horrific cookie-cutter games thrown together with barely any competence, that still end up on Steam for some reason) that would be pretty neat. If we had a basic 3D modeller along the lines of a simpler SketchUp, some basic tools for skeletal animation and a paint program suitable for texturing in place of MZX's char and palette editor...

I just find it pretty sad that there's still no GCSs that can really equal MegaZeux for rapidly prototyping game concepts.


I think one of the strengths of MZX - in a strange way - is that it can't do much more than text. It is no doubt frustrating at times to not be able to use some simple .gif sprites or break the limitations of the awkward rectangular blocks, but this simplicity makes MZX - like you said - ideal for making things quickly.

It's also kind of like a dogme movie. You got a set of rules you have to work inside, which forces you to be creative.
Still, it does happen frequently that I get an idea for a game, consider making it in MZX for a second, only to go "f*** it! Not gonna happen."


If only the graphics format was different, though... you could fool most people into thinking it was a far less archaic engine than it is. Personally, I think it's great that it just does 2D - I'd just like to work outisde of that stiff grid of rectangles and use some .png's or whatever. I have a soft spot for text mode games but I don't think most of the world feels the same way :(

This post has been edited by MicMotorhead: 15 June 2016 - 11:19 PM

0

#219 User is offline   MicMotorhead 

  • Member
  • PipPip
  • Group: Members
  • Posts: 144
  • Joined: 11-April 12
  • Gender:Male
  • Location:Denmark

Posted 19 September 2019 - 09:13 AM

I want to make a robot go east and keep trying, but the "persistent go" command only works for some directions. I'm using an older version of MZX though, so it's probably (hopefully) been patched out. Are there alternate means of making a robot keep trying a direction, until it's not blocked anymore?
I'm in version 2.83b, I believe.

This post has been edited by MicMotorhead: 19 September 2019 - 09:13 AM

0

#220 User is offline   Dr Lancer-X 

  • 電波、届いた?
  • Group: DigiStaff
  • Posts: 8,938
  • Joined: 20-March 02
  • Location:ur mom nmiaow

Posted 19 September 2019 - 11:07 AM

Persistent go works just fine. Make sure you read what the command actually does in the help file though. If you want something that works like the regular GO command, there isn't one- you can do TRY in a loop until it succeeds though.
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#221 User is offline   MicMotorhead 

  • Member
  • PipPip
  • Group: Members
  • Posts: 144
  • Joined: 11-April 12
  • Gender:Male
  • Location:Denmark

Posted 20 September 2019 - 01:07 PM

View PostDr Lancer-X, on 19 September 2019 - 12:07 PM, said:

Persistent go works just fine. Make sure you read what the command actually does in the help file though. If you want something that works like the regular GO command, there isn't one- you can do TRY in a loop until it succeeds though.


Thanks, I'll look at it and see if the TRY command is maybe a better fit.

It's very strange though. I made a robot that goes north 3 spaces, resets back to the starting position, then south 3 spaces, back to start, etc., while always waiting for any eventual enemies that block it to get out of the way.
When I copied the robot and simply replaced all NORTH directions with WEST, and all SOUTH directions with EAST, the new object moves only west and south, but never east.
0

#222 User is offline   Dr Lancer-X 

  • 電波、届いた?
  • Group: DigiStaff
  • Posts: 8,938
  • Joined: 20-March 02
  • Location:ur mom nmiaow

Posted 24 September 2019 - 11:21 PM

View PostMicMotorhead, on 20 September 2019 - 11:07 PM, said:

It's very strange though. I made a robot that goes north 3 spaces, resets back to the starting position, then south 3 spaces, back to start, etc., while always waiting for any eventual enemies that block it to get out of the way.
When I copied the robot and simply replaced all NORTH directions with WEST, and all SOUTH directions with EAST, the new object moves only west and south, but never east.


Could you paste a minimal code sample that reproduces the problem? Because I can confirm this works fine:

: "l"
persistent go "wwweeeeeewww"
goto "l"

Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

Share this topic:


  • (8 Pages)
  • +
  • « First
  • 6
  • 7
  • 8
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users