 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
MultiColoredWizard Come back, baby! The Breastmaster

Joined: 01 Feb 2003 Posts: 1232
|
Posted: Tue May 25, 2004 4:57 pm Post subject: read/write general |
|
|
If you've ever looked through plotscr.hsd, you'll notice there are several things there that look confusing. Anyways, the main thing I'm talking about is read/write general(obviously).
in plotscr.hsd, go to the read/writegeneral wrappers.
...or jsut look at this
Code: | #--------------------------------------------------------------------------
# read/write general wrappers
define script(autonumber,set victory music,1,0)
script,set victory music,song,begin
write general(3,song)
end
define script(autonumber,get death script,none)
script,get death script,begin
return(read general(42))
end
define script(autonumber,get load script,none)
script,get load script,begin
return(read general(57))
end
define script(autonumber,set load script,1,0)
script,set load script,ID,begin
write general(57,ID)
end
define script(autonumber,set battle wait mode,1,0)
script,set battle wait mode,bit,begin
if(bit) then(bit:=1)
write general(101,(read general(101),and,32766)+bit)
end
define script(autonumber,set caterpillar mode,1,0)
script,set caterpillar mode,bit,begin
if(bit) then(bit:=2)
write general(101,(read general(101),and,32765)+bit)
end
define script(autonumber,set no HP level up restore,1,0)
script,set no HP level up restore,bit,begin
if(bit) then(bit:=4)
write general(101,(read general(101),and,32763)+bit)
end
define script(autonumber,set no MP level up restore,1,0)
script,set no MP level up restore,bit,begin
if(bit) then(bit:=8)
write general(101,(read general(101),and,32759)+bit)
end
define script(autonumber,set inn no revive mode,1,0)
script,set inn no revive mode,bit,begin
if(bit) then(bit:=16)
write general(101,(read general(101),and,32751)+bit)
end
define script(autonumber,set full hero swap mode,1,0)
script,set full hero swap mode,bit,begin
if(bit) then(bit:=32)
write general(101,(read general(101),and,32735)+bit)
end
define script(autonumber,hide battle ready meter,1,0)
script,hide battle ready meter,bit,begin
if(bit) then(bit:=64)
write general(101,(read general(101),and,32703)+bit)
end
define script(autonumber,hide battle health meter,1,0)
script,hide battle health meter,bit,begin
if(bit) then(bit:=128)
write general(101,(read general(101),and,32639)+bit)
end
define script(autonumber,set debug keys disable,1,0)
script,set debug keys disable,bit,begin
if(bit) then(bit:=256)
write general(101,(read general(101),and,32511)+bit)
end |
Does anyone have a list of what all of these do?
in the hardcoded commands, it says this:
Code: | 147,readgeneral,1,0 # directly read from the in-memory array of general game data
148,writegeneral,2,0,0 # directly write to the in-memory array of general game data. If you crash your game with this command, don't be too surprised
end |
Any ideas/James tell us now >: (? |
|
Back to top |
|
 |
Machu Righter, a person who rights wrongs

Joined: 09 Jul 2003 Posts: 737
|
Posted: Tue May 25, 2004 5:40 pm Post subject: |
|
|
Hmm... I don't quite know the proper terminology here, but I'd say that read general and write general are huge methods that alter the "general game data" depending on the first argument. Argument 3 is the victory music, 42 is the death script, 57 is the load script, and 101 is the bitsets, and the wrapper includes the math to identify each bit. Just as we use "import scancode" so we can say key:esc instead of its exact number, all of the wrapper methods let us refer to general data without knowing their exact numbers. _________________
Code: | [*]That's it
[*]I'm done reasoning with you
[*]Starting now, there's going to be a lot less conversation and a lot more killing |
|
|
Back to top |
|
 |
MultiColoredWizard Come back, baby! The Breastmaster

Joined: 01 Feb 2003 Posts: 1232
|
Posted: Tue May 25, 2004 6:12 pm Post subject: |
|
|
obviously, but i'm looking for a 'dictionary' of what every argument means. |
|
Back to top |
|
 |
Cube Dimensional Traveller

Joined: 02 Feb 2003 Posts: 294
|
Posted: Tue May 25, 2004 7:28 pm Post subject: |
|
|
I played with it one day, and I managed to find things like the starting map number, x, y, starting money and so forth. Very interesting. If James were to show which numbers retrieved what, we might be able to make some pretty nifty things with the command (Like, finding what music plays on which map. I've had times where I wish I could obtain the song number from one map and then play it on a different one). |
|
Back to top |
|
 |
MultiColoredWizard Come back, baby! The Breastmaster

Joined: 01 Feb 2003 Posts: 1232
|
Posted: Tue May 25, 2004 7:48 pm Post subject: |
|
|
yeah. i want to have a way to modify how some maps work. Like, changing if it's a wraparound,etc. |
|
Back to top |
|
 |
junahu Custom Title: 45 character limit

Joined: 13 Jan 2004 Posts: 369 Location: Hull, England
|
Posted: Wed May 26, 2004 2:23 am Post subject: |
|
|
well, we can either go ask paige directly, or try to figure this out for ourselves.
But what would we do with such power except abbuse it? _________________
 |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Wed May 26, 2004 2:35 am Post subject: |
|
|
I don't know if there if a descriction of the contents of the general game data array anyway, but if there is, it would probably be James Paige's.
The only use I've seen from anyone so far for it was manipulation/reading of time by Tarot Masters scripts. (They're in FyreWulffs library) _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Wed May 26, 2004 9:39 pm Post subject: General Game Data |
|
|
Here is a description of the general game data info extracted from my messy documentation:
Code: |
The following is the meaning of each element.
'(*) denotes obsolete fields
'(?) denotes runtime-only fields that I shouldnt have put in .GEN at all
'0 number of maps
'1-20 *tilesetassignments
'1 title screen index in .MXS
'2 title music
'3 victory music
'4 default battle music
'5-25 *obsolete password-related
'26 max hero graphics in .PT0
'27 max small enemy graphics in .PT1
'28 max med enemy graphics in .PT2
'29 max large graphics in .PT3
'30 max npc graphics in .PT4
'31 max weapon graphics in .PT5
'32 max attack graphics in .PT6
'33 max tilesets in .TIL
'34 max attack definitions in .DT6
'35 max hero definitions in .DT0
'36 max enemy definitions in .DT1
'37 max formations in .FOR
'38 max palettes in .PAL
'39 max text boxes in .SAY
'40 total available plotscripts (number of records in PLOTSCR.LST)
'41 ID of new-game plotscript
'42 ID of game-over plotscript
'43 ID highest numbered non-autonumbered plotscript
'44 ?suspendstuff bits
'45 ?cameramode
'46 ?cameraarg1
'47 ?cameraarg2
'48 ?cameraarg3
'49 ?cameraarg4
'50 ?script backdrop index in .MXS
'51 ?days of play
'52 ?hours of play
'53 ?minutes of play
'54 ?seconds of play
'55 max vehicle types in .VEH
'56-92 reserved for future ill-conceived additions. Ugh.
'93 password-related
'94 password-related
'95 RPG file format version ID (5 is the latest)
'96 starting gold
'97 last shop in .SHO
'98 *obsolete password-related
'99 *obsolete password-related
'100 last screen in .MXS
'101 general bitsets
'102 starting X
'103 starting Y
'104 starting Map
'105 one-time-NPC indexer
'106-170 one-time-NPC placeholder bits
|
a lot of that data is only relevant to custom, so changing it from a plotscript won't do anything. The file for mat is a horrible mess. I just kept adding things at random as I thought of them. |
|
Back to top |
|
 |
Machu Righter, a person who rights wrongs

Joined: 09 Jul 2003 Posts: 737
|
Posted: Wed May 26, 2004 10:04 pm Post subject: |
|
|
Ya think that's messy? Metal Slug F's HSS is over 800 lines and I haven't even implemented turns yet! _________________
Code: | [*]That's it
[*]I'm done reasoning with you
[*]Starting now, there's going to be a lot less conversation and a lot more killing |
|
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu May 27, 2004 2:42 am Post subject: |
|
|
Awww... 800 lines isn't that much. You can easily write that much and not have a speck of gameplay or user interface scripted in...
Hurray! A list! Seems that besides the time functions, there is little else of value to be gained, though :/ _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
MultiColoredWizard Come back, baby! The Breastmaster

Joined: 01 Feb 2003 Posts: 1232
|
Posted: Thu May 27, 2004 2:58 am Post subject: |
|
|
So there is a way to change the victory music!
What about editing inside those bitsets? How would you do that? |
|
Back to top |
|
 |
Flamer The last guy on earth...

Joined: 04 Feb 2003 Posts: 725 Location: New Zealand (newly discovered)
|
Posted: Thu May 27, 2004 3:28 am Post subject: |
|
|
wow, this looks very interesting...
maybe we could use this in some way??
or is it a bit risky/troublesome, to be using this? _________________ If we were a pack of dogs, IM would be a grand Hound, CN would be a very ficious little pitball, and Giz...well, it doesn't matter breed he is, he'd still be a bitch
(no offense to anyone that was mentioned) |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu May 27, 2004 4:16 am Post subject: |
|
|
Looks like I spoke too soon... I tried it out, and you can indeed change the victory music with that.
I also tried out changing the title screen music, starting co-ords, etc, but they don't carry over. A pity... we could have had New Game+'s
What do you mean editting those bitsets? The general bitsets in element 101? Use the functions James wrote. As for changing any of the values in that array, use write general. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Guest
|
Posted: Thu May 27, 2004 4:19 am Post subject: |
|
|
a general bitset setting script
define script(autonumber,set bitset,2,0,0)
script,set bitset,bitset,bit,begin
if(bit) then(bit:=2^bitset)
write general(101,(read general(101),and,(32767 -- 2^bitset))+bit)
end
here's what arguments it takes
bitsets 0-10
0-8 already have their own scripts.
I forgot what 9 was
10 is permit double triggering of scripts (useful)
bit 1 or 0 |
|
Back to top |
|
 |
junahu Custom Title: 45 character limit

Joined: 13 Jan 2004 Posts: 369 Location: Hull, England
|
Posted: Thu May 27, 2004 4:21 am Post subject: |
|
|
whoops! Forgot to login first... oh well.
edit: Plus it was irrelevent to what anyone wanted to know.
I was kind of hoping that new game script would carry over into new games. _________________
 |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|