dMZX Forums: INCLUDE or IMPORT ROBOT -> MegaZeux Feature Requests -> Tracker

Jump to content

Report ID 406 Title INCLUDE or IMPORT ROBOT
Product MegaZeux Feature Requests Status Flagged For Future Version (Severity 1 - Low)
Version - Fixed in -

Page 1 of 1
  • Cannot start a new Issue
  • You cannot reply to this issue

Report ID #406: INCLUDE or IMPORT ROBOT

#1 User is offline  
CJA 

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

Posted 29 December 2011 - 03:25 AM

This is a (deceptively) simple and seemingly necessary feature I thought of the other day. An include command, to insert some code into a robot, for code that is shared across many robots.

It works like LOAD_ROBOT except it doesn't erase the code before and after the command is called.

Syntax:
set "setupSprite.txt" "INCLUDE_ROBOT"
set "messageBoxCode.dat" "INCLUDE_BC"

Judging by how other commands seem to be implemented, this is probably somewhere between easy to medium difficulty to implement, depending on how robots are stored. Modify the SAVE_ROBOT function to save two chunks (before and after the import), and the LOAD_ROBOT one to load the new one in place, and glue them together. Sure is easy for me to say, though. But hey, it seems quite feasible and extremely useful, so there it is.
Need a dispenser here.


Page 1 of 1  
  • Cannot start a new Issue
  • You cannot reply to this issue

Replies (1 - 5)

#2 User is offline  
Lachesis 

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

Posted 29 December 2011 - 03:47 AM

Seconded. I think this would be very useful.
"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

#3 User is offline  
zzo38 

  • Registered members
  • PipPipPip
  • Group: Members
  • Posts: 446
  • Joined: 16-May 08
  • Gender:Not Telling

Posted 29 December 2011 - 04:06 AM

Don't use SET; it should probably be a special comment syntax instead. (SET should be a kind if imperative command but if you want it to do labels and all that stuff, it wouldn't make sense to use an imperative command)

#4 User is offline  
Lachesis 

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

Posted 29 December 2011 - 06:59 PM

More specifically, the reason I think this would be useful is partly because Codex of Zephyr is built on doing this. Segments of runtime code are pieced together by base level code that runs between them, leaving all sorts of room for nasty errors (not to mention making the robotic code considerably more complicated). For instance, my code would accidentally try to fread nonexistant files into the temporary constructed program and cause MZX to enter busy loop territory. An MZX-based implementation of this would be a whole lot safer and much more understandable from a user's point of view.

I assume this would be implemented similar to LOAD_ROBOT, but instead of replacing the program, it'd append the new program to the end and remember the robot's current line -- otherwise I can picture it being functionally the same.
"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

#5 User is offline  
zzo38 

  • Registered members
  • PipPipPip
  • Group: Members
  • Posts: 446
  • Joined: 16-May 08
  • Gender:Not Telling

Posted 29 December 2011 - 10:10 PM

Lachesis is correct; but still, think about whether an imperative code is suitable or if you require labels and stuff too.

#6 User is offline  
Lachesis 

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

Posted 22 May 2012 - 01:24 AM

Updating status to: Flagged For Future Version
Updating severity to: 1 - Low

I believe this won't be necessary once programs and robots get separated (ETA after debytecode becomes mainstream) as there will be provisions for changing a robot's program (like LOAD_ROBOT) and potentially a global subroutine library program that all programs can access (eliminating the need for this).
"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


Page 1 of 1
  • Cannot start a new Issue
  • You cannot reply to this issue

0 User(s) are reading this issue
0 Guests and 0 Anonymous Users


Powered by IP.Tracker 1.3.2 © 2025  IPS, Inc.