Conflict using 2 scripts in character header

dantedevil

Well-known member
I have two scripts for use in my character hero.
This scripts are:
trailer.c
Code:
#include "data/scripts/trailer.h"

void main()
{
	int i, j, k;
	void spr;
	int facing, cd;
	float a, z, x;
	
	void ent = getlocalvar("self");
	int anim = getentityproperty(ent, "animationid");
	void map;
	int elapsed_time = openborvariant("elapsed_time");

	if(anim == openborconstant("ANI_FREESPECIAL5")){ map = getentityproperty(ent, "colourtable", 0);}
	if(anim == openborconstant("ANI_FOLLOW9")){ map = getentityproperty(ent, "colourtable", 0);}
	if(anim == openborconstant("ANI_FREESPECIAL13")){ map = getentityproperty(ent, "colourtable", 0);}
	if(anim == openborconstant("ANI_FREESPECIAL14")){ map = getentityproperty(ent, "colourtable", 0);}
	if(anim == openborconstant("ANI_FREESPECIAL16")){ map = getentityproperty(ent, "colourtable", 0);}
	setglobalvar("blahblah.map", map);


	if(elapsed_time%trailerd==0)
	{
		if((anim == openborconstant("ANI_FREESPECIAL5")) || (anim == openborconstant("ANI_FOLLOW9")) || (anim == openborconstant("ANI_FREESPECIAL13")) || (anim == openborconstant("ANI_FREESPECIAL14")) || (anim == openborconstant("ANI_FREESPECIAL16")))
		{
		spr = getentityproperty(ent, "sprite");
		x = getentityproperty(ent, "x");
		z = getentityproperty(ent, "z");
		a = getentityproperty(ent, "a");
		facing = !getentityproperty(ent, "direction");
		for(k=1; k<=trailermax; k++) //find an empty trailer slot
		{
			if(getglobalvar("trailer"+k+".s")==NULL())
			{
				setglobalvar("trailer"+k+".s", spr);
				setglobalvar("trailer"+k+".x", x);
				setglobalvar("trailer"+k+".z", z);
				setglobalvar("trailer"+k+".a", a);
				setglobalvar("trailer"+k+".f", facing);
				setglobalvar("trailer"+k+".c", trailerc*trailerd);
				break;
			}
		}
	}
	}
}

And bar.c
Code:
void main()
{
    int i; int z; int t;int health;int off;
    void pl;
	char cstring;
    if(openborvariant("in_level")==1)
    {
        z = openborconstant("FRONTPANEL_Z");
        for(i=0; i<3; i++)
        {
            pl = getplayerproperty(i, "ent");
            if(pl!=NULL())
            {
                void self = getlocalvar("self");
				void target = findtarget(self); 
				health = getentityproperty(target, "health");
				
			
			if (health<=20)// checks if the health is 20 or less and draws a red box
			{
				//drawbox(x, y, width, height, z, color, alpha)		
				drawbox(i*160+21, 37, health, 6, z+1000, rgbcolor(255,0,0));//health red

				
		}
            }
        }
    }
}

This is my character header:
Code:
name	MIDAS
health	100
speed	8
throw         2 3
type	player
grabdistance	45
shadow	0
gfxshadow  1
icon	data/chars/midas/icon.png
makeinv  1
holdblock 1
bflash block
fmap 2
jumpheight 3.5
mp 100
mprate	2
dust		dust
risetime 100
projectilehit   player obstacle
falldie 2
diesound   data/sounds/yuoh.wav
animationscript data/scripts/script.c 
onfallscript data/scripts/release.c
script data/chars/midas/trailer.c

This way works perfect all.
But can't find a way to put bar.c script in my character.

If set like this:
Code:
animationscript data/scripts/script.c 
onfallscript data/scripts/release.c
script data/chars/midas/trailer.c
script data/scripts/bar.c
The trailer.c nor work, only the bar.c.
If set the bar.c first and next trailer.c, only the last works again.
I try setting bar.c like this
Code:
ondrawscript data/scripts/bar.c
But nothing...

How can make to use this 2 scripts together?
 
Try this

#include "data/scripts/trailer.h"

void main()
{
int i, j, k;
void spr;
int facing, cd;
float a, z, x;

void ent = getlocalvar("self");
int anim = getentityproperty(ent, "animationid");
void map;
int elapsed_time = openborvariant("elapsed_time");

if(anim == openborconstant("ANI_FREESPECIAL5")){ map = getentityproperty(ent, "colourtable", 0);}
if(anim == openborconstant("ANI_FOLLOW9")){ map = getentityproperty(ent, "colourtable", 0);}
if(anim == openborconstant("ANI_FREESPECIAL13")){ map = getentityproperty(ent, "colourtable", 0);}
if(anim == openborconstant("ANI_FREESPECIAL14")){ map = getentityproperty(ent, "colourtable", 0);}
if(anim == openborconstant("ANI_FREESPECIAL16")){ map = getentityproperty(ent, "colourtable", 0);}
setglobalvar("blahblah.map", map);


if(elapsed_time%trailerd==0)
{
if((anim == openborconstant("ANI_FREESPECIAL5")) || (anim == openborconstant("ANI_FOLLOW9")) || (anim == openborconstant("ANI_FREESPECIAL13")) || (anim == openborconstant("ANI_FREESPECIAL14")) || (anim == openborconstant("ANI_FREESPECIAL16")))
{
spr = getentityproperty(ent, "sprite");
x = getentityproperty(ent, "x");
z = getentityproperty(ent, "z");
a = getentityproperty(ent, "a");
facing = !getentityproperty(ent, "direction");
for(k=1; k<=trailermax; k++) //find an empty trailer slot
{
if(getglobalvar("trailer"+k+".s")==NULL())
{
setglobalvar("trailer"+k+".s", spr);
setglobalvar("trailer"+k+".x", x);
setglobalvar("trailer"+k+".z", z);
setglobalvar("trailer"+k+".a", a);
setglobalvar("trailer"+k+".f", facing);
setglobalvar("trailer"+k+".c", trailerc*trailerd);
break;
}
}
}
}

int Bi; int Bz; int Bt;int Bhealth;int Boff;
    void Bpl;
if(openborvariant("in_level")==1)
    {
        Bz = openborconstant("FRONTPANEL_Z");
        for(Bi=0; Bi<3; Bi++)
        {
            Bpl = getplayerproperty(Bi, "ent");
            if(Bpl!=NULL())
            {
                void Bself = getlocalvar("self");
void Btarget = findtarget(Bself);
Bhealth = getentityproperty(Btarget, "health");


if (Bhealth<=20)// checks if the health is 20 or less and draws a red box
{
//drawbox(x, y, width, height, z, color, alpha)
drawbox(Bi*160+21, 37, Bhealth, 6, Bz+1000, rgbcolor(255,0,0));//health red


}
            }
        }
    }
}
 
Works great!

Thanks!!

Only one bug left:

if take an icon after the kill an enemy, the script red lifebar appear with 20 rest.
And only disappears if a new enemy comes.
 
Well my friend... can't make a exception for the items in the findtarget function properly.
I dont know  how make this script to works fine.
The bug is the last obstacle to make this works perfect, then a wanna make a fatality guide to share with all. Thanks to you of course.
 
