switch from wander to chase

ABK

Well-known member
I want to add some behaviour to enemies and when i wont hit anyone they have wander aimove but when i hit one of them then all enemies that are facing direction opposite from mine will switch to chasez and will start to attack me, where is the best place to include script ?I think it needs variable ?
I want it to be activated in pain or fall animation of enemies and deactivated when all enemies onscreen are dead so if i go forward then new group of enemies will have wander setting again.
 
If you want all enemies to act in the same way, use didhitscript and go through the entity list to change all enemies on screen.



int i;
void e;
int max = openborvariant("ent_max");

for(i=0; i<max; i++)
{
  e = getentity(i);
  if(getentityproperty(e, "exists") && getentityproperty(e, "type")==openborconstant("TYPE_ENEMY"))
  {
    changeentityproperty(e, "aimove", openborconstant("AIMOVE1_CHASEZ"));
  }
}



Although most likely you need to filter out some enemies.
 
Thanks, Id like them to react only if they see me hitting someone so they have to be facing direction opposite than mine.
By the way where is complete script manual, i used some stuff like "candamage" in script but theres no such thing mentioned in manual here:

http://www.chronocrash.com/forum/index.php?topic=11.0

so does anyone have complete script with all possible variants and vaules to control?
 
It'll be a long list.
I don't know if someone has made a list, if you can maybe you can check the openborscript.c

 
ok i have the source :) anyway it would be nice to have the list anyway no matter how long it is cause sometimes i gave up on ideas after checking whats available to control by script and this list is much longer than whats posted in script reference.
Ill post some myself for the future reference
Code:
"a",
"aggression",
"aiattack",
"aiflag",
"aimove",
"alpha",
"animal",
"animating",
"animation",
"animationid",
"animheight",
"animhits",
"animnum",
"animpos",
"animvalid",
"antigrab",
"antigravity",
"attack",
"attackid",
"attacking",
"attackthrottle",
"attackthrottletime",
"autokill",
"base",
"bbox",
"blink",
"blockback",
"blockodds",
"blockpain",
"boss",
"bounce",
"bound",
"candamage",
"chargerate",
"colourmap",
"colourtable",
"combostep",
"combotime",
"damage_on_landing",
"dead",
"defaultmodel",
"defaultname",
"defense",
"detect",
"direction",
"dot",
"dropframe",
"edelay",
"energycost",
"escapecount",
"escapehits",
"exists",
"falldie",
"flash",
"freezetime",
"frozen",
"gfxshadow",
"grabbing",
"grabforce",
"guardpoints",
"health",
"height",
"hitbyid",
"hmapl",
"hmapu",
"hostile",
"icon",
"iconposition",
"invincible",
"invinctime",
"jugglepoints",
"jumpheight",
"knockdowncount",
"komap",
"landframe",
"lifeposition",
"lifespancountdown",
"link",
"map",
"mapcount",
"mapdefault",
"maps",
"maptime",
"maxguardpoints",
"maxhealth",
"maxjugglepoints",
"maxmp",
"model",
"mp",
"mpdroprate",
"mprate",
"mpset",
"mpstable",
"mpstableval",
"name",
"nameposition",
"nextanim",
"nextthink",
"no_adjust_base",
"noaicontrol",
"nodieblink",
"nodrop",
"nograb",
"nolife",
"nopain",
"offense",
"opponent",
"owner",
"pain_time",
"parent",
"path",
"pathfindstep",
"playerindex",
"position",
"projectile",
"projectilehit",
"range",
"releasetime",
"running",
"rush_count",
"rush_tally",
"rush_time",
"score",
"scroll",
"seal",
"sealtime",
"setlayer",
"spawntype",
"speed",
"sprite",
"spritea",
"stalltime",
"stats",
"staydown",
"staydownatk",
"stealth",
"subentity",
"subject_to_gravity",
"subject_to_hole",
"subject_to_maxz",
"subject_to_minz",
"subject_to_obstacle",
"subject_to_platform",
"subject_to_screen",
"subject_to_wall",
"subtype",
"takeaction",
"think",
"thold",
"throwdamage",
"throwdist",
"throwframewait",
"throwheight",
"tosstime",
"tossv",
"trymove",
"type",
"velocity",
"vulnerable",
"weapent",
"weapon",
"x",
"xdir",
"z",
"zdir", 
-----------------------
static const char* eplist_aiflag[] = {
"animating",
"attacking",
"autokill",
"blink",
"blocking",
"charging",
"dead",
"drop",
"falling",
"frozen",
"getting",
"idlemode",
"idling",
"inpain",
"invincible",
"jumpid",
"jumping",
"projectile",
"running",
"toexplode",
"turning",
"walking",
"walkmode",
};
static const char* eplist_attack[] = {
"blast",
"blockflash",
"blocksound",
"coords",
"counterattack",
"direction",
"dol",
"dot",
"dotforce",
"dotindex",
"dotrate",
"dottime",
"drop",
"dropv",
"force",
"forcemap",
"freeze",
"freezetime",
"grab",
"grabdistance",
"guardcost",
"hitflash",
"hitsound",
"jugglecost",
"maptime",
"noblock",
"noflash",
"nokill",
"nopain",
"otg",
"pause",
"reset",
"seal",
"sealtime",
"staydown",
"steal",
"type",
}; 
--------------------
	IICMPCONST(COMPATIBLEVERSION)
