Documentation Project

Here's something I've rediscovered from the main code. I think you guys are familiar with the aimove command for script.

You could do the same using
Code:
changeentityproperty
as well. Here's an example:

Code:
changeentityproperty(self, "aimove", openborconstant("AIMOVE1_CHASE"));

I think everybody knows how this works, but here's something BeasTie found from a SOR mod:

Code:
changeentityproperty(self, "aimove", openborconstant("AIMOVE1_CHASE")+openborconstant("AIMOVE2_NORMAL"));

Puzzled, I checked it out on the main code and this is possible.

Here are valid openborconstants that can be used:


  •        
  • AIMOVE1_NORMAL
           
  • AIMOVE1_CHASE
           
  • AIMOVE1_CHASEZ
           
  • AIMOVE1_CHASEX
           
  • AIMOVE1_AVOID
           
  • AIMOVE1_AVOIDZ
           
  • AIMOVE1_AVOIDX
           
  • AIMOVE1_WANDER
           
  • AIMOVE1_NOMOVE
           
  • AIMOVE1_BIKER
           
  • AIMOVE1_STAR
           
  • AIMOVE1_ARROW
           
  • AIMOVE1_BOMB
           
  • AIMOVE2_NORMAL
           
  • AIMOVE2_IGNOREHOLES

Valid for AIMOVE2_* is NORMAL and IGNOREHOLES, which are both obvious.
 
Some things to consider:

Code:
setmusicvolume(left, right)

  • Sets the volume for the music channel.
  • 'left' and 'right' sets the volumes of the left and right channels respectively.

Tested: NO

Edited soundmusictempo as the name is actually setmusictempo.
 
maxman said:

From what game is the scrolling text? In fact Illusionista commented there about it.

@Illusionista, I don't know Illu if you have it, but if you still have can you share it here as well?
 
Guys, I was searching for something and I've found other things.

Undocumented animations

ANI_PICK (the source says " 7-1-2005 used when players select their character at the select screen". So its the same of SELECT animation?)
ANI_HITWALL - Tested this one. No crash, but does nothing.

Undocumented AIMOVE
BOOMRANG - Listed under AIMOVE1 series (AI move 1 enum: Affects movement path). Crashes the engine.
AIMOVE2_NOTARGETIDLE - Listed under AIMOVE2 (A.I move 2 enum: Affect terrain reflect). Crashes the engine

Undocumented options
AIATTACK1
    A.I. attack1 enum: Affect attacking style.
    Damon V. Caskey
    2013-12-27

    AIATTACK1_NORMAL,                  // Current default style
    AIATTACK1_LONG      // Long range first, not used
    AIATTACK1_MELEE    Melee attack first, not used
    AIATTACK1_NOATTACK  // dont attack at all - tried this, doesn't works
    AIATTACK1_ALWAYS  // more aggression than default, useful for traps who don't think

AIATTACK2
    A.I. attack1 enum: Affect Defending style.
    Damon V. Caskey
    2013-12-27

    AIATTACK2_NORMAL,    // Current default style, don't dodge at all
    AIATTACK2_DODGE      // Use dodge animation to avoid attack
    AIATTACK2_DODGEMOVE  // Try to move in z direction if a jump attack is about to hit him and try to step back if a melee attack is about to hit him.

MISSING INFORMATION
changelevelproperty - Which is the list of options we can use for this? The manual only says:
changelevelproperty(name, propertyvalue)

~Change a property value of current level, this function is not quite completed.
~name can be:
~"rock", the given value must be an interger value or numeric value that can be converted to integer value. The rule is same as rock command in level file, check the manual for details.

EDIT 1 - There are some info about this at the source, but I can't understand what each one does or if they are accessible throught script. For example, those aren't accessible thought script because the engine crashes:

Code:
	@script
    if(frame==0){
      changelevelproperty("nospecial", 1);
    }
	@end_script

nospecial; // Used to specify if you can use your special during bonus levels
nohurt; // Used to specify if you can hurt the other player during bonus levels
noslow; // Flag so the level doesn't slow down after a boss is defeated
nohit; // Not able to grab / hit other player on a per level basis

EDIT 2 - I think I got it:

rocking
bgspeed
scrollspeed
type
cameraxoffset
camerazoffset
gravity
maxfallspeed
maxtossspeed
quake
basemap (which seams to have other options: bm_x, bm_xsize, bm_z, bm_zsize, bm_map)
hole (which seams to have other options: terrain_depth, terrain_lowerleft, terrain_lowerright, terrain_upperleft, terrain_upperright, terrain_x, terrain_z)
wall  (which seams to have other options: terrain_depth, terrain_lowerleft, terrain_lowerright, terrain_upperleft, terrain_upperright, terrain_x, terrain_z)