Well... i try wiyh this and not work.
Code:
    int Bi; int Bz; int Bt;int Bhealth;int Boff;
    void Bpl;
   if(openborvariant("in_level")==1)
    {
        Bz = openborconstant("FRONTPANEL_Z");
        for(Bi=0; Bi<3; Bi++)
        {
            Bpl = getplayerproperty(Bi, "ent");
            if(Bpl!=NULL())
            {
                void Bself = getlocalvar("self");
            void Btarget = findtarget(Bself);
            Bhealth = getentityproperty(Btarget, "health");
           
         if (Bhealth<=20)// checks if the health is 20 or less and draws a red box
         {
            //drawbox(x, y, width, height, z, color, alpha)      
            drawbox(Bi*160+21, 37, Bhealth, 6, Bz+1000, rgbcolor(255,0,0));//health red


           void self = getlocalvar("self");
           void target = getlocalvar("Target" + self);

           if(target==NULL())
           {
             target = getentityproperty(self, "opponent");
             setlocalvar("Target" + self, target);
           }
           if(target!=NULL())
           {
             char Tname = getentityproperty(target, "defaultname");
             char iType = getentityproperty(target, "type");

("TYPE_OBSTACLE") || iType ==openborconstant("TYPE_ITEM"))
             {
                 changeentityproperty(self, "animation", openborconstant("ANI_FREESPECIAL15"));
             }
           }
        }
I dont know how include this function in the script, but i think this is the target function for this.
Right?
 
There is a problem on the code:
("TYPE_OBSTACLE") || iType ==openborconstant("TYPE_ITEM"))
            {
                changeentityproperty(self, "animation", openborconstant("ANI_FREESPECIAL15"));
            }

The synthax is wrong. try his

Code:
if (iType ==openborconstant ("TYPE_OBSTACLE") || iType ==openborconstant("TYPE_ITEM"))
             {
                 changeentityproperty(self, "animation", openborconstant("ANI_FREESPECIAL15"));
             }
 
Still crashing...
Code:
Total Ram: 2012463104 Bytes
 Free Ram: 1325080576 Bytes
 Used Ram: 1486848 Bytes

debug:nativeWidth, nativeHeight, bpp  1024, 768, 32
OpenBoR v3.0 Build 3854, Compile Date: Mar  4 2013

Game Selected: ./Paks/bor.pak

FileCaching System Init......	Disabled
Initializing video............
Reading video settings from 'data/video.txt'.
Initialized video.............	480x272 (Mode: 1, Depth: 16 Bit)

Loading menu.txt.............	Done!
Loading fonts................	1 2 3 4 Done!
Timer init...................	Done!
Initialize Sound..............	Done!
Loading sprites..............	Done!
Loading level order..........	Done!
Loading model constants......	Done!
Loading script settings......	Done!
Loading scripts..............	Done!
Loading models...............

Cacheing 'empty' from data/chars/misc/empty.txt
Cacheing 'Flash' from data/chars/misc/flash.txt
Cacheing 'bflash' from data/chars/misc/bflash.txt
Cacheing 'block' from data/chars/misc/block.txt
Cacheing 'bloody' from data/chars/misc/bloody.txt
Cacheing 'smoky' from data/chars/misc/smoky/smoky.txt
Cacheing 'elec' from data/chars/misc/elec.txt
Cacheing 'flami' from data/chars/misc/hitf/flami.txt
Cacheing 'flamy' from data/chars/misc/hitf/flamy.txt
Cacheing 'fireh' from data/chars/misc/hitf/fireh.txt
Cacheing 'dust' from data/chars/misc/dust.txt
Cacheing 'down' from data/chars/misc/down/down.txt
Cacheing 'quake' from data/chars/misc/quake.txt
Cacheing 'dash' from data/chars/misc/dash/dash.txt
Cacheing 'CAROLINA' from data/chars/caro/caro.txt
Cacheing 'KITANA' from data/chars/kitana/kitana.txt
Cacheing 'MIDAS' from data/chars/midas/midas.txt
Cacheing 'JAGO' from data/chars/jago/jago.txt
Cacheing 'BATMAN' from data/chars/batman/batman.txt
Cacheing 'TUSK' from data/chars/tusk/tusk.txt
Cacheing 'LIU_KANG' from data/chars/kang/kang.txt
Cacheing 'RAIDEN' from data/chars/raiden/raiden.txt
Cacheing 'BATMAN' from data/chars/batman/batman.txt
Cacheing 'bfatal' from data/chars/misc/bfatal.txt
Cacheing 'pspawn' from data/chars/misc/pspawn.txt
Cacheing 'pdeath' from data/chars/misc/pdeath/pdeath.txt
Cacheing 'fatal' from data/chars/misc/fatal.txt
Cacheing 'fat' from data/chars/misc/fat/fat.txt
Cacheing 'dino' from data/chars/tusk/dino/dino.txt
Cacheing 'magic' from data/chars/misc/magic.txt
Cacheing 'fmagic' from data/chars/misc/fmagic.txt
Cacheing 'carofl1' from data/chars/caro/flames/carofl1.txt
Cacheing 'carofl2' from data/chars/caro/flames/carofl2.txt
Cacheing 'carofl3' from data/chars/caro/flames/carofl3.txt
Cacheing 'carofl4' from data/chars/caro/flames/carofl4.txt
Cacheing 'carofl5' from data/chars/caro/flames/carofl5.txt
Cacheing 'carofl6' from data/chars/caro/flames/carofl6.txt
Cacheing 'cball' from data/chars/caro/flames/cball.txt
Cacheing 'elecsp' from data/chars/raiden/rays/elecsp.txt
Cacheing 'dragon' from data/chars/kang/acid/dragon.txt
Cacheing 'fdragon' from data/chars/kang/acid/fdragon.txt
Cacheing 'acid' from data/chars/kang/acid/acid.txt
Cacheing 'acid2' from data/chars/kang/acid/acid2.txt
Cacheing 'acid3' from data/chars/kang/acid/acid3.txt
Cacheing 'facid' from data/chars/misc/facid/facid.txt
Cacheing 'hurr' from data/chars/kitana/hurr/hurr.txt
Cacheing 'hurr2' from data/chars/kitana/hurr/hurr2.txt
Cacheing 'kair' from data/chars/kitana/hurr/kair.txt
Cacheing 'midsp' from data/chars/midas/midsp.txt
Cacheing 'grabm' from data/chars/midas/grabm.txt
Cacheing 'grabb' from data/chars/batman/grabb.txt
Cacheing 'bati' from data/chars/batman/bati/bati.txt
Cacheing 'ice0' from data/chars/batman/ice0.txt
Cacheing 'ice' from data/chars/batman/ice.txt
Cacheing 'batmovil' from data/chars/batman/batmovil/batmovil.txt
Cacheing 'hitobs' from data/chars/misc/hitobs.txt
Cacheing 'meteor' from data/chars/tusk/geys/meteor.txt
Cacheing 'meteor2' from data/chars/tusk/geys/meteor2.txt
Cacheing 'meteor3' from data/chars/tusk/geys/meteor3.txt
Cacheing 'shoto' from data/chars/caro/shoto.txt
Cacheing 'blade' from data/chars/kitana/blade.txt
Cacheing 'kball' from data/chars/kang/kball/kball.txt
Cacheing 'ray' from data/chars/raiden/rays/ray.txt
Cacheing 'ray2' from data/chars/raiden/rays/ray2.txt
Cacheing 'light0' from data/chars/raiden/rays/light0.txt
Cacheing 'light1' from data/chars/raiden/rays/light1.txt
Cacheing 'light2' from data/chars/raiden/rays/light2.txt
Cacheing 'light3' from data/chars/raiden/rays/light3.txt
Cacheing 'eroll' from data/chars/raiden/rays/eroll.txt
Cacheing 'gshock' from data/chars/raiden/rays/gshock.txt
Cacheing 'batrang' from data/chars/batman/batrang.txt
Cacheing 'batrang' from data/chars/batman/bats.txt
Cacheing 'batbomb' from data/chars/batman/batbomb.txt
Cacheing 'batfog' from data/chars/batman/batfog.txt
Cacheing 'fog' from data/chars/batman/fog.txt
Cacheing 'fog2' from data/chars/batman/fog2.txt
Cacheing 'escape' from data/chars/batman/escape.txt
Cacheing 'geys' from data/chars/tusk/geys/geys.txt
Cacheing 'fogo' from data/chars/tusk/geys/fogo.txt
Cacheing 'list_c' from data/chars/caro/list_c.txt
Cacheing 'list_ka' from data/chars/kang/list_ka.txt
Cacheing 'list_ki' from data/chars/kitana/list_ki.txt
Cacheing 'list_m' from data/chars/midas/list_m.txt
Cacheing 'list_b' from data/chars/raiden/list_r.txt
Cacheing 'list_b' from data/chars/batman/list_b.txt
Cacheing 'rockcar' from data/chars/caro/select/rockcar.txt
Cacheing 'rockcar2' from data/chars/caro/select/rockcar2.txt
Cacheing 'rockkit' from data/chars/kitana/select/rockkit.txt
Cacheing 'rockkit2' from data/chars/kitana/select/rockkit2.txt
Cacheing 'rockmid' from data/chars/midas/select/rockmid.txt
Cacheing 'rockmid2' from data/chars/midas/select/rockmid2.txt
Cacheing 'rockjag' from data/chars/jago/select/rockjag.txt
Cacheing 'rockjag2' from data/chars/jago/select/rockjag2.txt
Cacheing 'rocktus' from data/chars/tusk/select/rocktus.txt
Cacheing 'rocktus2' from data/chars/tusk/select/rocktus2.txt
Cacheing 'rockkan' from data/chars/kang/select/rockkan.txt
Cacheing 'rockkan2' from data/chars/kang/select/rockkan2.txt
Cacheing 'rockrai' from data/chars/raiden/select/rockrai.txt
Cacheing 'rockrai2' from data/chars/raiden/select/rockrai2.txt
Cacheing 'rockbat' from data/chars/batman/select/rockbat.txt
Cacheing 'EFlame' from data/chars/misc/xplos/eflame.txt
Cacheing 'wet' from data/chars/misc/wet.txt
Cacheing 'freef' from data/chars/misc/freef.txt
Cacheing 'splat' from data/chars/misc/splat.txt
Cacheing 'lifeup' from data/chars/misc/lifeup.txt
Cacheing 'lifeup2' from data/chars/misc/lifeup2.txt
Cacheing 'trash' from data/chars/misc/trash.txt
Cacheing 'AMAZON' from data/chars/amazon/amazon.txt
Cacheing 'AMAZON2' from data/chars/amazon/amazon2.txt
Cacheing 'AMAZONC' from data/chars/amazon/amazonc.txt
Cacheing 'AMAZONE' from data/chars/amazon/amazone.txt
Cacheing 'AMAZONF' from data/chars/amazon/amazonf.txt
Cacheing 'ARMOR' from data/chars/armor/armor.txt
Cacheing 'BIG_AMAZON' from data/chars/bamazon/bamazon.txt
Cacheing 'BANDIT' from data/chars/bandit/bandit.txt
Cacheing 'BANDIT1' from data/chars/bandit/bandit1.txt
Cacheing 'BARAKA' from data/chars/baraka/baraka.txt
Cacheing 'BLOOD' from data/chars/blood/blood.txt
Cacheing 'BREAKER' from data/chars/breaker/breaker.txt
Cacheing 'CHROME' from data/chars/chrome/chrome.txt
Cacheing 'CYBER_NINJA' from data/chars/cninja/cninja.txt
Cacheing 'EARTH' from data/chars/earth/earth.txt
Cacheing 'ELECTRO' from data/chars/electro/electro.txt
Cacheing 'ERMAC' from data/chars/ermac/ermac.txt
Cacheing 'FLAME' from data/chars/flame/flame.txt
Cacheing 'FROST' from data/chars/frost/frost.txt
Cacheing 'GHOST' from data/chars/ghost/ghost.txt
Cacheing 'GRAND_MASTER' from data/chars/gmaster/gmaster.txt
Cacheing 'GORO' from data/chars/goro/goro.txt
Cacheing 'KINTARO' from data/chars/kintaro/kintaro.txt
Cacheing 'MOTARO' from data/chars/motaro/motaro.txt
Cacheing 'SHAO_KAHN' from data/chars/shaokahn/shaokahn.txt
Cacheing 'soldierf' from data/chars/soldier/soldierf.txt
Cacheing 'kimokahn' from data/chars/kimokahn/kimokahn.txt
Cacheing 'bomby' from data/chars/amazon/bomby.txt
Cacheing 'bombyC' from data/chars/amazon/bombyf.txt
Cacheing 'bombye' from data/chars/amazon/bombye.txt
Cacheing 'bombyF' from data/chars/amazon/bombyc.txt
Cacheing 'knifer' from data/chars/misc/knifer.txt
Cacheing 'rock' from data/chars/earth/rock.txt
Cacheing 'rock2' from data/chars/earth/rock2.txt
Cacheing 'eball' from data/chars/ermac/eball.txt
Cacheing 'clone' from data/chars/frost/clone.txt
Cacheing 'fbomb' from data/chars/frost/fbomb.txt
Cacheing 'gorpun' from data/chars/goro/gorpun.txt
Cacheing 'kintb' from data/chars/kintaro/kintb.txt
Cacheing 'bomfire' from data/chars/soldier/bomfire.txt
Cacheing 'xpbomb' from data/chars/misc/bomb/xpbomb.txt
Cacheing 'trash' from data/chars/misc/trash.txt
Cacheing 'lifeup' from data/chars/misc/lifeup.txt
Cacheing 'lifeup2' from data/chars/misc/lifeup2.txt
Cacheing 'steamer' from data/chars/misc/steamer.txt
Cacheing 'steam' from data/chars/misc/steam.txt
Cacheing 'portal' from data/chars/misc/portal.txt

Loading 'Empty' from data/chars/misc/empty.txt
Loading 'Flash' from data/chars/misc/flash.txt
Loading 'bflash' from data/chars/misc/bflash.txt
Loading 'Block' from data/chars/misc/block.txt
Loading 'bloody' from data/chars/misc/bloody.txt
Loading 'smoky' from data/chars/misc/smoky/smoky.txt
Loading 'elec' from data/chars/misc/elec.txt
Loading 'flami' from data/chars/misc/hitf/flami.txt
Loading 'flamy' from data/chars/misc/hitf/flamy.txt
Loading 'fireh' from data/chars/misc/hitf/fireh.txt
Loading 'dust' from data/chars/misc/dust.txt
Loading 'Down' from data/chars/misc/down/down.txt
Loading 'Quake' from data/chars/misc/quake.txt
Loading 'Dash' from data/chars/misc/dash/dash.txt
Loading 'rockcar2' from data/chars/caro/select/rockcar2.txt
Loading 'rockcar' from data/chars/caro/select/rockcar.txt
Loading 'CAROLINA' from data/chars/caro/caro.txt
Loading 'rockkit2' from data/chars/kitana/select/rockkit2.txt
Loading 'rockkit' from data/chars/kitana/select/rockkit.txt
sound_load_sample can't load sample from file 'data/chars/kitana/yaa.wav'!
Loading 'KITANA' from data/chars/kitana/kitana.txt


Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'opt_else')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'stmt_list2')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'decl_list2')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'comp_stmt3')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'opt_else')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'stmt_list2')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'stmt_list2')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'opt_else')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'stmt_list2')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'decl_list2')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'decl_list2')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'decl_list2')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'decl_list2')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'decl_list2')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'decl_list2')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'decl_list2')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'decl_list2')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'decl_list2')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'decl_list2')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'decl_list2')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'decl_list2')


