øA slickproductions.org /forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=printpage;topic=272.0 e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexa829-3.html slickproductions.org /forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=272.0 e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexa829-3.html.z x Ûdh^ ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ €@p S6 OK text/html ISO-8859-1 gzip 8:Ö S6 ÿÿÿÿÿÿÿÿ Wed, 11 Mar 2020 04:27:32 GMT 0ó° °® 0® P® €§² ð® Ûdh^ S6
Print Page - Original Fantasy Script Commands
Board of Slick
Original Fantasy => General Discussion => Topic started by: Entroper on February 06, 2008, 10:47:29 PM
Title: Original Fantasy Script Commands
Post by: Entroper on February 06, 2008, 10:47:29 PM
This is a place for me to figure out what scripting commands I will need, and to find out from others which commands would be useful to them. I hate parsing, so I'm going to use a tree-based editor where you basically select commands from a list and fill in the parameters, with the tree branching for if statements and expressions and the like.
There are a few types of script entries: actions, conditions, and assignments. Actions are simple things like "teleport to Corneria 35, 67" or "switch music to sadness theme." Conditions evaluate to true or false, and conditional expressions can combine multiple conditions using AND and OR logic operators. These may also include numeric expressions like "4 - Global.OrbsRestored" to determine how many orbs are remaining. Assignments assign values to variables, and can also include numeric expressions, such as "Global.OrbsRestored = Global.OrbsRestored + 1".
Regarding variables, each map will have its own namespace for organization, and the quest as a whole will have a global namespace. All variables from all maps in the quest will be loaded at runtime, so you can refer to variables in other namespaces using the syntax in the above example (Namespace.VariableName). Events will also have their own names and can be referred to in the same way.
High priority: Numerical expression evaluation including +, -, *, /, % Conditional expression evaluation including AND, OR, XOR, NOT, variable equalities and inequalities (=, !=, >, <, etc.) Condition operator: Has Item Assignment to variables
Control Flow: Calling other scripts If/Else branching While loop End of control block (to end an if-else-predicate or while loop) Break, Continue (loop control) Return from script
Action: Give/Take Items/Gold Action: Teleport to Map, Location(x, y) Action: Conversation(text) Action: Enable/Disable Event Action: Ship/Airship Appears at Map, Location(x, y) Action: Add sprite at Location(x, y) Action: Move sprite N/S/E/W Action: Remove sprite Action: Wait x seconds Action: Fight Battle (domain d, battle b) Action: Change map tile (x, y) to (tile data)
Lower priority: Action: Start/Stop Music Action: Play sound effect Action: Perform graphics effects (mosaic, blur, whatever)
I'll keep updating this list as I think of stuff. Give me your suggestions and feedback please. :)
Title: Re: Original Fantasy Script Commands
Post by: Pinkpuff on February 07, 2008, 09:29:38 PM
Couldn't variable assignment be a type of action?
Also, no iterative commands? What if you wanted to, say, list everyone's equipment. Would you have to go
* Display character 1's armor 1 * Display character 1's armor 2 * Display character 1's armor 3 * Display character 1's armor 4 * Display character 2's armor 1 ... * Display character 1's weapon 1 ... etc
Or would you have a for-next type command that allows you to go
* For each character ** For each equipment slot ***Display that character's item in that slot
Title: Re: Original Fantasy Script Commands
Post by: Entroper on February 07, 2008, 09:55:52 PM
These are really for map scripts, I don't think you'll need to do much iteration. For loops either require local variables (for a counter) or some kind of list structure, which gets pretty complicated. While-loops are probably doable without too much fuss, since they just require a condition and a return point.
Scripts will be able to call other scripts like functions, or to jump to other scripts (without returning to the current script). Especially useful if you want to teleport to another map in the middle of a cutscene.
I added a few sprite commands above.
Title: Re: Original Fantasy Script Commands
Post by: Entroper on February 15, 2008, 01:35:22 AM
New action: Change map tile (x, y) to (tile data)
Useful when, for example, creating the bridge from Corneria, or blowing open the canal with the TNT. Changes a tile's appearance and all its associated data. You can change the movement flags, the fight flags, even the monster domains.
It's now possible to have treasure chests (I'll probably have a "treasure chest wizard" or something in the editor so you don't have to use the script editor for every chest). The script looks something like:
IceCave.TreasureFloater Activate on action button facing (x, y location of chest) Fight Battle (domain d, battle b (a lone EYE)) Change map tile (x, y location of chest) to (open chest) Conversation("You found the FLOATER!") Play Sound (tada.wav) Give Item (FLOATER) Deactivate Event (IceCave.TreasureFloater)
Title: Re: Original Fantasy Script Commands
Post by: Entroper on February 24, 2008, 06:52:39 PM
http://entroper.no-ip.org/OF/Scripts.txt
Preliminary script specification. Will expand as new commands are added. This gives me something to work with so I can rip the maps out of the ROM and write the map engine.
Title: Re: Original Fantasy Script Commands
Post by: JCE3000GT on February 24, 2008, 07:42:04 PM
Explination following. Don't know if these are or aren't on the list
1. Flash screen xx times using yy palette for zz length per flash 2. Fade in-out at xx speed type yy 3. Mosiac in/out at xx speed 4. Show desert wind when char hits xx coordinates (for use in the mirage desert) 5. Play music xx 6. Fade in/out music xx at yy speed 7. Play sound effect xx for yy number of times 8. Show dialogue entry xx at yy position on screen 9. "ungroup" party on the overworld by type xx
==================================
Explination:
1. Should be self explainatory. Flash the screen a certain number of times [xx] using palette [yy] at speed [zz] per flash. 2. By "type" I'm referring to the actual fade out animation, circle, square, triangle, random, rotating, you know those sorts of things. 3. When you run into a battle in FF4-6, that effect. 4. Self explanatory. 5. Duh. 6. Duh. 7. Err? 8. Self explainatory. 9. Simply show the party members walk out and form a certain type of formation, 1x3, 2x2, 3x1, 4x0, etc. Think later FF's when the walking sprite hits an event and everyone comes out of the single sprite to face the event in question. A picture can be arranged if needed.
How's that?
Title: Re: Original Fantasy Script Commands
Post by: Entroper on February 25, 2008, 07:10:44 AM
Here's the thing, palettized graphics are inefficient on modern graphics hardware. I'm probably going to experiment with various postprocessing effects and see if I can achieve similar results by applying various transforms to each color component.
I think I can do the mosaic by creating mipmaps of the entire screen and cycling them with point sampling.
Music fading, I should have thought of that. Thanks. :)
I'm going to have to figure out the dialog stuff. I left a lot of space in the opcodes for extra text box commands.
I like the party ungroup suggestion, then I can also have a "move party member" command. That's a lot easier than trying to use the sprite commands to achieve the same effect.
Title: Re: Original Fantasy Script Commands
Post by: Imzogelmo on February 25, 2008, 03:08:58 PM
When calling a battle from a script, it may be a good idea to have some bits to use for return values. For instance, you should have some way to check for "died this battle" (you may not necessarily want a game over from a scripted battle). Or you may want to have an event that triggers conditionally from a battle somehow, so some general purpose bits to pass out of the battle can be useful (FF6 has several of these, like "can shadow leave during battle"; basically several flags that effect battle from outside, or outside from inside the battle).
For some command ideas: Fade-in/out: getting away from FF1 a little bit, you could have some different types of fade-in and out supported. You could have the sides close in (opening for fade in), or top and bottom close in, or a circle that closes in/opens up (a la Zelda III), or an overall fade to/from black (or white) at some specified speed. So I think those should have at least 2 commands and 2 parameters: Style and speed. Just a thought. :tongue:
Title: Re: Original Fantasy Script Commands
Post by: Entroper on February 25, 2008, 07:44:44 PM
That's a good idea regarding battles. I think battle formations will eventually have a flag for "if you lose this battle, you don't lose the game" (I think in-battle event scripts probably won't make it into the first version), and of course the scripting system will have to have some way of reading the outcome.
I do plan on having lots of transitions, fades, wipes, mosaics, window blinds, etc.
Title: Re: Original Fantasy Script Commands
Post by: Entroper on March 02, 2008, 10:57:17 PM
Holy crap, it just hit me how to do palette cycling. It only works for 256-color textures, though, and it involves a dependent texture read, which isn't very fast. But it should be fast enough on any hardware from the last 3 years. I'll have to decide if this is worth doing or if I should just stick to post-processing.