I'm curious to know what are the x,y and Z values because I think It maybe useful for me.
- The weapon item entity moves to a hidden location in the level (a hardcoded Z position where the camera can't show it).
I'm curious to know what are the x,y and Z values because I think It maybe useful for me.
Awesome and thank you!X and Y don't change, so effectively they're the item's current position. Z is 100,000.
DC
What is the name of the default weapon drop sound effect?
Thank you
I noticed whenever my character transforms into the EX mode (weaponframe), and after I quit the game and came back, the z value of the stage is screwed up as my character can walk off the screen. I could not figure out the cause of it. Now I just saw this Z is 100,000? I did not see it mentioned in the manual or how to change it. How can I change this value for weaponframe function? Thank youX and Y don't change, so effectively they're the item's current position. Z is 100,000.
DC
anim follow4
loop 0
offset 140 143
delay 1
frame data/chars/helicopter/idle2a.gif
delay 240
@cmd dasher 0 -0.5 0 1
frame data/chars/helicopter/idle2a.gif
@cmd dasher 0 0 0 1
@cmd SpawnEnemyWieldingWeapon "Bryan_" 0 0 0 0 "Tube" # I think in something like this
frame data/chars/helicopter/idle2a.gif
delay 240
@cmd dasher 0 -0.5 0 1
frame data/chars/helicopter/idle2a.gif
#import "data/scripts/animationscripts/spawn/spawn.c"
void SpawnEnemyWieldingWeapon(void vName, float fX, float fY, float fZ, int parent, void weapon)
{
void self = getlocalvar("self"); //Get calling entity.
void vSpawn; //Spawn object.
void spawnWeapon;
int WeapNumber;
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.
spawnWeapon = spawn01(weapon, fX, fY, 0);
changeentityproperty(spawnWeapon, "x", getentityproperty(vSpawn, "x"));
changeentityproperty(spawnWeapon, "y", getentityproperty(vSpawn, "y"));
changeentityproperty(spawnWeapon, "z", openborconstant("ITEM_HIDE_POSITION_Z"));
changeentityproperty(spawnWeapon, "spawntype", openborconstant("SPAWN_TYPE_WEAPON"));
changeentityproperty(vSpawn, "weapon_item", spawnWeapon);
WeapNumber = getentityproperty(spawnWeapon, "weapnum");
changeentityproperty(vSpawn, "weapon", WeapNumber);
if(parent==1){
void CandamageP = getentityproperty(self, "candamage");
void HostileP = getentityproperty(self, "candamage");
changeentityproperty(vSpawn, "candamage", CandamageP);
changeentityproperty(vSpawn, "hostile", HostileP);
}
return vSpawn; //Return spawn.
}
But the log throws me "Can't find openbor constant 'ITEM_HIDE_POSITION_Z' " What I should use instead?
#define WEAPON_ITEM_HIDDEN_POS_Z 100000
When working with weapons, at least in 3.0, they doesn't use spawnscript because there isn't a spawn to begin with - the change happens instantly.But where I have to apply each those scripts? in animationscript? onspawnscript? ondrawscript?
onmodelcopyscript {path}
This command defines which script is run when entity change its model (weapon). This should be used in weapon models whenever you have spawn scripts since there is no spawn in weapon models.
==For script coding reference==
self: Caller (the new model).
old: previous model.
void old = getlocalvar("old");
void self = getlocalvar("self");