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

Jump to content

  • (8 Pages)
  • +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

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

#91 User is offline   Dr Lancer-X 

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

Posted 19 February 2007 - 09:24 AM

HappyFoppy, on Feb 19 2007, 06:43 PM, said:

Oh dear, I'm almost annoyed by this one.
-- snip --


Argh, I hope someone can read that all. So anyway, on this board, theres this little 2x2 smiley (a large one) and I want it to move with the player keys and collide with everything the player collides with. I have a 2nd sprite for testing collision too, but the sprite that moves only collides with the other sprite and not with Solid, Customblock, etc etc. I still can't find how to solve this. :p

First of all, be careful there--your subroutine calls are causing the stack to continually grow in size. I'd recommend abandoning subroutines altogether for something like that. The problem is, when you goto "collision", you aren't returning, and thus the previous subroutine call is still on the stack.

Secondly, the code should work on customblocks (and only customblocks. That's the only board tile that collisions are checked against). In fact, I just tested it, and it DOES work with customblocks. Retry it.
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#92 User is offline   nooodl 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 735
  • Joined: 28-October 06
  • Gender:Not Telling
  • Location:Belgium

Posted 21 February 2007 - 02:45 PM

set "spr1_refx" to 1
set "spr1_refy" to 0
set "spr1_width" to 2
set "spr1_height" to 2
set "spr1_cx" to 0
set "spr1_cy" to 0
set "spr1_cwidth" to 2
set "spr1_cheight" to 2
put c?? Sprite p01 at 10 5
set "spr2_refx" to 1
set "spr2_refy" to 0
set "spr2_width" to 2
set "spr2_height" to 2
set "spr2_cx" to 0
set "spr2_cy" to 0
set "spr2_cwidth" to 2
set "spr2_cheight" to 2
put c?? Sprite p02 at 10 10
: "lop"
: "collision"
lockplayer
if uppressed then "#up"
if downpressed then "#down"
if leftpressed then "#left"
if rightpressed then "#right"
wait for 1
goto "lop"
goto "#return"

: "#up"
if c?? Sprite_colliding p01 at 0 -1 then "collision"
dec "spr1_y" by 1
wait for 1
goto "#return"
: "#down"
if c?? Sprite_colliding p01 at 0 1 then "collision"
inc "spr1_y" by 1
wait for 1
goto "#return"
: "#left"
if c?? Sprite_colliding p01 at -1 0 then "collision"
dec "spr1_x" by 1
wait for 1
goto "#return"
: "#right"
if c?? Sprite_colliding p01 at 1 0 then "collision"
inc "spr1_x" by 1
wait for 1
goto "#return"

I added 'goto "#return"' after the goto "lop". Should all subroutines get away now?
And you're right, it works. Why doesn't it check for Solid? Because no-one gives an ass about Solid or what? :p
0

#93 User is offline   Wervyn 

  • I can see you
  • Group: DigiStaff
  • Posts: 1,855
  • Joined: 24-December 00
  • Gender:Male
  • Location:Caras Galadhon

Posted 21 February 2007 - 08:46 PM

No, that doesn't do anything at all since the command is never reached. What you want is to use something like this:
if c?? Sprite_colliding p01 at 0 -1 then "#return"

Or alternatively, if you actually want to handle collisions later (like if you ever want sprite objects to be able to :touch each other), :collision needs to be its own label instead of just synonymous with :lop.
: "collision"
. "Do collision stuff here"
goto "#return"

What Lancer suggested earlier, with this code, was just to avoid subroutines altogether.
: "lop"
: "collision"
lockplayer
if uppressed then "up"
if downpressed then "down"
...
: "up"
if c?? Sprite_colliding p01 at 0 -1 then "collision"
dec "spr1_y" by 1
wait for 1
goto "lop"

However, there are advantages to using subroutines for direction labels (automatically handles moving diagonally, for example), so I'd recommend against this.

Edit: Brain fart, Lancer != Terryn...

"The terrible terrible heap monster strikes again."
To lie is to change the truth.
..Ignorance is to be unaware of the truth.
....Incompetence is to be unable to grasp the truth.
......And escape is to run away from the truth.
It is useless to run, since the truth is right next to you.

-Wervyn
0

#94 User is offline   nooodl 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 735
  • Joined: 28-October 06
  • Gender:Not Telling
  • Location:Belgium

Posted 12 March 2007 - 06:55 AM

I'm posting in here so much I'm starting to feel dumb... XD

Anyway, I wanted someone (wink, logicow) to write a tutorial about SMZX. I perfectly understand how mode 1 works, but the others freak me out, and the help file says something about color 3 and 4 and Background colors and AAAAAHHHfjeijwietj... So I'm really exploding. I'd like someone giving me some info... ;(
0

#95 User is offline   CJA 

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

Posted 12 March 2007 - 12:12 PM

smzx_mode 3 (Admins, if I'm wrong about the mode number, correct me with all due speed) works like this.

Assume
Color 0 is pure black, like always.
set "smzx_r0" 0
set "smzx_g0" 0
set "smzx_b0" 0

Color 1 is red.
set "smzx_r1" 63
set "smzx_g1" 10
set "smzx_b1" 10

Color 2 is green.
set "smzx_r2" 10
set "smzx_g2" 63
set "smzx_b2" 10

Color 3 is blue.
set "smzx_r3" 10
set "smzx_g3" 10
set "smzx_b3" 63

Color 4 is white.
set "smzx_r4" 63
set "smzx_g4" 63
set "smzx_b4" 63

We've used colors 0-4, which are in the main palette.

Now, say you have a "char" like this. Imagine black is color A, dark grey is color B, light grey is color C, white is color D.

########
########
########
########


If you pick color 0 from the color picker and lay this down,
color A becomes color 0 (The "base color", the same color as the tile) [Black].
color B becomes color 1 (Or, "base color plus 1".) [Blue].
color C becomes color 2 (Or, "base color plus 2".) [Green].
color D becomes color 3 (Or, "base color plus 3".) [Red].

So, if you lay this tile as color 0, it'll come out like this.

########
########
########
########


Using the same technique, it'll look like this if you choose color 1 instead of color 0:

########
########
########
########


About smzx_mode 2... Don't fool with that just yet.

This post has been edited by CJA: 12 March 2007 - 12:14 PM

Need a dispenser here.
0

#96 User is offline   Dr Lancer-X 

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

Posted 12 March 2007 - 02:36 PM

SMZX mode 2 still has some uses, but for the most part SMZX 3 is more flexible and usable, so stick with that. CJA's explanation was spot-on (note that in SMZX mode 3 the foreground and background colours don't matter, just the full colour number, as shown in the colour select box in the editor.)
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#97 User is offline   nooodl 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 735
  • Joined: 28-October 06
  • Gender:Not Telling
  • Location:Belgium

Posted 13 March 2007 - 07:05 AM

Lol thanks. I'll make stuff with smzx3 for a while, and when 'I'm ready', I'll check mode 2.
0

#98 User is offline   nooodl 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 735
  • Joined: 28-October 06
  • Gender:Not Telling
  • Location:Belgium

Posted 01 April 2007 - 08:22 AM

This isn't a "What's the commands that does X" question, but a "What does command X do" question.

What does mod "*" do? :(
0

#99 User is offline   Dr Lancer-X 

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

Posted 01 April 2007 - 09:20 AM

It sets the current board module to *.

You may have asked what a board with the module * (which can be set by shift-8ing in the board as well) does, but that's already documented in the help file. ^_^
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#100 User is offline   Evulaye 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 10
  • Joined: 23-May 07

Posted 23 May 2007 - 11:51 PM

Hello everyone out there in MZXWorld!! :cry: I am very new to this Robotic language. I know a little of Qbasic and Visual Basic 6.0. I also used to program on a VIC20 and a C64. I just need help with a command.

BECOME [color] [thing] [param]

Like i said, i am VERY new to this. I have read the help file. I just dont get how to use this. Mostly because I dont know all the "[thing]'s" that could possibly go in here and all the param's either. If anyone could please help, this would be greatly appreciated. :cry:

Thank you all!!!!

Evulaye :(
0

#101 User is offline   asgromo 

  • steiner, porsches
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,842
  • Joined: 04-May 02
  • Gender:Female
  • Location:New York State

Posted 24 May 2007 - 12:01 AM

For the color, hit F2. For the thing, use one of the things listed in this section of the help file. A lot of the names are slightly abbreviated in code, but you can probably figure out what they are. (Just ask, otherwise.) For the parameter, hit F4, and it will give you a menu with choices if you have a valid thing name.
0

#102 User is offline   Dr Lancer-X 

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

Posted 24 May 2007 - 12:03 AM

here are all possible THING names

char *thing_names[128] =
{
  "Space",
  "Normal",
  "Solid",
  "Tree",
  "Line",
  "CustomBlock",
  "Breakaway",
  "CustomBreak",
  "Boulder",
  "Crate",
  "CustomPush",
  "Box",
  "CustomBox",
  "Fake",
  "Carpet",
  "Floor",
  "Tiles",
  "CustomFloor",
  "Web",
  "ThickWeb",
  "StillWater",
  "NWater",
  "SWater",
  "EWater",
  "WWater",
  "Ice",
  "Lava",
  "Chest",
  "Gem",
  "MagicGem",
  "Health",
  "Ring",
  "Potion",
  "Energizer",
  "Goop",
  "Ammo",
  "Bomb",
  "LitBomb",
  "Explosion",
  "Key",
  "Lock",
  "Door",
  "OpenDoor",
  "Stairs",
  "Cave",
  "CWRotate",
  "CCWRotate",
  "Gate",
  "OpenGate",
  "Transport",
  "Coin",
  "NMovingWall",
  "SMovingWall",
  "EMovingWall",
  "WMovingWall",
  "Pouch",
  "Pusher",
  "SliderNS",
  "SliderEW",
  "Lazer",
  "LazerGun",
  "Bullet",
  "Missile",
  "Fire",
  "[unknown]",
  "Forest",
  "Life",
  "Whirlpool",
  "Whirlpool2",
  "Whirlpool3",
  "Whirlpool4",
  "InvisWall",
  "RicochetPanel",
  "Ricochet",
  "Mine",
  "Spike",
  "CustomHurt",
  "Text",
  "ShootingFire",
  "Seeker",
  "Snake",
  "Eye",
  "Thief",
  "Slimeblob",
  "Runner",
  "Ghost",
  "Dragon",
  "Fish",
  "Shark",
  "Spider",
  "Goblin",
  "SpittingTiger",
  "BulletGun",
  "SpinningGun",
  "Bear",
  "BearCub",
  "[unknown]",
  "MissileGun",
  "Sprite",
  "Sprite_colliding",
  "Image_file",
  "[unknown]",
  "[unknown]", "[unknown]", "[unknown]", "[unknown]",
  "[unknown]", "[unknown]", "[unknown]", "[unknown]",
  "[unknown]", "[unknown]", "[unknown]", "[unknown]",
  "[unknown]", "[unknown]", "[unknown]", "[unknown]",
  "[unknown]", "[unknown]", "[unknown]", "[unknown]",
  "Sensor",
  "PushableRobot",
  "Robot",
  "Sign",
  "Scroll",
  "Player"
};


some of them can't be used for obvious reasons, but most things can

In the editor, if you've already specified a colour and a thing press F4 to get an input box to specify params. If it just puts in p00 or something, don't worry about it
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#103 User is offline   Evulaye 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 10
  • Joined: 23-May 07

Posted 24 May 2007 - 12:12 AM

I can't believe how fast that reply was. You guys are awesome!!! Thanks again for the very quick reply.

Evulaye :(
0

#104 User is offline   Evulaye 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 10
  • Joined: 23-May 07

Posted 24 May 2007 - 12:28 AM

Thank you again for all your help. I am still having trouble with this. here is what i typed exactly

become c8d "Solid" p00

I just come up blue like there is a error.

The error reads...

00002: a2: expected thing, got str

Please help. :(

Thanks again.

Evulaye :cry:
0

#105 User is offline   Evulaye 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 10
  • Joined: 23-May 07

Posted 24 May 2007 - 12:29 AM

nevermind, I got it. :( took out the quotes. lol.

Thanks anyways.

Evulaye
0

#106 User is offline   Evulaye 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 10
  • Joined: 23-May 07

Post icon  Posted 26 May 2007 - 04:06 PM

Hello everyone! :cry:

How do I test whether or not X would be 1 or 2 etc.

exa in basic; IF X = 1 then goto label

Any help would be great!

Thanks all! :(
0

#107 User is offline   Evulaye 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 10
  • Joined: 23-May 07

Post icon  Posted 26 May 2007 - 04:12 PM

figured it out. :(

Thanks anyways!!! :cry:
0

#108 User is offline   Sai'ke 

  • =)
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,272
  • Joined: 08-September 02
  • Gender:Not Telling

Posted 26 May 2007 - 04:16 PM

hurray! :(
Everything is a potato to a degree you do not realize till you have tried to make it into fries.
- Bertrand Potato
0

#109 User is offline   MobianCarbuncle 

  • Unplugged Lamp
  • Pip
  • Group: Members
  • Posts: 18
  • Joined: 09-May 07

Posted 26 May 2007 - 05:55 PM

How do I use Robotic to replicate various potion effects? (as in the builtins)
0

#110 User is offline   Exophase 

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

Posted 26 May 2007 - 06:48 PM

MobianCarbuncle, on May 26 2007, 12:55 PM, said:

How do I use Robotic to replicate various potion effects?  (as in the builtins)

There's no single command for giving a specific potion effect but you can reproduce or roughly approximate most of them in a line or two of Robotic:

dud -

invinco -
set "invinco" 113

blast - (this doesn't give the random explosion radiuses)
avalanache
change c?? boulder p?? c?? explosion p14

health 10 -
give 10 health

health 50 -
give 50 health

hurt -
take 10 health

blind -
blind 200

kill - (repeat this for all enemy types)
change c?? ______ p?? c?? space p??

firewalker -
firewalker 200

explode bombs -
change c?? bomb p00 c?? explosion p20
change c?? bomb p01 c?? explosion p40

destroy dragons -
change c?? dragon p?? c?? ghost p33

create dragons
avalanche
change c?? boulder p?? c04 dragon p66

avalanche -
avalanche

freeze time -
freezetime 200

wind -
wind 200

slow time -
slowtime 200

You can perhaps also engineer putting a potion near the player and pushing him onto it..
~ 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

#111 User is offline   Evulaye 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 10
  • Joined: 23-May 07

Post icon  Posted 28 May 2007 - 09:40 PM

Hello everyone!

I need to know if there is a way I can PUT a robot somewhere on the screen.

In this example, the robot's name is "mover" and I want to put in at location 4, 4.

exa code;

:justloaded
PUT ca9 Robot p01 at 4 4
end

Is is possible that I have the parameter part incorrect. (an FYI, the editor does not give me any kind of error for the way I have it entered.) The editor shows the p01 next to the robot so i assumed that it represents it.

Any help would be very awesome! Thank you in advance. :(
0

#112 User is offline   CJA 

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

Posted 28 May 2007 - 10:01 PM

When you PUT a robot, it has no code. The parameter is just which character the robot will be displayed as. It can't do anything but sit there (and be pushed if it's a pushablerobot).

If you want to copy a robot somewhere on the screen, you have two choices. One, you can COPY BLOCK an existing robot somewhere else on the screen, like this:
copy block [robot's x] [robot's y] 1 1 [new robot's x] [new robot's y]

Or, you can do something like this:
duplicate self east
send east "dregs"
end
:dregs

And the robot that's been copied will begin its code at the label "dregs."

I'd suggest against the copy block one, though, because that will get rid of any floors or anything under where you're copying the robot to and replace it with the robot and whatever was under it.

This post has been edited by CJA: 28 May 2007 - 10:04 PM

Need a dispenser here.
0

#113 User is offline   Terryn 

  • ******
  • Group: DigiStaff
  • Posts: 2,966
  • Joined: 12-October 00
  • Gender:Male

Posted 28 May 2007 - 10:15 PM

uhh, no. DUPLICATE SELF can take an {x,y} pair too. Using COPY et al is not a good idea.

If you want a robot to simply move, just use GOTOXY # # where # # are the {x,y} coordinates.
angelic stream - shed sanguine - ill-adapt - avis - para/lyser - renaissance - dead tangent - phosphene blur - birth breeds death - ________ - painted glass - lagniappe

<Exophase> HES STEALING MAH AIRSHIP!!!!!!11111111
0

#114 User is offline   ajs 

  • carpe diem
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,614
  • Joined: 21-October 00
  • Gender:Male
  • Location:United Kingdom

Posted 28 May 2007 - 10:35 PM

I talked to Terryn about this bizarre syntax and I believe that it's not made obvious in the help text that such a combination is meaningless. So the help text for the put commands will be updated in 2.81g to reflect Terryn's suggestions here.

--ajs.
0

#115 User is offline   Evulaye 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 10
  • Joined: 23-May 07

Post icon  Posted 28 May 2007 - 10:56 PM

Thank you all very much for your replies. The GOTOXY command is definately what I was trying to accomplish.

Thanks Again!! :(
0

#116 User is offline   Evulaye 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 10
  • Joined: 23-May 07

Post icon  Posted 28 May 2007 - 11:23 PM

Hello everyone again!! :cry:

Got a question about REL PLAYER. Im trying to put it in front of GOTOXY so that I can place a robot on the screen relative to the player.

exa, When you press the S key, I want it to place a robot to the north of the player.

exa code,

: "KEYS"
REL PLAYER GOTOXY -1 0
END

This looks right to me, but I'm not sure. Any help at all would be awesome.

Thank you all so much!!! :(
0

#117 User is offline   asgromo 

  • steiner, porsches
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,842
  • Joined: 04-May 02
  • Gender:Female
  • Location:New York State

Posted 28 May 2007 - 11:29 PM

rel player needs to go on a separate line all by itself.
0

#118 User is offline   Evulaye 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 10
  • Joined: 23-May 07

Posted 28 May 2007 - 11:47 PM

Thank you very much!! :(
0

#119 User is offline   Dr Lancer-X 

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

Posted 29 May 2007 - 12:12 AM

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

#120 User is offline   Val 

  • ring ring zap
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,233
  • Joined: 19-February 04
  • Gender:Female
  • Location:Bartholomew

Posted 29 May 2007 - 12:32 AM

He PRobablyDidn' t SEE it

This post has been edited by Guy: 29 May 2007 - 12:32 AM

0

Share this topic:


  • (8 Pages)
  • +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

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