^



Script error: data/chars/midas/trailer.c, line 90: Unknown error '' (in production 'comp_stmt3')


^


********** An Error Occurred **********
*            Shutting Down            *

Failed to parse script file: 'data/chars/midas/trailer.c'!
Total Ram: 2012463104 Bytes
 Free Ram: 1321349120 Bytes
 Used Ram: 17752064 Bytes

Release level data...........	Done!
Release graphics data........	Done!
Release game data............


Release game data............	Done!
Release timer................	Done!
Release input hardware.......	Done!
Release sound system.........	Done!
Release FileCaching System...	Done!

**************** Done *****************

Failed to parse script file: 'data/chars/midas/trailer.c'!

Here the complete script with their update:
Code:
#include "data/scripts/trailer.h"


void main()
{
	int i, j, k;
	void spr;
	int facing, cd;
	float a, z, x;
	
	void ent = getlocalvar("self");
	int anim = getentityproperty(ent, 

"animationid");
	void map;
	int elapsed_time = openborvariant

("elapsed_time");

	if(anim == openborconstant

("ANI_FREESPECIAL5")){ map = getentityproperty(ent, 

"colourtable", 0);}
	if(anim == openborconstant("ANI_FOLLOW9")){ map 

= getentityproperty(ent, "colourtable", 0);}
	if(anim == openborconstant

("ANI_FREESPECIAL13")){ map = getentityproperty(ent, 

"colourtable", 0);}
	if(anim == openborconstant

("ANI_FREESPECIAL14")){ map = getentityproperty(ent, 

"colourtable", 0);}
	if(anim == openborconstant

("ANI_FREESPECIAL16")){ map = getentityproperty(ent, 

"colourtable", 0);}
	setglobalvar("blahblah.map", map);


	if(elapsed_time%trailerd==0)
	{
		if((anim == openborconstant

("ANI_FREESPECIAL5")) || (anim == openborconstant

("ANI_FOLLOW9")) || (anim == openborconstant

("ANI_FREESPECIAL13")) || (anim == openborconstant

("ANI_FREESPECIAL14")) || (anim == openborconstant

("ANI_FREESPECIAL16")))
		{
		spr = getentityproperty(ent, "sprite");
		x = getentityproperty(ent, "x");
		z = getentityproperty(ent, "z");
		a = getentityproperty(ent, "a");
		facing = !getentityproperty(ent, 

"direction");
		for(k=1; k<=trailermax; k++) //find an 

empty trailer slot
		{
			if(getglobalvar

("trailer"+k+".s")==NULL())
			{
				setglobalvar

("trailer"+k+".s", spr);
				setglobalvar

("trailer"+k+".x", x);
				setglobalvar

("trailer"+k+".z", z);
				setglobalvar

("trailer"+k+".a", a);
				setglobalvar

("trailer"+k+".f", facing);
				setglobalvar

("trailer"+k+".c", trailerc*trailerd);
				break;
			}
		}
	}
	}
    int Bi; int Bz; int Bt;int Bhealth;int Boff;
    void Bpl;
   if(openborvariant("in_level")==1)
    {
        Bz = openborconstant("FRONTPANEL_Z");
        for(Bi=0; Bi<3; Bi++)
        {
            Bpl = getplayerproperty(Bi, "ent");
            if(Bpl!=NULL())
            {
                void Bself = getlocalvar("self");
            void Btarget = findtarget(Bself);
            Bhealth = getentityproperty(Btarget, 

"health");
           
         if (Bhealth<=20)// checks if the health is 20 

or less and draws a red box
         {
            //drawbox(x, y, width, height, z, color, 

alpha)      
            drawbox(Bi*160+21, 37, Bhealth, 6, Bz+1000, 

rgbcolor(255,0,0));//health red


           void self = getlocalvar("self");
           void target = getlocalvar("Target" + self);

           if(target==NULL())
           {
             target = getentityproperty(self, 

"opponent");
             setlocalvar("Target" + self, target);
           }
           if(target!=NULL())
           {
             char Tname = getentityproperty(target, 

"defaultname");
             char iType = getentityproperty(target, 

"type");

if (iType ==openborconstant ("TYPE_OBSTACLE") || iType 

==openborconstant("TYPE_ITEM"))
             {
                 changeentityproperty(self, 

"animation", openborconstant("ANI_FREESPECIAL15"));
             }
           }
        }
 
That type of error happens when there are a non closed bracket. In your case, there are two "}" missing.

For editing C files, I strongly suggest you to use NOTEPAD++ since it has colored synthax and it will tell you where a bracket opens and closes

try this

Code:
void main()
{
	int i, j, k;
	void spr;
	int facing, cd;
	float a, z, x;
	
	void ent = getlocalvar("self");
	int anim = getentityproperty(ent, 

"animationid");
	void map;
	int elapsed_time = openborvariant

("elapsed_time");

	if(anim == openborconstant

("ANI_FREESPECIAL5")){ map = getentityproperty(ent, 

"colourtable", 0);}
	if(anim == openborconstant("ANI_FOLLOW9")){ map 

= getentityproperty(ent, "colourtable", 0);}
	if(anim == openborconstant

("ANI_FREESPECIAL13")){ map = getentityproperty(ent, 

"colourtable", 0);}
	if(anim == openborconstant

("ANI_FREESPECIAL14")){ map = getentityproperty(ent, 

"colourtable", 0);}
	if(anim == openborconstant

("ANI_FREESPECIAL16")){ map = getentityproperty(ent, 

"colourtable", 0);}
	setglobalvar("blahblah.map", map);


	if(elapsed_time%trailerd==0)
	{
		if((anim == openborconstant

("ANI_FREESPECIAL5")) || (anim == openborconstant

("ANI_FOLLOW9")) || (anim == openborconstant

("ANI_FREESPECIAL13")) || (anim == openborconstant

("ANI_FREESPECIAL14")) || (anim == openborconstant

("ANI_FREESPECIAL16")))
		{
		spr = getentityproperty(ent, "sprite");
		x = getentityproperty(ent, "x");
		z = getentityproperty(ent, "z");
		a = getentityproperty(ent, "a");
		facing = !getentityproperty(ent, 

"direction");
		for(k=1; k<=trailermax; k++) //find an 

empty trailer slot
		{
			if(getglobalvar

("trailer"+k+".s")==NULL())
			{
				setglobalvar

("trailer"+k+".s", spr);
				setglobalvar

("trailer"+k+".x", x);
				setglobalvar

("trailer"+k+".z", z);
				setglobalvar

("trailer"+k+".a", a);
				setglobalvar

("trailer"+k+".f", facing);
				setglobalvar

("trailer"+k+".c", trailerc*trailerd);
				break;
			}
		}
	}
	}
    int Bi; int Bz; int Bt;int Bhealth;int Boff;
    void Bpl;
   if(openborvariant("in_level")==1)
    {
        Bz = openborconstant("FRONTPANEL_Z");
        for(Bi=0; Bi<3; Bi++)
        {
            Bpl = getplayerproperty(Bi, "ent");
            if(Bpl!=NULL())
            {
                void Bself = getlocalvar("self");
            void Btarget = findtarget(Bself);
            Bhealth = getentityproperty(Btarget, 

"health");
           
         if (Bhealth<=20)// checks if the health is 20 

or less and draws a red box
         {
            //drawbox(x, y, width, height, z, color, 

alpha)      
            drawbox(Bi*160+21, 37, Bhealth, 6, Bz+1000, 

rgbcolor(255,0,0));//health red


           void self = getlocalvar("self");
           void target = getlocalvar("Target" + self);

           if(target==NULL())
           {
             target = getentityproperty(self, 

"opponent");
             setlocalvar("Target" + self, target);
           }
           if(target!=NULL())
           {
             char Tname = getentityproperty(target, 

"defaultname");
             char iType = getentityproperty(target, 

"type");

if (iType ==openborconstant ("TYPE_OBSTACLE") || iType 

==openborconstant("TYPE_ITEM"))
             {
                 changeentityproperty(self, 

"animation", openborconstant("ANI_FREESPECIAL15"));
             }
           }
        }
	}
}
 
Crash again...

Here the log:

Code:
Total Ram: 4294967295 Bytes
 Free Ram: 4264775680 Bytes
 Used Ram: 3411968 Bytes

debug:nativeWidth, nativeHeight, bpp  1360, 768, 32
OpenBoR v3.0 Build 3854, Compile Date: Mar  4 2013

Game Selected: ./Paks/bor.pak

FileCaching System Init......	Disabled
Initializing video............
Reading video settings from 'data/video.txt'.
Initialized video.............	480x272 (Mode: 1, Depth: 16 Bit)

Loading menu.txt.............	Done!
Loading fonts................	1 2 3 4 Done!
Timer init...................	Done!
Initialize Sound..............	Done!
Loading sprites..............	Done!
Loading level order..........	Done!
Loading model constants......	Done!
Loading script settings......	Done!
Loading scripts..............	Done!
Loading models...............

Cacheing 'empty' from data/chars/misc/empty.txt
Cacheing 'Flash' from data/chars/misc/flash.txt
Cacheing 'bflash' from data/chars/misc/bflash.txt
Cacheing 'block' from data/chars/misc/block.txt
Cacheing 'bloody' from data/chars/misc/bloody.txt
Cacheing 'smoky' from data/chars/misc/smoky/smoky.txt
Cacheing 'elec' from data/chars/misc/elec.txt
Cacheing 'flami' from data/chars/misc/hitf/flami.txt
Cacheing 'flamy' from data/chars/misc/hitf/flamy.txt
Cacheing 'fireh' from data/chars/misc/hitf/fireh.txt
Cacheing 'dust' from data/chars/misc/dust.txt
Cacheing 'down' from data/chars/misc/down/down.txt
Cacheing 'quake' from data/chars/misc/quake.txt
Cacheing 'dash' from data/chars/misc/dash/dash.txt
Cacheing 'CAROLINA' from data/chars/caro/caro.txt
Cacheing 'KITANA' from data/chars/kitana/kitana.txt
Cacheing 'MIDAS' from data/chars/midas/midas.txt
Cacheing 'JAGO' from data/chars/jago/jago.txt
Cacheing 'BATMAN' from data/chars/batman/batman.txt
Cacheing 'TUSK' from data/chars/tusk/tusk.txt
Cacheing 'LIU_KANG' from data/chars/kang/kang.txt
Cacheing 'RAIDEN' from data/chars/raiden/raiden.txt
Cacheing 'BATMAN' from data/chars/batman/batman.txt
Cacheing 'bfatal' from data/chars/misc/bfatal.txt
Cacheing 'pspawn' from data/chars/misc/pspawn.txt
Cacheing 'pdeath' from data/chars/misc/pdeath/pdeath.txt
Cacheing 'fatal' from data/chars/misc/fatal.txt
Cacheing 'fat' from data/chars/misc/fat/fat.txt
Cacheing 'dino' from data/chars/tusk/dino/dino.txt
Cacheing 'magic' from data/chars/misc/magic.txt
Cacheing 'fmagic' from data/chars/misc/fmagic.txt
Cacheing 'carofl1' from data/chars/caro/flames/carofl1.txt
Cacheing 'carofl2' from data/chars/caro/flames/carofl2.txt
Cacheing 'carofl3' from data/chars/caro/flames/carofl3.txt
Cacheing 'carofl4' from data/chars/caro/flames/carofl4.txt
Cacheing 'carofl5' from data/chars/caro/flames/carofl5.txt
Cacheing 'carofl6' from data/chars/caro/flames/carofl6.txt
Cacheing 'cball' from data/chars/caro/flames/cball.txt
Cacheing 'elecsp' from data/chars/raiden/rays/elecsp.txt
Cacheing 'dragon' from data/chars/kang/acid/dragon.txt
Cacheing 'fdragon' from data/chars/kang/acid/fdragon.txt
Cacheing 'acid' from data/chars/kang/acid/acid.txt
Cacheing 'acid2' from data/chars/kang/acid/acid2.txt
Cacheing 'acid3' from data/chars/kang/acid/acid3.txt
Cacheing 'facid' from data/chars/misc/facid/facid.txt
Cacheing 'hurr' from data/chars/kitana/hurr/hurr.txt
Cacheing 'hurr2' from data/chars/kitana/hurr/hurr2.txt
Cacheing 'kair' from data/chars/kitana/hurr/kair.txt
Cacheing 'midsp' from data/chars/midas/midsp.txt
Cacheing 'grabm' from data/chars/midas/grabm.txt
Cacheing 'grabb' from data/chars/batman/grabb.txt
Cacheing 'bati' from data/chars/batman/bati/bati.txt
Cacheing 'ice0' from data/chars/batman/ice0.txt
Cacheing 'ice' from data/chars/batman/ice.txt
Cacheing 'batmovil' from data/chars/batman/batmovil/batmovil.txt
Cacheing 'hitobs' from data/chars/misc/hitobs.txt
Cacheing 'meteor' from data/chars/tusk/geys/meteor.txt
Cacheing 'meteor2' from data/chars/tusk/geys/meteor2.txt
Cacheing 'meteor3' from data/chars/tusk/geys/meteor3.txt
Cacheing 'shoto' from data/chars/caro/shoto.txt
Cacheing 'blade' from data/chars/kitana/blade.txt
Cacheing 'kball' from data/chars/kang/kball/kball.txt
Cacheing 'ray' from data/chars/raiden/rays/ray.txt
Cacheing 'ray2' from data/chars/raiden/rays/ray2.txt
Cacheing 'light0' from data/chars/raiden/rays/light0.txt
Cacheing 'light1' from data/chars/raiden/rays/light1.txt
Cacheing 'light2' from data/chars/raiden/rays/light2.txt
Cacheing 'light3' from data/chars/raiden/rays/light3.txt
Cacheing 'eroll' from data/chars/raiden/rays/eroll.txt
Cacheing 'gshock' from data/chars/raiden/rays/gshock.txt
Cacheing 'batrang' from data/chars/batman/batrang.txt
Cacheing 'batrang' from data/chars/batman/bats.txt
Cacheing 'batbomb' from data/chars/batman/batbomb.txt
Cacheing 'batfog' from data/chars/batman/batfog.txt
Cacheing 'fog' from data/chars/batman/fog.txt
Cacheing 'fog2' from data/chars/batman/fog2.txt
Cacheing 'escape' from data/chars/batman/escape.txt
Cacheing 'geys' from data/chars/tusk/geys/geys.txt
Cacheing 'fogo' from data/chars/tusk/geys/fogo.txt
Cacheing 'list_c' from data/chars/caro/list_c.txt
Cacheing 'list_ka' from data/chars/kang/list_ka.txt
Cacheing 'list_ki' from data/chars/kitana/list_ki.txt
Cacheing 'list_m' from data/chars/midas/list_m.txt
Cacheing 'list_b' from data/chars/raiden/list_r.txt
Cacheing 'list_b' from data/chars/batman/list_b.txt
Cacheing 'rockcar' from data/chars/caro/select/rockcar.txt
Cacheing 'rockcar2' from data/chars/caro/select/rockcar2.txt
Cacheing 'rockkit' from data/chars/kitana/select/rockkit.txt
Cacheing 'rockkit2' from data/chars/kitana/select/rockkit2.txt
Cacheing 'rockmid' from data/chars/midas/select/rockmid.txt
Cacheing 'rockmid2' from data/chars/midas/select/rockmid2.txt
Cacheing 'rockjag' from data/chars/jago/select/rockjag.txt
Cacheing 'rockjag2' from data/chars/jago/select/rockjag2.txt
Cacheing 'rocktus' from data/chars/tusk/select/rocktus.txt
Cacheing 'rocktus2' from data/chars/tusk/select/rocktus2.txt
Cacheing 'rockkan' from data/chars/kang/select/rockkan.txt
Cacheing 'rockkan2' from data/chars/kang/select/rockkan2.txt
Cacheing 'rockrai' from data/chars/raiden/select/rockrai.txt
Cacheing 'rockrai2' from data/chars/raiden/select/rockrai2.txt
Cacheing 'rockbat' from data/chars/batman/select/rockbat.txt
Cacheing 'EFlame' from data/chars/misc/xplos/eflame.txt
Cacheing 'wet' from data/chars/misc/wet.txt
Cacheing 'freef' from data/chars/misc/freef.txt
Cacheing 'splat' from data/chars/misc/splat.txt
Cacheing 'lifeup' from data/chars/misc/lifeup.txt
Cacheing 'lifeup2' from data/chars/misc/lifeup2.txt
Cacheing 'trash' from data/chars/misc/trash.txt
Cacheing 'AMAZON' from data/chars/amazon/amazon.txt
Cacheing 'AMAZON2' from data/chars/amazon/amazon2.txt
Cacheing 'AMAZONC' from data/chars/amazon/amazonc.txt
Cacheing 'AMAZONE' from data/chars/amazon/amazone.txt
Cacheing 'AMAZONF' from data/chars/amazon/amazonf.txt
Cacheing 'ARMOR' from data/chars/armor/armor.txt
Cacheing 'BIG_AMAZON' from data/chars/bamazon/bamazon.txt
Cacheing 'BANDIT' from data/chars/bandit/bandit.txt
Cacheing 'BANDIT1' from data/chars/bandit/bandit1.txt
Cacheing 'BARAKA' from data/chars/baraka/baraka.txt
Cacheing 'BLOOD' from data/chars/blood/blood.txt
Cacheing 'BREAKER' from data/chars/breaker/breaker.txt
Cacheing 'CHROME' from data/chars/chrome/chrome.txt
Cacheing 'CYBER_NINJA' from data/chars/cninja/cninja.txt
Cacheing 'EARTH' from data/chars/earth/earth.txt
Cacheing 'ELECTRO' from data/chars/electro/electro.txt
Cacheing 'ERMAC' from data/chars/ermac/ermac.txt
Cacheing 'FLAME' from data/chars/flame/flame.txt
Cacheing 'FROST' from data/chars/frost/frost.txt
Cacheing 'GHOST' from data/chars/ghost/ghost.txt
Cacheing 'GRAND_MASTER' from data/chars/gmaster/gmaster.txt
Cacheing 'GORO' from data/chars/goro/goro.txt
Cacheing 'KINTARO' from data/chars/kintaro/kintaro.txt
Cacheing 'MOTARO' from data/chars/motaro/motaro.txt
Cacheing 'SHAO_KAHN' from data/chars/shaokahn/shaokahn.txt
Cacheing 'soldierf' from data/chars/soldier/soldierf.txt
Cacheing 'kimokahn' from data/chars/kimokahn/kimokahn.txt
Cacheing 'bomby' from data/chars/amazon/bomby.txt
Cacheing 'bombyC' from data/chars/amazon/bombyf.txt
Cacheing 'bombye' from data/chars/amazon/bombye.txt
Cacheing 'bombyF' from data/chars/amazon/bombyc.txt
Cacheing 'knifer' from data/chars/misc/knifer.txt
Cacheing 'rock' from data/chars/earth/rock.txt
Cacheing 'rock2' from data/chars/earth/rock2.txt
Cacheing 'eball' from data/chars/ermac/eball.txt
Cacheing 'clone' from data/chars/frost/clone.txt
Cacheing 'fbomb' from data/chars/frost/fbomb.txt
Cacheing 'gorpun' from data/chars/goro/gorpun.txt
Cacheing 'kintb' from data/chars/kintaro/kintb.txt
Cacheing 'bomfire' from data/chars/soldier/bomfire.txt
Cacheing 'xpbomb' from data/chars/misc/bomb/xpbomb.txt
Cacheing 'trash' from data/chars/misc/trash.txt
Cacheing 'lifeup' from data/chars/misc/lifeup.txt
Cacheing 'lifeup2' from data/chars/misc/lifeup2.txt
Cacheing 'steamer' from data/chars/misc/steamer.txt
Cacheing 'steam' from data/chars/misc/steam.txt
Cacheing 'portal' from data/chars/misc/portal.txt

Loading 'Empty' from data/chars/misc/empty.txt
Loading 'Flash' from data/chars/misc/flash.txt
Loading 'bflash' from data/chars/misc/bflash.txt
Loading 'Block' from data/chars/misc/block.txt
Loading 'bloody' from data/chars/misc/bloody.txt
Loading 'smoky' from data/chars/misc/smoky/smoky.txt
Loading 'elec' from data/chars/misc/elec.txt
Loading 'flami' from data/chars/misc/hitf/flami.txt
Loading 'flamy' from data/chars/misc/hitf/flamy.txt
Loading 'fireh' from data/chars/misc/hitf/fireh.txt
Loading 'dust' from data/chars/misc/dust.txt
Loading 'Down' from data/chars/misc/down/down.txt
Loading 'Quake' from data/chars/misc/quake.txt
Loading 'Dash' from data/chars/misc/dash/dash.txt
Loading 'rockcar2' from data/chars/caro/select/rockcar2.txt
Loading 'rockcar' from data/chars/caro/select/rockcar.txt
Loading 'CAROLINA' from data/chars/caro/caro.txt
Loading 'rockkit2' from data/chars/kitana/select/rockkit2.txt
Loading 'rockkit' from data/chars/kitana/select/rockkit.txt
sound_load_sample can't load sample from file 'data/chars/kitana/yaa.wav'!
Loading 'KITANA' from data/chars/kitana/kitana.txt


Script error: data/chars/midas/trailer.c, line 66: Invalid function call or expression 'trailer' (in production 'postfix_expr2')

empty trailer slot
      ^



Script error: data/chars/midas/trailer.c, line 70: Unknown error '==' (in production 'stmt_list2')

("trailer"+k+".s")==NULL())
                  ^



Script error: data/chars/midas/trailer.c, line 94: Invalid external declaration '}' (in production 'external_decl')

	}
    ^



Script error: data/chars/midas/trailer.c, line 97: Invalid external declaration 'if' (in production 'external_decl')

   if(openborvariant("in_level")==1)
   ^



Script error: data/chars/midas/trailer.c, line 107: Invalid external declaration 'Bhealth' (in production 'external_decl')

            Bhealth = getentityproperty(Btarget, 
            ^



Script error: data/chars/midas/trailer.c, line 126: Invalid external declaration 'if' (in production 'external_decl')

           if(target==NULL())
           ^



Script error: data/chars/midas/trailer.c, line 142: Invalid external declaration 'if' (in production 'external_decl')

if (iType ==openborconstant ("TYPE_OBSTACLE") || iType 
^


********** An Error Occurred **********
*            Shutting Down            *

Failed to parse script file: 'data/chars/midas/trailer.c'!
Total Ram: 4294967295 Bytes
 Free Ram: 4236394496 Bytes
 Used Ram: 39018496 Bytes

Release level data...........	Done!
Release graphics data........	Done!
Release game data............


Release game data............	Done!
Release timer................	Done!
Release input hardware.......	Done!
Release sound system.........	Done!
Release FileCaching System...	Done!

**************** Done *****************

Failed to parse script file: 'data/chars/midas/trailer.c'!
 
void main()
{
int i, j, k;
void spr;
int facing, cd;
float a, z, x;
void ent = getlocalvar("self");
int anim = getentityproperty(ent,"animationid");
void map;
int elapsed_time = openborvariant("elapsed_time");

if(anim == openborconstant("ANI_FREESPECIAL5")){ map = getentityproperty(ent,"colourtable", 0);}
if(anim == openborconstant("ANI_FOLLOW9")){ map = getentityproperty(ent, "colourtable", 0);}
if(anim == openborconstant("ANI_FREESPECIAL13")){ map = getentityproperty(ent,"colourtable", 0);}
if(anim == openborconstant("ANI_FREESPECIAL14")){ map = getentityproperty(ent,"colourtable", 0);}
if(anim == openborconstant("ANI_FREESPECIAL16")){ map = getentityproperty(ent,"colourtable", 0);}
setglobalvar("blahblah.map", map);


if(elapsed_time%trailerd==0)
{
if((anim == openborconstant("ANI_FREESPECIAL5")) || (anim == openborconstant("ANI_FOLLOW9")) || (anim == openborconstant("ANI_FREESPECIAL13")) || (anim == openborconstant("ANI_FREESPECIAL14")) || (anim == openborconstant("ANI_FREESPECIAL16")))
{
spr = getentityproperty(ent, "sprite");
x = getentityproperty(ent, "x");
z = getentityproperty(ent, "z");
a = getentityproperty(ent, "a");
facing = !getentityproperty(ent,"direction");
for(k=1; k<=trailermax; k++) //find anempty trailer slot
{
if(getglobalvar("trailer"+k+".s")==NULL())
{
setglobalvar("trailer"+k+".s", spr);
setglobalvar("trailer"+k+".x", x);
setglobalvar("trailer"+k+".z", z);
setglobalvar("trailer"+k+".a", a);
setglobalvar("trailer"+k+".f", facing);
setglobalvar("trailer"+k+".c", trailerc*trailerd);
break;
}
}
}
}
    int Bi; int Bz; int Bt;int Bhealth;int Boff;
    void Bpl;
  if(openborvariant("in_level")==1)
    {
        Bz = openborconstant("FRONTPANEL_Z");
        for(Bi=0; Bi<3; Bi++)
        {
            Bpl = getplayerproperty(Bi, "ent");
            if(Bpl!=NULL())
            {
                void Bself = getlocalvar("self");
            void Btarget = findtarget(Bself);
            Bhealth = getentityproperty(Btarget, "health");
         
        if (Bhealth<=20)// checks if the health is 20 or less and draws a red box
        {
            //drawbox(x, y, width, height, z, color, alpha)     
            drawbox(Bi*160+21, 37, Bhealth, 6, Bz+1000,rgbcolor(255,0,0));//health red

          void self = getlocalvar("self");
          void target = getlocalvar("Target" + self);

          if(target==NULL())
          {
            target = getentityproperty(self, "opponent");
            setlocalvar("Target" + self, target);
          }
          if(target!=NULL())
          {
            char Tname = getentityproperty(target, "defaultname");
            char iType = getentityproperty(target, "type");

if (iType ==openborconstant ("TYPE_OBSTACLE") || iType ==openborconstant("TYPE_ITEM"))
            {
                changeentityproperty(self, "animation", openborconstant("ANI_FREESPECIAL15"));
            }
          }
        }
}
}
 
Sorry, not work again!

Code:
Total Ram: 4294967295 Bytes
 Free Ram: 4294967295 Bytes
 Used Ram: 3424256 Bytes

debug:nativeWidth, nativeHeight, bpp  1360, 768, 32
OpenBoR v3.0 Build 3854, Compile Date: Mar  4 2013

Game Selected: ./Paks/bor.pak

FileCaching System Init......	Disabled
Initializing video............
Reading video settings from 'data/video.txt'.
Initialized video.............	480x272 (Mode: 1, Depth: 16 Bit)

Loading menu.txt.............	Done!
Loading fonts................	1 2 3 4 Done!
Timer init...................	Done!
Initialize Sound..............	Done!
Loading sprites..............	Done!
Loading level order..........	Done!
Loading model constants......	Done!
Loading script settings......	Done!
Loading scripts..............	Done!
Loading models...............

Cacheing 'empty' from data/chars/misc/empty.txt
Cacheing 'Flash' from data/chars/misc/flash.txt
Cacheing 'bflash' from data/chars/misc/bflash.txt
Cacheing 'block' from data/chars/misc/block.txt
Cacheing 'bloody' from data/chars/misc/bloody.txt
Cacheing 'smoky' from data/chars/misc/smoky/smoky.txt
Cacheing 'elec' from data/chars/misc/elec.txt
Cacheing 'flami' from data/chars/misc/hitf/flami.txt
Cacheing 'flamy' from data/chars/misc/hitf/flamy.txt
Cacheing 'fireh' from data/chars/misc/hitf/fireh.txt
Cacheing 'dust' from data/chars/misc/dust.txt
Cacheing 'down' from data/chars/misc/down/down.txt
Cacheing 'quake' from data/chars/misc/quake.txt
Cacheing 'dash' from data/chars/misc/dash/dash.txt
Cacheing 'CAROLINA' from data/chars/caro/caro.txt
Cacheing 'KITANA' from data/chars/kitana/kitana.txt
Cacheing 'MIDAS' from data/chars/midas/midas.txt
Cacheing 'JAGO' from data/chars/jago/jago.txt
Cacheing 'BATMAN' from data/chars/batman/batman.txt
Cacheing 'TUSK' from data/chars/tusk/tusk.txt
Cacheing 'LIU_KANG' from data/chars/kang/kang.txt
Cacheing 'RAIDEN' from data/chars/raiden/raiden.txt
Cacheing 'BATMAN' from data/chars/batman/batman.txt
Cacheing 'bfatal' from data/chars/misc/bfatal.txt
Cacheing 'pspawn' from data/chars/misc/pspawn.txt
Cacheing 'pdeath' from data/chars/misc/pdeath/pdeath.txt
Cacheing 'fatal' from data/chars/misc/fatal.txt
Cacheing 'fat' from data/chars/misc/fat/fat.txt
Cacheing 'dino' from data/chars/tusk/dino/dino.txt
Cacheing 'magic' from data/chars/misc/magic.txt
Cacheing 'fmagic' from data/chars/misc/fmagic.txt
Cacheing 'carofl1' from data/chars/caro/flames/carofl1.txt
Cacheing 'carofl2' from data/chars/caro/flames/carofl2.txt
Cacheing 'carofl3' from data/chars/caro/flames/carofl3.txt
Cacheing 'carofl4' from data/chars/caro/flames/carofl4.txt
Cacheing 'carofl5' from data/chars/caro/flames/carofl5.txt
Cacheing 'carofl6' from data/chars/caro/flames/carofl6.txt
Cacheing 'cball' from data/chars/caro/flames/cball.txt
Cacheing 'elecsp' from data/chars/raiden/rays/elecsp.txt
Cacheing 'dragon' from data/chars/kang/acid/dragon.txt
Cacheing 'fdragon' from data/chars/kang/acid/fdragon.txt
Cacheing 'acid' from data/chars/kang/acid/acid.txt
Cacheing 'acid2' from data/chars/kang/acid/acid2.txt
Cacheing 'acid3' from data/chars/kang/acid/acid3.txt
Cacheing 'facid' from data/chars/misc/facid/facid.txt
Cacheing 'hurr' from data/chars/kitana/hurr/hurr.txt
Cacheing 'hurr2' from data/chars/kitana/hurr/hurr2.txt
Cacheing 'kair' from data/chars/kitana/hurr/kair.txt
Cacheing 'midsp' from data/chars/midas/midsp.txt
Cacheing 'grabm' from data/chars/midas/grabm.txt
Cacheing 'grabb' from data/chars/batman/grabb.txt
Cacheing 'bati' from data/chars/batman/bati/bati.txt
Cacheing 'ice0' from data/chars/batman/ice0.txt
Cacheing 'ice' from data/chars/batman/ice.txt
Cacheing 'batmovil' from data/chars/batman/batmovil/batmovil.txt
Cacheing 'hitobs' from data/chars/misc/hitobs.txt
Cacheing 'meteor' from data/chars/tusk/geys/meteor.txt
Cacheing 'meteor2' from data/chars/tusk/geys/meteor2.txt
Cacheing 'meteor3' from data/chars/tusk/geys/meteor3.txt
Cacheing 'shoto' from data/chars/caro/shoto.txt
Cacheing 'blade' from data/chars/kitana/blade.txt
Cacheing 'kball' from data/chars/kang/kball/kball.txt
Cacheing 'ray' from data/chars/raiden/rays/ray.txt
Cacheing 'ray2' from data/chars/raiden/rays/ray2.txt
Cacheing 'light0' from data/chars/raiden/rays/light0.txt
Cacheing 'light1' from data/chars/raiden/rays/light1.txt
Cacheing 'light2' from data/chars/raiden/rays/light2.txt
Cacheing 'light3' from data/chars/raiden/rays/light3.txt
Cacheing 'eroll' from data/chars/raiden/rays/eroll.txt
Cacheing 'gshock' from data/chars/raiden/rays/gshock.txt
Cacheing 'batrang' from data/chars/batman/batrang.txt
Cacheing 'batrang' from data/chars/batman/bats.txt
Cacheing 'batbomb' from data/chars/batman/batbomb.txt
Cacheing 'batfog' from data/chars/batman/batfog.txt
Cacheing 'fog' from data/chars/batman/fog.txt
Cacheing 'fog2' from data/chars/batman/fog2.txt
Cacheing 'escape' from data/chars/batman/escape.txt
Cacheing 'geys' from data/chars/tusk/geys/geys.txt
Cacheing 'fogo' from data/chars/tusk/geys/fogo.txt
Cacheing 'list_c' from data/chars/caro/list_c.txt
Cacheing 'list_ka' from data/chars/kang/list_ka.txt
Cacheing 'list_ki' from data/chars/kitana/list_ki.txt
Cacheing 'list_m' from data/chars/midas/list_m.txt
Cacheing 'list_b' from data/chars/raiden/list_r.txt
Cacheing 'list_b' from data/chars/batman/list_b.txt
Cacheing 'rockcar' from data/chars/caro/select/rockcar.txt
Cacheing 'rockcar2' from data/chars/caro/select/rockcar2.txt
Cacheing 'rockkit' from data/chars/kitana/select/rockkit.txt
Cacheing 'rockkit2' from data/chars/kitana/select/rockkit2.txt
Cacheing 'rockmid' from data/chars/midas/select/rockmid.txt
Cacheing 'rockmid2' from data/chars/midas/select/rockmid2.txt
Cacheing 'rockjag' from data/chars/jago/select/rockjag.txt
Cacheing 'rockjag2' from data/chars/jago/select/rockjag2.txt
Cacheing 'rocktus' from data/chars/tusk/select/rocktus.txt
Cacheing 'rocktus2' from data/chars/tusk/select/rocktus2.txt
Cacheing 'rockkan' from data/chars/kang/select/rockkan.txt
Cacheing 'rockkan2' from data/chars/kang/select/rockkan2.txt
Cacheing 'rockrai' from data/chars/raiden/select/rockrai.txt
Cacheing 'rockrai2' from data/chars/raiden/select/rockrai2.txt
Cacheing 'rockbat' from data/chars/batman/select/rockbat.txt
Cacheing 'EFlame' from data/chars/misc/xplos/eflame.txt
Cacheing 'wet' from data/chars/misc/wet.txt
Cacheing 'freef' from data/chars/misc/freef.txt
Cacheing 'splat' from data/chars/misc/splat.txt
Cacheing 'lifeup' from data/chars/misc/lifeup.txt
Cacheing 'lifeup2' from data/chars/misc/lifeup2.txt
Cacheing 'trash' from data/chars/misc/trash.txt
Cacheing 'AMAZON' from data/chars/amazon/amazon.txt
Cacheing 'AMAZON2' from data/chars/amazon/amazon2.txt
Cacheing 'AMAZONC' from data/chars/amazon/amazonc.txt
Cacheing 'AMAZONE' from data/chars/amazon/amazone.txt
Cacheing 'AMAZONF' from data/chars/amazon/amazonf.txt
Cacheing 'ARMOR' from data/chars/armor/armor.txt
Cacheing 'BIG_AMAZON' from data/chars/bamazon/bamazon.txt
Cacheing 'BANDIT' from data/chars/bandit/bandit.txt
Cacheing 'BANDIT1' from data/chars/bandit/bandit1.txt
Cacheing 'BARAKA' from data/chars/baraka/baraka.txt
Cacheing 'BLOOD' from data/chars/blood/blood.txt
Cacheing 'BREAKER' from data/chars/breaker/breaker.txt
Cacheing 'CHROME' from data/chars/chrome/chrome.txt
Cacheing 'CYBER_NINJA' from data/chars/cninja/cninja.txt
Cacheing 'EARTH' from data/chars/earth/earth.txt
Cacheing 'ELECTRO' from data/chars/electro/electro.txt
Cacheing 'ERMAC' from data/chars/ermac/ermac.txt
Cacheing 'FLAME' from data/chars/flame/flame.txt
Cacheing 'FROST' from data/chars/frost/frost.txt
Cacheing 'GHOST' from data/chars/ghost/ghost.txt
Cacheing 'GRAND_MASTER' from data/chars/gmaster/gmaster.txt
Cacheing 'GORO' from data/chars/goro/goro.txt
Cacheing 'KINTARO' from data/chars/kintaro/kintaro.txt
Cacheing 'MOTARO' from data/chars/motaro/motaro.txt
Cacheing 'SHAO_KAHN' from data/chars/shaokahn/shaokahn.txt
Cacheing 'soldierf' from data/chars/soldier/soldierf.txt
Cacheing 'kimokahn' from data/chars/kimokahn/kimokahn.txt
Cacheing 'bomby' from data/chars/amazon/bomby.txt
Cacheing 'bombyC' from data/chars/amazon/bombyf.txt
Cacheing 'bombye' from data/chars/amazon/bombye.txt
Cacheing 'bombyF' from data/chars/amazon/bombyc.txt
Cacheing 'knifer' from data/chars/misc/knifer.txt
Cacheing 'rock' from data/chars/earth/rock.txt
Cacheing 'rock2' from data/chars/earth/rock2.txt
Cacheing 'eball' from data/chars/ermac/eball.txt
Cacheing 'clone' from data/chars/frost/clone.txt
Cacheing 'fbomb' from data/chars/frost/fbomb.txt
Cacheing 'gorpun' from data/chars/goro/gorpun.txt
Cacheing 'kintb' from data/chars/kintaro/kintb.txt
Cacheing 'bomfire' from data/chars/soldier/bomfire.txt
Cacheing 'xpbomb' from data/chars/misc/bomb/xpbomb.txt
Cacheing 'trash' from data/chars/misc/trash.txt
Cacheing 'lifeup' from data/chars/misc/lifeup.txt
Cacheing 'lifeup2' from data/chars/misc/lifeup2.txt
Cacheing 'steamer' from data/chars/misc/steamer.txt
Cacheing 'steam' from data/chars/misc/steam.txt
Cacheing 'portal' from data/chars/misc/portal.txt

Loading 'Empty' from data/chars/misc/empty.txt
Loading 'Flash' from data/chars/misc/flash.txt
Loading 'bflash' from data/chars/misc/bflash.txt
Loading 'Block' from data/chars/misc/block.txt
Loading 'bloody' from data/chars/misc/bloody.txt
Loading 'smoky' from data/chars/misc/smoky/smoky.txt
Loading 'elec' from data/chars/misc/elec.txt
Loading 'flami' from data/chars/misc/hitf/flami.txt
Loading 'flamy' from data/chars/misc/hitf/flamy.txt
Loading 'fireh' from data/chars/misc/hitf/fireh.txt
Loading 'dust' from data/chars/misc/dust.txt
Loading 'Down' from data/chars/misc/down/down.txt
Loading 'Quake' from data/chars/misc/quake.txt
Loading 'Dash' from data/chars/misc/dash/dash.txt
Loading 'rockcar2' from data/chars/caro/select/rockcar2.txt
Loading 'rockcar' from data/chars/caro/select/rockcar.txt
Loading 'CAROLINA' from data/chars/caro/caro.txt
Loading 'rockkit2' from data/chars/kitana/select/rockkit2.txt
Loading 'rockkit' from data/chars/kitana/select/rockkit.txt
Loading 'KITANA' from data/chars/kitana/kitana.txt


Script error: data/chars/midas/trailer.c, line 83: Unknown error '' (in production 'stmt_list2')

}
 ^



Script error: data/chars/midas/trailer.c, line 83: Unknown error '' (in production 'opt_else')

}
 ^



Script error: data/chars/midas/trailer.c, line 83: Unknown error '' (in production 'stmt_list2')

}
 ^



Script error: data/chars/midas/trailer.c, line 83: Unknown error '' (in production 'decl_list2')

}
 ^



Script error: data/chars/midas/trailer.c, line 83: Unknown error '' (in production 'decl_list2')

}
 ^



Script error: data/chars/midas/trailer.c, line 83: Unknown error '' (in production 'decl_list2')

}
 ^



