Forward: For whatever reason, Firefox didn't refresh, so my reply is very late.
[ ... ]
However, there are a still a few things I haven't been able to find on my own.
Misc Room Script Flags- I know that they exist and even that there are 5 types. Here's the only one I know of.Screen->Flags[SF_MISC]&0x008;//Screen flag Script 2So, what are the other four? How can they be used most effectively?
From my custom std.zh v2.50.2
//Misc. Screen flags. OR (|) these together to use (Read-Only). const int SF_MISC_ALLOW_LADDER = 0x0001; //Toggle 'Allow Ladder' const int SF_MISC_NO_DIVING = 0x0002; //Toggle 'No Diving' const int SF_MISC_SCRIPT1 = 0x0004; //General use 1 (Scripts) const int SF_MISC_SCRIPT2 = 0x0008; //General use 2 (Scripts) const int SF_MISC_SCRIPT3 = 0x0010; //General use 3 (Scripts) const int SF_MISC_SCRIPT1 = 0x0020; //General use 4 (Scripts) const int SF_MISC_SCRIPT1 = 0x0040; //General use 5 (Scripts)
IIRC, all these are read-only. You can determine if one of them is ticked in the Screen Data editor pane, but you can;t modify it. It's useful for global scripts, where you want effects to run, without using Screen->D.
Use if statements to check for one, or more (or a combination of) these flags being enabled, or disabled. You can set up to 32 combinations, and make functions that use them unique per DMap.
Mysterious Script Crashes- Some times, for no apparent reason; scripts activate when they shouldn't. At others, they don't work when they should (and have up to that point). When no change has been made to the scripts in the meantime, how can the source of these errors be discovered?
Edit: Please pardon my lingering reply here.
What types of scripts? Do you have an example?
Usually, this happens when you pass args that are illegal, such as trying to put a pixel down outside of the screen area, or perform a Sqrt() of a negative value, because the input to a function is passed by a variable that generates an illegal instruction, or scripts that create infinite loops if a condition is/is not met.
I'd need some examples of scripts that cause you trouble, for more technical feedback on why they seem to crash at random, however, random crashing is almost always due to an if/else problem, or more likely, an argument passed to a function, that ZScript can't execute. The latter is almost exclusively caused by passing that arg based on a variable.
int vx; int vy; Screen->PutPixel(6, vx, vy, 17, 0, 0, 0, 128);
This looks fine on the surface, but if vx or vy is a negative value, ZC (2.50.0) will crash.
The way to prevent this, is with if statements, or Clamp() instructions.
int vx; int vy; if ( vx >=0 && vy >= 0 ) Screen->PutPixel(6, vx, vy, 17, 0, 0, 0, 128);
Other Movement Patterns- I'm familiar enough with the various Ghost.zh commands to figure out how to use each one. However, other movement patterns have been suggested; for example a sine wave or an infinity loop. Another pattern I don't know how to mimic is that of the common Wizzrobe. So how can these be done? And what are some other movement patterns?
I'd advise reading the ghost.zh topic from stem to stern; and looking at ghost scripts with those movement patterns.
There is a Sine Wave Enemy in this topic.
If you want more details on movement, please be more detailed in your request.
Detecting If All Switches/FFCS Have Been Activated- One script that I had provided for me does this. I'm trying to refine another (the one utilized by the script you'll see in the Multiple Songs/Ocarinas topic) where when all of the ffcs running that script are activated; then other secrets, triggers, ffcs or whatever is activated as well.
Multiple FFCs activated: You essentially need a global condition for that. Each FFC on the screen should add +1 to a variable, and if the value of that variable is >= the number of FFCs on the screen that you need to trigger, then you trigger the effect.
Likewise, you can trigger FFCs with global vars. I suggest using arrays to hold these conditional vars, else you'll quickly expend your global registers.
This script is probably one of my most revolutionary designs, since It easily allows you to create up to 8 secrets on screen that can be triggered permanently and 15 others that can be set off temporarily; opens up extra secret flags; bypasses the whole secret combo setup routine and generally allows a greater amount of variety in the puzzle setup available to the player. So, naturally I want it to be the best it can be.
Time to Tango- I'm going to begin delving into Tango.zh soon. I've looked over the example quest and I've noted the following details. The commands are prefaced by the @ symbol. Syntax seems to be similar to other functions (if, else if, else, append, delay, rand, playsfx, etcetera...)
You can change the token from @ to something else, if you so desire.
So the big question is... what are the commands that this uses just with the global script and creating no custom functions of your own? What do commands like @a0 do? What are the codes for the various letters? (Example, @256 is used in the example quest to create an A with a circle around it.) How do you set up the background for the various strings?
Obviously, this isn't a conundrum that will solve itself overnight. But I'm ready to start learning.
The Tango tokens direct the special interface (Tango) to perform tango-specific routines. There is a list of them in Tango_usage.txt. Again, reading the Tango thread will be useful there. Unless I'm horribly mistaken, a raw numeral as an instruction produces a specific character from a tile font. In that case, in the font used, char 256 is a circumscribed 'A', and @256 instructs Tango to draw that symbol.
My custom string.zh has constants for the normal, and extended ASCII characters, to simplify making tile fonts. I also created a Katakana font, that I'll eventually distribute.
Backgrounds are established either with drawing functions, of with 'Window Styles'. I have a custom Tango build with (annotated) example scripts available, should you wish to review it. Window styles are established in there, with tiles; but should you need an example quest file, I'll upload one.
In this case, the script that I was referring to was the one I'm using for the Pegasus Boots. I've have more than one problem with it occur. One time, it seemed to activate before I got the item. (I've never been able to reproduce that, so I don't have a clue why it happened.) Currently, they just seem to have stopped working entirely. I reload my script file, loaded everything back into slots again; but the game ignored it.
I'd suspect...
- Placement in your global script;
- not meeting an if/else condition (failed evaluation);
- old save files.
Basically, the original script allowed you to permanently set screen secrets. But the adjusted version doesn't seem to want to carryover the correct value. Is this because I have the order of the arguments wrong? One explanation I read suggested that it should be Game->SetDMapScreenD(Dmap, screen, Screen->D[D], D).
You are using the wrong syntax, entirely.
If you want to set Screen->D[2], to a value of 5, on DMap 1, Screen 14:
Game->SetDMapScreenD(1, 14, 2, 5);
You have the option to enter screen IDs in hex format, rather than decimal, by preceding the value with 0x:
Game->SetDMapScreenD(1, 0x0E, 2, 5);
Technically, you can also use the binary equivalent; and in fact, you can use decimal, hex, or binary values any time that you need to give a numeric value:
14; //Fourteen, decimal. 0x0E; //Fourteen, hexidecimal. b1110; //Fourteen binary. int x = 14; int y = 0x0E; int z = b1110; //Sets x, y, and z to 'fourteen'.
Edited by ZoriaRPG, 05 September 2015 - 03:56 AM.

