GarMod, do this:
Do you have a file with your scripts? if no, you will need one. OpenBOR can do things in two ways - by the using shortcuts to functions hard coded into the engine (kinda like when you use "throwframe" to shoot a "knife", the engine spawns a new entity - what we call Helper in Mugen - and use it as a projectile, without any line of code); Or OpenBOR can use a C-based language scripts to expand and even create features not possible in other way. Mugen can't do this (well, it can by using Lua scripts, but there is no documentation about it yet. Some developers doesn't like to document things *joke*, lol)
1- create a file called, for example, "myscripts.c" and place it under the "scripts" folder.
2- put this code on that file and save it - its a function I've adpated from Damon Caskey
Code:
void spawn01map(void vName, float fX, float fY, float fZ)
{
//spawn01 (Generic spawner)
//Damon Vaughn Caskey + Douglas Baldan
//07/06/2007
//
//Spawns entity next to caller.
//
//vName: Model name of entity to be spawned in.
//fX: X location adjustment.
//fZ: Y location adjustment.
//fY: Z location adjustment.
void self = getlocalvar("self"); //Get calling entity.
int iMap = getentityproperty(self, "map"); // Get caller's remap.
void vSpawn; //Spawn object.
int iDirection = getentityproperty(self, "direction");
clearspawnentry(); //Clear current spawn entry.
setspawnentry("name", vName); //Acquire spawn entity by name.
if (iDirection == 0){ //Is entity facing left?
fX = -fX; //Reverse X direction to match facing.
}
fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
vSpawn = spawn(); //Spawn in entity.
changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location.
changeentityproperty(vSpawn, "direction", iDirection); //Set direction.
changeentityproperty(vSpawn, "map", iMap); //Set map.
return vSpawn; //Return spawn.
}
Dunno how much you understand from coding logic, so just focus on this line:
void
spawn01map(void
vName, float
fX, float
fY, float
fZ)
This means that we will
call a function named spawn01map (its CASE SENSITIVE) which will wait for 4 values -
"vName" is the name of the entity who will be called (the name should be between quotes),
fX is the the X position (related to the caller,like "pos = p1" in Mugen),
fY is the Y position related to the caller (the engines uses the Y value in
different ways) and
fZ is the Z position related to the caller (we don't have Z anymore in mugen, as you may know).
3 - at your character header, put this:
animationscript data/scripts/myscript.c
If the character already have a "animationscript", just copy that code I gave and paste into the animationscript file the character is using.
Usage:
@cmd spawn01map "vfree" 0 0 0
So I am calling the function to spawn the "vfree" entity, at 0 0 0 positions - in other words, in the same position the caller is. The function will change the map (palette) of the entity to the same palette its caller is using. But for this to work, both need to have the same palettes at the same positions on their headers, like this:
in Vision.txt header
palette data/chars/vision/palnew1.png
alternatepal data/chars/vision/original.png
alternatepal data/chars/vision/white.png
alternatepal data/chars/vision/VISION_SMARTPAL_V5_PAL_EURTH.png
alternatepal data/chars/vision/BEASTIE_MAP2.png
alternatepal data/chars/vision/palwc.png
alternatepal data/chars/vision/freeze.png
alternatepal data/chars/vision/venon.png
in vfree.txt header
palette data/chars/vision/palnew1.png
alternatepal data/chars/vision/original.png
alternatepal data/chars/vision/white.png
alternatepal data/chars/vision/VISION_SMARTPAL_V5_PAL_EURTH.png
alternatepal data/chars/vision/BEASTIE_MAP2.png
alternatepal data/chars/vision/palwc.png
alternatepal data/chars/vision/freeze.png
alternatepal data/chars/vision/venon.png
This is how I used that code:
anim freespecial2
loop 0
delay 7
offset 243 270
fastattack 1
Energycost 10 1 0
hitflash flash3
hitfx data/sounds/robohit1.wav
jumpframe 12 2 1 0
frame data/chars/vision/att401.png
bbox 0 0 0 0
attack 0 0 0 0 0 0 0 0 0 0
@cmd spawn01 "sdust" 0 0 0
frame data/chars/vision/fall200.png
bbox 0 0 0 0
@cmd spawn01map "vfree" 0 0 0
delay 40
move 10
sound data/chars/vision/sound/phase1.wav
frame data/chars/vision/blast/empty.png
Sorry for my crap english, I hope you understand what I said