Plombo's to-do list

I will take a look on that list. I remember that one of those subject_to had an inverted logic (or the manual was wrong, I can't remember) - when you set it to 0 actually turns ON the "subject", not the opposite. If I am not wrong, it was the subject_to_maxz (and minz) and it was a error on the manual. I will check it when I can.

I remember that I already found some that I had no clue what it does here like "adjustwalkanimation".

And guess what: all those gif related commands are new to me and undocumented:
playg
openanig
decodeanig
getaniginfo
thanks!
 
phew, that was very time consuming, but I got it!

Here is evertyhing I found. There are things with superficial documentantion, things with documentation only in Wikia ( I will add it to the manual as well) and things with no documentation at all.

Almost every aiflag has no documentantion. For example, "Animating" is when the entity is finished the fall animation (took from a DC's post). But "falling" triggers when the entity is falling, on the air?

To keep the topic clean, I will give you the Pastebin: link http://pastebin.com/dvNPcgqv
Its a long list, I know. But if you (or any other OpenBOR coders) could take a look in any of the options, I would be glad to add to the manual.

Thanks.
 
@Illusionista, you already stumbled upon the main topic for priority and spawnoveride:
http://www.chronocrash.com/forum/index.php?topic=312

If I'm right, I think waypoints have an AI function (like half-life bot waypoints) or waypoints in the sense of checkpoints.

and for shutdown: I think this is internal wise, there were a lot of shutdown that was used in the main code, but I think it can be used for a menu or something to exit the game during the end of a scene (using script of course)?

And do you think you need to place this in a separate thread that will document the documentation, a sort of "documentation project"?
 
Compared to other languages, OpenBOR script is slow, but that doesn't matter because even for very script-heavy mods, script is generally not much of execution time.

I agree. The interpreter efficiency is enough under most circumstances.

What does matter is memory usage and code size.  OpenBOR's super-minimalistic script engine compiles to just a few kilobytes on any given platform, so it's not occupying valuable memory.  And we try to keep script memory usage down as well.

Glad to know that. Thank you to let me know about this.

Edit:
I have a request... Is it possible to unload models(both sprites and codes) just like "load [modelname] 3" does? But I want it done immediately rather than ending a level.
And can we implement entities hit each other at the same time?

 
Hi everyone.  It might not be necessary to say this, but don't expect any progress on this stuff during the next week or so, as I'm very busy IRL.  I'm not disappearing or anything like that, and I will probably at least pop onto these forums occasionally during that time. :)
 
I hope you'll be alright there IRL. :)

I have to ask you something though, how do interpret the HRESULTs of the openborscript.c? I want to know for sure if the GIF functions that utunnels placed would work. Saw where he commited this (3418) and saw what is playgif's params (similar to animation in scenes) but I want to know the parameters to the other commands.
 
CRxTRDude said:
I hope you'll be alright there IRL. :)

Thanks!  I will try to get through okay. :)

CRxTRDude said:
I have to ask you something though, how do interpret the HRESULTs of the openborscript.c?

The way you interpret any HRESULT is that a function returning S_OK means it succeeded and returning E_FAIL means there was some error.
 
How about it's params? Apparently, the others don't have any params commented, so I don't know what it's supposed to be, what I interpret one of them though (playgif):

- there's an extern that defines the structure of the command with all its parameters
- check the parameters if they are present, else go to error
- sends the command over now to openbor.c, executing playgif().

Am I right with this sketchy knowledge? And how can I apply this knowledge in interpreting it to others like for openanigif that doesn't have a extern?
 
CRxTRDude said:
How about it's params? Apparently, the others don't have any params commented, so I don't know what it's supposed to be, what I interpret one of them though (playgif):

- there's an extern that defines the structure of the command with all its parameters
- check the parameters if they are present, else go to error
- sends the command over now to openbor.c

Am I right with this sketchy knowledge?

Yes, this is an accurate description of what it is doing.

CRxTRDude said:
And how can I apply this knowledge in interpreting it to others like for openanigif that doesn't have a extern?

Other functions don't need an extern like that because unlike openbor.c's
Code:
playgif
function, they are declared in included headers.

You just read the function carefully and look at what it is doing with the parameters.  For the case of openanigif:
Code:
if(varlist[0]->vt != VT_STR)
{
    goto openanigif_error;
}

Having this as the only parameter checking tells you that there is one parameter, and it is a string.  Now look at the next line referencing the parameter:

Code:
if(anigif_open(StrCache_Get(varlist[0]->strVal), packfile, info))

Here you can see it using the string parameter as the first parameter to the
Code:
anigif_open
function (declared in source/gamelib/anigif.h, implemented in anigif.c).  Now take a look at the declaration of that function in anigif.h:

Code:
// Returns true on succes
int anigif_open(char *filename, char *packfilename, anigif_info *info);

Now you can tell that the sole parameter to the
Code:
openanigif
script function is the path to the animated GIF file to open, such as
Code:
"data/scenes/myscene.gif"
.

*Edit* And to answer the question you didn't ask, how to tell the script function's return value, it's determined by these two lines:
Code:
ScriptVariant_ChangeType(*pretvar, VT_PTR);
(*pretvar)->ptrVal = (VOID *)info;

These two lines set the
Code:
openanigif
script function's return value to an animated GIF handle (
Code:
anigif_info*
) that can be passed to other functions, namely
Code:
decodeanigif
and
Code:
getanigifinfo
.
 