Script error: data/chars/midas/trailer.c, line 83: Unknown error '' (in production 'decl_list2')

}
 ^



Script error: data/chars/midas/trailer.c, line 83: Unknown error '' (in production 'decl_list2')

}
 ^



Script error: data/chars/midas/trailer.c, line 83: Unknown error '' (in production 'decl_list2')

}
 ^



Script error: data/chars/midas/trailer.c, line 83: Unknown error '' (in production 'decl_list2')

}
 ^



Script error: data/chars/midas/trailer.c, line 83: Unknown error '' (in production 'decl_list2')

}
 ^



Script error: data/chars/midas/trailer.c, line 83: Unknown error '' (in production 'decl_list2')

}
 ^



Script error: data/chars/midas/trailer.c, line 83: Unknown error '' (in production 'decl_list2')

}
 ^



Script error: data/chars/midas/trailer.c, line 83: Unknown error '' (in production 'decl_list2')

}
 ^



Script error: data/chars/midas/trailer.c, line 83: Unknown error '' (in production 'decl_list2')

}
 ^



Script error: data/chars/midas/trailer.c, line 83: Unknown error '' (in production 'comp_stmt3')

}
 ^


********** An Error Occurred **********
*            Shutting Down            *

Failed to parse script file: 'data/chars/midas/trailer.c'!
Total Ram: 4294967295 Bytes
 Free Ram: 4294967295 Bytes
 Used Ram: 39317504 Bytes