ICMPCONST(MIN_INT)
ICMPCONST(MAX_INT)
ICMPCONST(PIXEL_8)
ICMPCONST(PIXEL_x8)
ICMPCONST(PIXEL_16)
ICMPCONST(PIXEL_32)
ICMPCONST(CV_SAVED_GAME)
ICMPCONST(CV_HIGH_SCORE)
ICMPCONST(THINK_SPEED)
ICMPCONST(COUNTER_SPEED)
ICMPCONST(MAX_ENTS)
ICMPCONST(MAX_PANELS)
ICMPCONST(MAX_WEAPONS)
ICMPCONST(MAX_COLOUR_MAPS)
ICMPCONST(MAX_NAME_LEN)
ICMPCONST(LEVEL_MAX_SPAWNS)
ICMPCONST(LEVEL_MAX_PANELS)
ICMPCONST(LEVEL_MAX_HOLES)
ICMPCONST(LEVEL_MAX_WALLS)
ICMPCONST(MAX_LEVELS)
ICMPCONST(MAX_DIFFICULTIES)
ICMPCONST(MAX_SPECIALS)
ICMPCONST(MAX_ATCHAIN)
ICMPCONST(MAX_ATTACKS)
ICMPCONST(MAX_FOLLOWS)
ICMPCONST(MAX_PLAYERS)
ICMPCONST(MAX_ARG_LEN)
ICMPCONST(FLAG_ESC)
ICMPCONST(FLAG_START)
ICMPCONST(FLAG_MOVELEFT)
ICMPCONST(FLAG_MOVERIGHT)
ICMPCONST(FLAG_MOVEUP)
ICMPCONST(FLAG_MOVEDOWN)
ICMPCONST(FLAG_ATTACK)
ICMPCONST(FLAG_ATTACK2)
ICMPCONST(FLAG_ATTACK3)
ICMPCONST(FLAG_ATTACK4)
ICMPCONST(FLAG_JUMP)
ICMPCONST(FLAG_SPECIAL)
ICMPCONST(FLAG_SCREENSHOT)
ICMPCONST(FLAG_ANYBUTTON)
ICMPCONST(FLAG_FORWARD)
ICMPCONST(FLAG_BACKWARD)
ICMPCONST(SDID_MOVEUP)
ICMPCONST(SDID_MOVEDOWN)
ICMPCONST(SDID_MOVELEFT)
ICMPCONST(SDID_MOVERIGHT)
ICMPCONST(SDID_SPECIAL)
ICMPCONST(SDID_ATTACK)
ICMPCONST(SDID_ATTACK2)
ICMPCONST(SDID_ATTACK3)
ICMPCONST(SDID_ATTACK4)
ICMPCONST(SDID_JUMP)
ICMPCONST(SDID_START)
ICMPCONST(SDID_SCREENSHOT)
ICMPCONST(TYPE_NONE)
ICMPCONST(TYPE_PLAYER)
ICMPCONST(TYPE_ENEMY)
ICMPCONST(TYPE_ITEM)
ICMPCONST(TYPE_OBSTACLE)
ICMPCONST(TYPE_STEAMER)
ICMPCONST(TYPE_SHOT)
ICMPCONST(TYPE_TRAP)
ICMPCONST(TYPE_TEXTBOX)
ICMPCONST(TYPE_ENDLEVEL)
ICMPCONST(TYPE_NPC)
ICMPCONST(TYPE_PANEL)
ICMPCONST(TYPE_RESERVED)
ICMPCONST(SUBTYPE_NONE)
ICMPCONST(SUBTYPE_BIKER)
ICMPCONST(SUBTYPE_NOTGRAB)
ICMPCONST(SUBTYPE_ARROW)
ICMPCONST(SUBTYPE_TOUCH)
ICMPCONST(SUBTYPE_WEAPON)
ICMPCONST(SUBTYPE_NOSKIP)
ICMPCONST(SUBTYPE_FLYDIE)
ICMPCONST(SUBTYPE_BOTH)
ICMPCONST(SUBTYPE_PROJECTILE)
ICMPCONST(SUBTYPE_FOLLOW)
ICMPCONST(SUBTYPE_CHASE)
ICMPCONST(AIMOVE1_NORMAL)
ICMPCONST(AIMOVE1_CHASE)
ICMPCONST(AIMOVE1_CHASEZ)
ICMPCONST(AIMOVE1_CHASEX)
ICMPCONST(AIMOVE1_AVOID)
ICMPCONST(AIMOVE1_AVOIDZ)
ICMPCONST(AIMOVE1_AVOIDX)
ICMPCONST(AIMOVE1_WANDER)
ICMPCONST(AIMOVE1_NOMOVE)
ICMPCONST(AIMOVE1_BIKER)
ICMPCONST(AIMOVE1_STAR)
ICMPCONST(AIMOVE1_ARROW)
ICMPCONST(AIMOVE1_BOMB)
ICMPCONST(AIMOVE2_NORMAL)
ICMPCONST(AIMOVE2_IGNOREHOLES)
ICMPCONST(AIATTACK1_NORMAL)
ICMPCONST(AIATTACK1_LONG)
ICMPCONST(AIATTACK1_MELEE)
ICMPCONST(AIATTACK1_NOATTACK)
ICMPCONST(AIATTACK1_ALWAYS)
ICMPCONST(AIATTACK2_NORMAL)
ICMPCONST(AIATTACK2_DODGE)
ICMPCONST(AIATTACK2_DODGEMOVE)
ICMPCONST(FRONTPANEL_Z)
ICMPCONST(HOLE_Z)
ICMPCONST(NEONPANEL_Z)
ICMPCONST(SHADOW_Z)
ICMPCONST(SCREENPANEL_Z)
ICMPCONST(PANEL_Z)
ICMPCONST(MIRROR_Z)
ICMPCONST(PIT_DEPTH)
ICMPCONST(P2_STATS_DIST)
ICMPCONST(CONTACT_DIST_H)
ICMPCONST(CONTACT_DIST_V)
ICMPCONST(GRAB_DIST)
ICMPCONST(GRAB_STALL)
ICMPCONST(ATK_NORMAL)
ICMPCONST(ATK_NORMAL2)
ICMPCONST(ATK_NORMAL3)
ICMPCONST(ATK_NORMAL4)
ICMPCONST(ATK_BLAST)
ICMPCONST(ATK_BURN)
ICMPCONST(ATK_FREEZE)
ICMPCONST(ATK_SHOCK)
ICMPCONST(ATK_STEAL)
ICMPCONST(ATK_NORMAL5)
ICMPCONST(ATK_NORMAL6)
ICMPCONST(ATK_NORMAL7)
ICMPCONST(ATK_NORMAL8)
ICMPCONST(ATK_NORMAL9)
ICMPCONST(ATK_NORMAL10)
ICMPCONST(ATK_ITEM)
ICMPCONST(ATK_LAND)
ICMPCONST(ATK_PIT)
ICMPCONST(ATK_LIFESPAN)
ICMPCONST(ATK_TIMEOVER)
ICMPCONST(SCROLL_RIGHT)
ICMPCONST(SCROLL_DOWN)
ICMPCONST(SCROLL_LEFT)
ICMPCONST(SCROLL_UP)
ICMPCONST(SCROLL_BOTH)
ICMPCONST(SCROLL_LEFTRIGHT)
ICMPCONST(SCROLL_RIGHTLEFT)
ICMPCONST(SCROLL_INWARD)
ICMPCONST(SCROLL_OUTWARD)
ICMPCONST(SCROLL_INOUT)
ICMPCONST(SCROLL_OUTIN)
ICMPCONST(SCROLL_UPWARD)
ICMPCONST(SCROLL_DOWNWARD)
ICMPCONST(ANI_IDLE)
ICMPCONST(ANI_WALK)
ICMPCONST(ANI_JUMP)
ICMPCONST(ANI_LAND)
ICMPCONST(ANI_PAIN)
ICMPCONST(ANI_FALL)
ICMPCONST(ANI_RISE)
ICMPCONST(ANI_UPPER)
ICMPCONST(ANI_BLOCK)
ICMPCONST(ANI_JUMPATTACK)
ICMPCONST(ANI_JUMPATTACK2)
ICMPCONST(ANI_GET)
ICMPCONST(ANI_GRAB)
ICMPCONST(ANI_GRABATTACK)
ICMPCONST(ANI_GRABATTACK2)
ICMPCONST(ANI_THROW)
ICMPCONST(ANI_SPECIAL)
ICMPCONST(ANI_SPAWN)
ICMPCONST(ANI_DIE)
ICMPCONST(ANI_PICK)
ICMPCONST(ANI_JUMPATTACK3)
ICMPCONST(ANI_UP)
ICMPCONST(ANI_DOWN)
ICMPCONST(ANI_SHOCK)
ICMPCONST(ANI_BURN)
ICMPCONST(ANI_SHOCKPAIN)
ICMPCONST(ANI_BURNPAIN)
ICMPCONST(ANI_GRABBED)
ICMPCONST(ANI_SPECIAL2)
ICMPCONST(ANI_RUN)
ICMPCONST(ANI_RUNATTACK)
ICMPCONST(ANI_RUNJUMPATTACK)
ICMPCONST(ANI_ATTACKUP)
ICMPCONST(ANI_ATTACKDOWN)
ICMPCONST(ANI_ATTACKFORWARD)
ICMPCONST(ANI_ATTACKBACKWARD)
ICMPCONST(ANI_RISEATTACK)
ICMPCONST(ANI_DODGE)
ICMPCONST(ANI_ATTACKBOTH)
ICMPCONST(ANI_GRABFORWARD)
ICMPCONST(ANI_GRABFORWARD2)
ICMPCONST(ANI_JUMPFORWARD)
ICMPCONST(ANI_GRABDOWN)
ICMPCONST(ANI_GRABDOWN2)
ICMPCONST(ANI_GRABUP)
ICMPCONST(ANI_GRABUP2)
ICMPCONST(ANI_SELECT)
ICMPCONST(ANI_DUCK)
ICMPCONST(ANI_FAINT)
ICMPCONST(ANI_CANT)
ICMPCONST(ANI_THROWATTACK)
ICMPCONST(ANI_CHARGEATTACK)
ICMPCONST(ANI_VAULT)
ICMPCONST(ANI_JUMPCANT)
ICMPCONST(ANI_JUMPSPECIAL)
ICMPCONST(ANI_BURNDIE)
ICMPCONST(ANI_SHOCKDIE)
ICMPCONST(ANI_PAIN2)
ICMPCONST(ANI_PAIN3)
ICMPCONST(ANI_PAIN4)
ICMPCONST(ANI_FALL2)
ICMPCONST(ANI_FALL3)
ICMPCONST(ANI_FALL4)
ICMPCONST(ANI_DIE2)
ICMPCONST(ANI_DIE3)
ICMPCONST(ANI_DIE4)
ICMPCONST(ANI_CHARGE)
ICMPCONST(ANI_BACKWALK)
ICMPCONST(ANI_SLEEP)
ICMPCONST(ANI_PAIN5)
ICMPCONST(ANI_PAIN6)
ICMPCONST(ANI_PAIN7)
ICMPCONST(ANI_PAIN8)
ICMPCONST(ANI_PAIN9)
ICMPCONST(ANI_PAIN10)
ICMPCONST(ANI_FALL5)
ICMPCONST(ANI_FALL6)
ICMPCONST(ANI_FALL7)
ICMPCONST(ANI_FALL8)
ICMPCONST(ANI_FALL9)
ICMPCONST(ANI_FALL10)
ICMPCONST(ANI_DIE5)
ICMPCONST(ANI_DIE6)
ICMPCONST(ANI_DIE7)
ICMPCONST(ANI_DIE8)
ICMPCONST(ANI_DIE9)
ICMPCONST(ANI_DIE10)
ICMPCONST(ANI_TURN)
ICMPCONST(ANI_RESPAWN)
ICMPCONST(ANI_FORWARDJUMP)
ICMPCONST(ANI_RUNJUMP)
ICMPCONST(ANI_JUMPLAND)
ICMPCONST(ANI_JUMPDELAY)
ICMPCONST(ANI_HITWALL)
ICMPCONST(ANI_GRABBACKWARD)
ICMPCONST(ANI_GRABBACKWARD2)
ICMPCONST(ANI_GRABWALK)
ICMPCONST(ANI_GRABBEDWALK)
ICMPCONST(ANI_GRABWALKUP)
ICMPCONST(ANI_GRABBEDWALKUP)
ICMPCONST(ANI_GRABWALKDOWN)
ICMPCONST(ANI_GRABBEDWALKDOWN)
ICMPCONST(ANI_GRABTURN)
ICMPCONST(ANI_GRABBEDTURN)
ICMPCONST(ANI_GRABBACKWALK)
ICMPCONST(ANI_GRABBEDBACKWALK)
ICMPCONST(ANI_SLIDE)
ICMPCONST(ANI_RUNSLIDE)
ICMPCONST(ANI_BLOCKPAIN)
ICMPCONST(ANI_DUCKATTACK)
ICMPCONST(MAX_ANIS)
ICMPCONST(PLAYER_MIN_Z)
ICMPCONST(PLAYER_MAX_Z)
ICMPCONST(BGHEIGHT)
ICMPCONST(MAX_WALL_HEIGHT)
ICMPCONST(SAMPLE_GO)
ICMPCONST(SAMPLE_BEAT)
ICMPCONST(SAMPLE_BLOCK)
ICMPCONST(SAMPLE_INDIRECT)
ICMPCONST(SAMPLE_GET)
ICMPCONST(SAMPLE_GET2)
ICMPCONST(SAMPLE_FALL)
ICMPCONST(SAMPLE_JUMP)
ICMPCONST(SAMPLE_PUNCH)
ICMPCONST(SAMPLE_1UP)
ICMPCONST(SAMPLE_TIMEOVER)
ICMPCONST(SAMPLE_BEEP)
ICMPCONST(SAMPLE_BEEP2)
ICMPCONST(SAMPLE_BIKE)
ICMPCONST(ANI_RISE2)
ICMPCONST(ANI_RISE3)
ICMPCONST(ANI_RISE4)
ICMPCONST(ANI_RISE5)
ICMPCONST(ANI_RISE6)
ICMPCONST(ANI_RISE7)
ICMPCONST(ANI_RISE8)
ICMPCONST(ANI_RISE9)
ICMPCONST(ANI_RISE10)
ICMPCONST(ANI_RISEB)
ICMPCONST(ANI_RISES)
ICMPCONST(ANI_BLOCKPAIN2)
ICMPCONST(ANI_BLOCKPAIN3)
ICMPCONST(ANI_BLOCKPAIN4)
ICMPCONST(ANI_BLOCKPAIN5)
ICMPCONST(ANI_BLOCKPAIN6)
ICMPCONST(ANI_BLOCKPAIN7)
ICMPCONST(ANI_BLOCKPAIN8)
ICMPCONST(ANI_BLOCKPAIN9)
ICMPCONST(ANI_BLOCKPAIN10)
ICMPCONST(ANI_BLOCKPAINB)
ICMPCONST(ANI_BLOCKPAINS)
ICMPCONST(ANI_CHIPDEATH)
ICMPCONST(ANI_GUARDBREAK)
ICMPCONST(ANI_RISEATTACK2)
ICMPCONST(ANI_RISEATTACK3)
ICMPCONST(ANI_RISEATTACK4)
ICMPCONST(ANI_RISEATTACK5)
ICMPCONST(ANI_RISEATTACK6)
ICMPCONST(ANI_RISEATTACK7)
ICMPCONST(ANI_RISEATTACK8)
ICMPCONST(ANI_RISEATTACK9)
ICMPCONST(ANI_RISEATTACK10)
ICMPCONST(ANI_RISEATTACKB)
ICMPCONST(ANI_RISEATTACKS)
ICMPCONST(ANI_SLIDE)
ICMPCONST(ANI_RUNSLIDE)
ICMPCONST(ANI_DUCKATTACK)
ICMPCONST(ANI_WALKOFF)
ICMPCONST(ANI_FREESPECIAL)
// for the extra animation ids
ICMPSCONSTC(ATK_NORMAL)
ICMPSCONSTA(ANI_DOWN, animdowns)
ICMPSCONSTA(ANI_UP, animups)
ICMPSCONSTA(ANI_BACKWALK, animbackwalks)
ICMPSCONSTA(ANI_WALK, animwalks)
ICMPSCONSTA(ANI_IDLE, animidles)
ICMPSCONSTB(ANI_FALL, animfalls)
ICMPSCONSTB(ANI_RISE, animrises)
ICMPSCONSTB(ANI_RISEATTACK, animriseattacks)
ICMPSCONSTB(ANI_PAIN, animpains)
ICMPSCONSTB(ANI_DIE, animdies)
ICMPSCONSTA(ANI_ATTACK, animattacks)
ICMPSCONSTA(ANI_FOLLOW, animfollows)
ICMPSCONSTA(ANI_FREESPECIAL, animspecials)
And http://sourceforge.net/p/openbor/engine/3854/tree/engine/openborscript.c
 
why its causing engine to crash? Something wrong here?
Code:
                void self = getlocalvar("self");
		if(frame == 1){
	changeentityproperty(self,"subtype", openborconstant("SUBTYPE_CHASE"));
		}
	@end_script
 
Because subtype is currently read-only, it has been added to changeentityproperty though you can get it. So stick on ai currently.

;D
 
but my enemies dont run when im using aimove , they only run as subtype chase and when they are subtype chase from the beginning then they ignore aimove wander.
 
yeah it works, chasez was causing it to not run ?
I have another problem, how to move the "press start"? shouldnt it be in the same place where points are by default ? i setup my hud and positions of lifebars to custom resolution 400x240 but "press start" position is not editable ?
YZdumsK.png

Qer4kPM.png
 
bWWd said:
I have another problem, how to move the "press start"? shouldnt it be in the same place where points are by default ? i setup my hud and positions of lifebars to custom resolution 400x240 but "press start" position is not editable ?

It's another setting: p{#}namej.

DC
 
By the way, what happened with this command?
Loading level order.......... invalid loadingbg type -1!

Its not recognized anymore ? i also cant change placement of "loading" text
 
Back
Top Bottom