Plombo said:

I will take note of them when I can help with the documentation. Thanks!  :) Now, I can take a rest for tomorrow, I'm going to find out how those other fucntions work and I'll help in documenting them. Hope you got a good day there too Plombo, do stop by when you can.
 
Hello. Plombo.
I have a question.
I found loadsprite has 2 parameters: loadsprite(path,maskpath)
And I don't know how to make it work.
I tested the 2nd parameter and gave it a mask file.
But it didn't work properly... :'(

 
The parameter does not have a mask.

loadsprite(path)

~Load a single sprite from the path specified and return the handle for later use.
~You can free the sprite by calling script function free.
~Notice, the sprite will never be free automatically by the engine until the engine is about to shutdown so you have to keep the handle and free it manually later.
~Notice, the offset of the sprite will be always (0,0) like any regular icon and panel.
~Notice, the sprite is completely new, so if the path is used by an entity, there's not side effects if the entity model is unloaded.
 
Apparently loadsprite receives 2 parameters....

Code:
HRESULT openbor_loadsprite(ScriptVariant **varlist , ScriptVariant **pretvar, int paramCount)
{
    extern s_sprite *loadsprite2(char * filename, int * width, int * height);
    s_sprite *spr, *mask;
    if(paramCount < 1)
    {
        goto loadsprite_error;
    }

    if(varlist[0]->vt != VT_STR)
    {
        goto loadsprite_error;
    }

    ScriptVariant_ChangeType(*pretvar, VT_PTR);
    if((spr = loadsprite2(StrCache_Get(varlist[0]->strVal), NULL, NULL)))
    {
        (*pretvar)->ptrVal = (VOID *)spr;
        if(paramCount > 1 && (mask = loadsprite2(StrCache_Get(varlist[1]->strVal), NULL, NULL)))
        {
            spr->mask = mask;
        }
        List_InsertAfter(&scriptheap, (void *)spr, "openbor_loadsprite");
    }
    //else, it should return an empty value
    return S_OK;

loadsprite_error:
    printf("Function need a string parameter: loadsprite(path)\n");
    ScriptVariant_Clear(*pretvar);
    *pretvar = NULL;
    return E_FAIL;
}
 
You're for one thing right, it's implemented. It needs the sprite to be present first though before it sets a mask. I've checked the SVN and again, it's one of utunnels' undocumented things:

From revision 3968:
loadsprite now allows alpha mask.

How to use it, probably just add the image and the mask, probably the same size (the mask's dominant color should be the first color index like gifs) and now it loads it. You would then need to call it over and show it to the screen I think.
As an example, something in the lines of:

Code:
nikki = loadsprite(data\sprites\nikki.png, data\sprites\nikki_a.png).
 
CRxTRDude said:
You're for one thing right, it's implemented. It needs the sprite to be present first though before it sets a mask. I've checked the SVN and again, it's one of utunnels' undocumented things:

From revision 3968:
loadsprite now allows alpha mask.

How to use it, probably just add the image and the mask, probably the same size (the mask's dominant color should be the first color index like gifs) and now it loads it. You would then need to call it over and show it to the screen I think.
As an example, something in the lines of:

Code:
nikki = loadsprite(data\sprites\nikki.png, data\sprites\nikki_a.png).
Already tried that way, but no luck. sprites messed up...
 
Still busy, but found time to commit some work I'd already done.

As of r4096, you can now use alpha masks with level layers/backgrounds!  Here is a description of the new alphamask command:

Syntax of new command in level file:
    alphamask {path}

The alphamask command comes immediately before the command creating the layer that is to be masked. For reference, the following commands create layers: background, bglayer, fglayer, layer, water, frontpanel, panel

All of the details of alpha masking, such as the mask format, are the same for layers as they are for entities.  Of course, neither kind will be useful to most people until I get around to releasing that alpha mask generation tool. ::)

*Edit* As a bonus, the newly committed r4097 makes a one-line change to build.sh that greatly improves compilation time by using parallel make (i.e., making use of multiple CPU cores for compilation).
 
Back
Top Bottom