Solved Thank you, I would like to ask you my script

Question that is answered or resolved.

xyz555

Member
Thank you, I would like to ask you
my script

void spawnscale(void vName, float fX, float fY, float fZ ,void scale)
{
void self = getlocalvar("self");
void vSpawn;
int iDirection = getentityproperty(self, "direction");

clearspawnentry();
setspawnentry("name", vName);

if (iDirection ==0){
fX = -fX;
}

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();

changeentityproperty(vSpawn, "position", fX, fZ, fY);
changeentityproperty(self, "direction", iDirection);
setdrawmethod(vSpawn,1,scale,scale);

return vSpawn;
}





It can make the summoned props zoom in and out in different proportions
It is now able to run successfully

But I want to put it's scalex and scaley
separate processing

Pray for your help
I wish you a happy life and good health, thank you
 
So if you spawn this on a player character the thing becomes larger if you get close to the screen?

and what do you mean by separate?
do you want the thing to only scale when you get closer but not when going far back?
 
Thank you, I would like to ask you
my script

void spawnscale(void vName, float fX, float fY, float fZ ,void scale)
{
void self = getlocalvar("self");
void vSpawn;
int iDirection = getentityproperty(self, "direction");

clearspawnentry();
setspawnentry("name", vName);

if (iDirection ==0){
fX = -fX;
}

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();

changeentityproperty(vSpawn, "position", fX, fZ, fY);
changeentityproperty(self, "direction", iDirection);
setdrawmethod(vSpawn,1,scale,scale);

return vSpawn;
}





It can make the summoned props zoom in and out in different proportions
It is now able to run successfully

But I want to put it's scalex and scaley
separate processing

Pray for your help
I wish you a happy life and good health, thank you
Hello,
i hope
scalex horizontal zoom in and out
scaley zooms in and out vertically
They can be separated into two values, and each selects the required parameters to zoom in and out
Thank you😃😃
 
Hmmm... what about this:
C:
void spawnscale(void vName, float fX, float fY, float fZ , float scalex, float scaley)
{
  void self = getlocalvar("self");
  void vSpawn;
  int iDirection = getentityproperty(self, "direction");

  clearspawnentry();
  setspawnentry("name", vName);

  if(iDirection ==0){
    fX = -fX;
  }

  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();

  changeentityproperty(vSpawn, "position", fX, fZ, fY);
  changeentityproperty(vSpawn, "direction", iDirection);
  setdrawmethod(vSpawn, 1, scalex, scaley);

  return vSpawn;
}

Haven't tested it myself though.
 
Hmmm... what about this:
C:
void spawnscale(void vName, float fX, float fY, float fZ , float scalex, float scaley)
{
  void self = getlocalvar("self");
  void vSpawn;
  int iDirection = getentityproperty(self, "direction");

  clearspawnentry();
  setspawnentry("name", vName);

  if(iDirection ==0){
    fX = -fX;
  }

  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();

  changeentityproperty(vSpawn, "position", fX, fZ, fY);
  changeentityproperty(vSpawn, "direction", iDirection);
  setdrawmethod(vSpawn, 1, scalex, scaley);

  return vSpawn;
}

Haven't tested it myself though.
It's ok now !
Many thanks to Mr. Bloodbane for his help



Mr Bloodbane is a very generous teacher
I thank you very much and wish you good health and a happy life Thank you😃😃
 
Hmmm... what about this:
C:
void spawnscale(void vName, float fX, float fY, float fZ , float scalex, float scaley)
{
  void self = getlocalvar("self");
  void vSpawn;
  int iDirection = getentityproperty(self, "direction");

  clearspawnentry();
  setspawnentry("name", vName);

  if(iDirection ==0){
    fX = -fX;
  }

  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();

  changeentityproperty(vSpawn, "position", fX, fZ, fY);
  changeentityproperty(vSpawn, "direction", iDirection);
  setdrawmethod(vSpawn, 1, scalex, scaley);

  return vSpawn;
}

Haven't tested it myself though.
any way you could add alpha to this? when i use it , it works but the entities alpha gets disabled...i tried adding it from another script but...i suck lol thx
 
any way you could add alpha to this? when i use it , it works but the entities alpha gets disabled..

Hmm.... let me check that :)

[couple minutes later]

Yep, alpha setting of spawned object is overridden by the script :cautious:.
If you want to apply alpha, here's the updated function :cool::
C:
void spawnscale(void vName, float fX, float fY, float fZ , float scalex, float scaley, int alpha)
{
  void self = getlocalvar("self");
  void vSpawn;
  int iDirection = getentityproperty(self, "direction");

  clearspawnentry();
  setspawnentry("name", vName);

  if(iDirection ==0){
    fX = -fX;
  }

  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();

  changeentityproperty(vSpawn, "position", fX, fZ, fY);
  changeentityproperty(vSpawn, "direction", iDirection);
  setdrawmethod(vSpawn, 1, scalex, scaley, 0, 0, 0, alpha);

  return vSpawn;}

HTH
 
Last edited:
Hmm.... let me check that :)

[couple minutes later]

Yep, alpha setting of spawned object is overridden by the script :cautious:.
If you want to apply alpha, here's the updated function :cool::
C:
void spawnscale(void vName, float fX, float fY, float fZ , float scalex, float scaley, int alpha)
{
  void self = getlocalvar("self");
  void vSpawn;
  int iDirection = getentityproperty(self, "direction");

  clearspawnentry();
  setspawnentry("name", vName);

  if(iDirection ==0){
    fX = -fX;
  }

  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();

  changeentityproperty(vSpawn, "position", fX, fZ, fY);
  changeentityproperty(vSpawn, "direction", iDirection);
  setdrawmethod(vSpawn, 1, scalex, scaley, 0, 0, 0, alpha);

  return vSpawn;}

HTH
GDLK!!!
works great many thanks brother :)
 
Back
Top Bottom