Release level data...........	Done!
Release graphics data........	Done!
Release game data............


Release game data............	Done!
Release timer................	Done!
Release input hardware.......	Done!
Release sound system.........	Done!
Release FileCaching System...	Done!

**************** Done *****************

Failed to parse script file: 'data/chars/midas/trailer.c'!
 
That kind of error is a synthax error. Its easy to fix, once you find the erroneous synthax.
But I double checked it and I can't find.

edit: ah, remove the last "}" from the code, I think is the problem.

or not. There are 17 opening Curly braces (not brackets), but 15 closing ones. They need to be equal.

Try this:

void main()
{
  int i, j, k;
  void spr;
  int facing, cd;
  float a, z, x;
  void ent = getlocalvar("self");
  int anim = getentityproperty(ent,"animationid");
  void map;
  int elapsed_time = openborvariant("elapsed_time");

  if(anim == openborconstant("ANI_FREESPECIAL5")){ map = getentityproperty(ent,"colourtable", 0);}
  if(anim == openborconstant("ANI_FOLLOW9")){ map = getentityproperty(ent, "colourtable", 0);}
  if(anim == openborconstant("ANI_FREESPECIAL13")){ map = getentityproperty(ent,"colourtable", 0);}
  if(anim == openborconstant("ANI_FREESPECIAL14")){ map = getentityproperty(ent,"colourtable", 0);}
  if(anim == openborconstant("ANI_FREESPECIAL16")){ map = getentityproperty(ent,"colourtable", 0);}
  setglobalvar("blahblah.map", map);


  if(elapsed_time%trailerd==0)
  {
      if((anim == openborconstant("ANI_FREESPECIAL5")) || (anim == openborconstant("ANI_FOLLOW9")) || (anim == openborconstant("ANI_FREESPECIAL13")) || (anim == openborconstant("ANI_FREESPECIAL14")) || (anim == openborconstant("ANI_FREESPECIAL16")))
      {
      spr = getentityproperty(ent, "sprite");
      x = getentityproperty(ent, "x");
      z = getentityproperty(ent, "z");
      a = getentityproperty(ent, "a");
      facing = !getentityproperty(ent,"direction");
      for(k=1; k<=trailermax; k++) //find anempty trailer slot
{
        if(getglobalvar("trailer"+k+".s")==NULL())
{
            setglobalvar("trailer"+k+".s", spr);
            setglobalvar("trailer"+k+".x", x);
            setglobalvar("trailer"+k+".z", z);
            setglobalvar("trailer"+k+".a", a);
            setglobalvar("trailer"+k+".f", facing);
            setglobalvar("trailer"+k+".c", trailerc*trailerd);
            break;
}
}
  }
  }
    int Bi; int Bz; int Bt;int Bhealth;int Boff;
    void Bpl;
  if(openborvariant("in_level")==1)
    {
        Bz = openborconstant("FRONTPANEL_Z");
        for(Bi=0; Bi<3; Bi++)
        {
            Bpl = getplayerproperty(Bi, "ent");
            if(Bpl!=NULL())
            {
                void Bself = getlocalvar("self");
            void Btarget = findtarget(Bself);
            Bhealth = getentityproperty(Btarget, "health");
         
        if (Bhealth<=20)// checks if the health is 20 or less and draws a red box
{
            //drawbox(x, y, width, height, z, color, alpha)     
            drawbox(Bi*160+21, 37, Bhealth, 6, Bz+1000,rgbcolor(255,0,0));//health red

          void self = getlocalvar("self");
          void target = getlocalvar("Target" + self);

          if(target==NULL())
{
            target = getentityproperty(self, "opponent");
            setlocalvar("Target" + self, target);
}
          if(target!=NULL())
{
            char Tname = getentityproperty(target, "defaultname");
            char iType = getentityproperty(target, "type");

if (iType ==openborconstant ("TYPE_OBSTACLE") || iType ==openborconstant("TYPE_ITEM"))
{
                changeentityproperty(self, "animation", openborconstant("ANI_FREESPECIAL15"));
}
}
}
     
}
}
}
}
 
Well, finally not crash!.

But the bus still present.

The idea is when the player take a icon, item, etc, the red bar never appears.
Only when attacks enemies.

I try to make the script using the findtarget function like you say me, using parts of other script.
But i think lost the right way right?
 
Have you tried this command?

nolife {bi}

~Determines whether or not the player can see the entity's life when they make contact.
0 = they CAN see it. Defaults to 0.
1 = they CANNOT see it.
 
Back
Top Bottom