EDIT 3 - Seams that you can use "getlevelproperty" to get more properties, but dunno if you can actually change them by script, like layers (yes, you can. I just don't understood how to address each layer).

        "alpha",
        "amplitude",
        "bgspeedratio",
        "enabled",
        "neon",
        "quake",
        "transparency",
        "watermode",
        "wavelength",
        "wavespeed",
        "xoffset",
        "xratio",
        "xrepeat",
        "xspacing",
        "z",
        "zoffset",
        "zratio",
        "zrepeat",
        "zspacing",

        "background",
        "bglayer",
        "fglayer",
        "frontpanel",
        "generic",
        "neon",
        "panel",
        "water",
 
I have used these:
bgspeed
scrollspeed
cameraxoffset
camerazoffset

I altered bgspeed in Rainbow mod to fasten background's movement ;)
For scrollspeed, I mostly use it to stop player's scrolling. Usually combined with script based camera control. Of course, I turned it on again after that
I modified cameraxoffset & camerazoffset with script to move camera left/right or up/down respectively. Useful in 2D mods if you want to move camera higher or lower
 
Digging in the forum I found what ANI_PICK means:

Damon Caskey said:
Yes, I am quite sure. What you see as users vs. the internal code of the engine are often very different things. "waiting" is ANI_SELECT, and what you know as selected is "ANI_PICK". Why? I don't know, I wasn't a developer at the time.
 
O Ilusionista said:
Digging in the forum I found what ANI_PICK means:

Damon Caskey said:
Yes, I am quite sure. What you see as users vs. the internal code of the engine are often very different things. "waiting" is ANI_SELECT, and what you know as selected is "ANI_PICK". Why? I don't know, I wasn't a developer at the time.

ANI_SELECT == ANIM WAITING
ANI_PICK == ANI_SELECT

Ps. bad name choosing...
 
I have to agree.

Btw, I look at the manual and its missing things like "checkhole", "checkwall". Can anyone give me details on this so I can include it on the manual?
I know what they are for, but I need an explanation to include.
 
O Ilusionista said:
I have to agree.

Btw, I look at the manual and its missing things like "checkhole", "checkwall". Can anyone give me details on this so I can include it on the manual?
I know what they are for, but I need an explanation to include.

Ok, here there is many my work too...
When I can explain all function relative to wall/hole/basemap.

For now I updated the decumentation for many elements.
Please see getentityproperty and compile it when you know...
Leave empty when you dont know so I can fill when I can!
 
By the way, I've found somethin in the source code. There are some undocumented ATTACK TYPES:

ATK_ITEM,
ATK_LAND,
ATK_PIT,
ATK_LIFESPAN,
ATK_TIMEOVER,

From what DC said, ATK_PIT its an attack type which happens when you fall on a hole. I am taking a wild guess here, but I think I got the pattern:

ATK_ITEM = attack type when are hit by an "itembox" from an item.
ATK_LIFESPAN = attack type which happens when the LIFESPAN value is reached
ATK_TIMEOVER = attack type which happens when you got a time over

I just don't get what ATK_LAND means. Any clue?
 
O Ilusionista said:
By the way, I've found somethin in the source code. There are some undocumented ATTACK TYPES:

ATK_ITEM,
ATK_LAND,
ATK_PIT,
ATK_LIFESPAN,
ATK_TIMEOVER,

From what DC said, ATK_PIT its an attack type which happens when you fall on a hole. I am taking a wild guess here, but I think I got the pattern:

ATK_ITEM = attack type when are hit by an "itembox" from an item.
ATK_LIFESPAN = attack type which happens when the LIFESPAN value is reached
ATK_TIMEOVER = attack type which happens when you got a time over

I just don't get what ATK_LAND means. Any clue?

I added all of those, and your guesses are correct. Incidentally, I had put all this in the Wiki - but nobody ever read it, much less helped me edit, which is why it's never been on my list of priorities to fix. Anywoo, ATK_LAND is for damage taken when damage_on_landing is applied, or from the engine's default Throw system.
 
checkhole(x,z,y)
~it returns 1 if there's hole here, otherwise it returns 0
~y is optional but if you use it, then you can detect an hole just if hole height (default 0) >= y

checkholeindex(x,z,y)
~it works like checkhole() but it returns the index of hole in the level, otherwise it returns -1
~y is optional
~you can use hole index for get/change levelproperty

checkwall(x,z,y)
~it returns the height of wall from 0 (not wall or height 0) to... X height
~y is optional but if you use it, then you can detect walls from height y, otherwise with just 2 params (x,z) it uses the default value (y = 100000)

checkwallindex(x,z,y)
~it works like checkwall() but it returns the index of wall in the level, otherwise it returns -1
~y is optional
~you can use wall index for get/change levelproperty

checkbasemap(x,z)
~it returns the base height in X,Z coords.
~if there is a hole, it returns -1000

checkbasemapindex(x,z)
~it works like checkbasemap() but it returns the index of basemap in the level, otherwise it returns -1
~you can use basemap index for get/change levelproperty

checkplatformbelow(x,z,y)
~it returns the platform handler (entity) in X,Z coords below y height, otherwise it returns NULL()

checkplatformabove(x,z,y)
~it returns the platform handler (entity) in X,Z coords above y height, otherwise it returns NULL()

checkplatformbetween(x,z,y_min,y_max)
~it returns the platform handler (entity) in X,Z coords and bewteen y_min and y_max, otherwise it returns NULL()

generatebasemap(map_index,rx,rz,x_size,z_size,min_y,max_y,x_cont)
~It generates an inclined terrain
~map_index: is the index of basemap. the new basemap must have last_index + 1 -> last_index + 1 == openborvariant("numbasempas")
~rx: it generates basemap from coord X
~rz: it generates basemap from coord Z
~x_size: it generates basemap from coord X to x+x_size
~z_size: it generates basemap from coord Z to z+z_size
~min_y: is the minimum height
~max_y: is the maxmimum height
~you can invert min_y and max_y too!
~x_cont: is an optional parameter. yif you set it you generate a basemap from x to x_cont as you set from min_y,max_y param, but from x_cont to x_size

the basemap will have max_y height. Example: generate_basemap(index, rx, rz, x_size, z_size, min_y, max_y, x_cont); from x_cont to x_size basemap will have the max_y height.


you can find them in manual:
http://dcemulation.org/?title=OpenBORManual
 
Not at all!  ;)
There is many my work in these functions..
Various improvements and I added the optional y param to wall/hole.
Added many functions like: checkholeindex, checkwallindex, checkbasemapindex, generatebasemap...
Added function to script like: checkplatformabove, checkplatformbetween...

Oh, I remember you that you can handle basemap via  get/change levelproperty too to create custom basemap.

For example generatebasemap() is the hardcoded version of:
Code:
void change_basemap(int map_index, float rx, float rz, float x_size, float z_size, float min_y, float max_y, int x_cont) {
    float x,z;
	float delta,y,tmp;
	int dir = 0;

	changelevelproperty("basemap", map_index, "x", rx);
	changelevelproperty("basemap", map_index, "xsize", x_size+2);
	changelevelproperty("basemap", map_index, "z", rz);
	changelevelproperty("basemap", map_index, "zsize", z_size+2);

    if (min_y <= max_y) dir = 1;
    else
    {
        dir = 0;
        tmp = min_y;
        min_y = max_y;
        max_y = tmp;
    }

	delta = (max_y - min_y) / ( (x_size <= 0) ? 1 : (x_size-1) );

	for( x = 0; x < x_size; x++) {
		if ( dir == NULL() || dir > 0 ) {
            if ( x == x_size-1 ) y = max_y;
            else y = x*delta + min_y;
		} else y = max_y - (x*delta); // + min_a

		if ( x_cont != NULL() ) {
            if ( dir == NULL() || dir > 0 ) {
                if ( x+rx >= x_cont ) y = max_y; // connect with the wall more smoothly
            } else {
                if ( x+rz <= x_cont ) y = max_y;
            }
		}

		for ( z = 0; z < z_size; z++) {
			changelevelproperty("basemap", map_index, "map", x, z, y);
		}
	}
}
 
I discovered that are still undocumented things on this engine: getlevelproperty.
Doing a search on the forum, I got some results with this code, so it is something already know by some users, but this was never put into the manual.

Anyway, I've jumped into the source code and found some information:
Code:
openbor_getlevelproperty(ScriptVariant **varlist , ScriptVariant **pretvar, int paramCount)
Is this the right synthax?
getlevelproperty(name, property, propertyvalue)

The available properties are:
      "basemap",
        "bgspeed",
        "cameraxoffset",
        "camerazoffset",
        "gravity",
        "hole",
        "maxfallspeed",
        "maxtossspeed",
        "quake",
        "rocking",
        "scrollspeed",
        "type",
        "vbgspeed",
        "wall"


For the basemap propertyvalues, we have:
        "map",
        "x",
        "xsize",
        "z",
        "zsize",


For walls and holes, we have:
      "depth",
        "height",
        "lowerleft",
        "lowerright",
        "type",
        "upperleft",
        "upperright",
        "x",
        "z",


There is also changelevelproperty, which the manual only says:
changelevelproperty(name, propertyvalue)

~Change a property value of current level, this function is not quite completed.
~name can be:
~"rock", the given value must be an interger value or numeric value that can be converted to integer value. The rule is same as rock command in level file, check the manual for details.

But we can see an example above, done by White Dragon, which uses a different synthax:
Code:
changelevelproperty("basemap", map_index, "map", x, z, y);

Can someone give us more info? Knowledge was made to be shared :)
 
Back
Top Bottom