UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

rotating brushes in game

broken avatar :(
Created 11 years ago
by codmoddd1234
0 Members and 1 Guest are viewing this topic.
1,915 views
broken avatar :(
×
broken avatar :(
Location: kh
Date Registered: 9 August 2013
Last active: 5 years ago
Posts
503
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
×
codmoddd1234's Groups
codmoddd1234's Contact & Social Links
/*
1)
include the entry at the very bottom of these instructions a blank gsc and rename the gsc rotate
copy and paste
Code Snippet
Plaintext
maps\rotate::main();
under
Code Snippet
Plaintext
zombiemode::main();
in your mapname gsc

include the rotate  gsc in your mod /yourmapname /maps folder

2)
for a single object make brush right click with it selected and make it a script brush model
give it  these kvps
 kvp
Code Snippet
Plaintext
 targetname: rotate 
script_noteworthy: x or y or z (only 1)
speed 1 (1 is slow 5 is normal)


For multiple parts around a "fake center"

make all brushes for your moving piece

make another brush 8 by 8 square

place in the exact "fake" center of where you want all your brushes for whatever your making to rotate around

click only the (8 by 8) brush and select texture origin

with this origin brush(8 by 8) selected select the rest of the objects you want to rotate

right click and make a script brushmodel

click one part of it and give it these kvps (it will automatically give the kvps to the rest of the brushes that you made a
script brush model at the same time

Code Snippet
Plaintext
targetname:rotate
script_noteworthy:x, y, or z
. (only 1)

*/
This is the rotate.gsc. I have no idea where it came from originally

Code Snippet
Plaintext
main()
{
  rotate_obj = getentarray("rotate","targetname");
  if(isdefined(rotate_obj))
  {
   for(i=0;i<rotate_obj.size;i++)
   {
    rotate_obj[i] thread ra_rotate();
   }
  }
}
 
ra_rotate()
{
  if (!isdefined(self.speed))
   self.speed = 10;
  if (!isdefined(self.script_noteworthy))
   self.script_noteworthy = "z";
 
  while(true)
  {
  // rotateYaw(float rot, float time, <float acceleration_time>, <float deceleration_time>);
   if (self.script_noteworthy == "z")
    self rotateYaw(-360,self.speed);
   else if (self.script_noteworthy == "x")
    self rotateRoll(-360,self.speed);
   else if (self.script_noteworthy == "y")
    self rotatePitch(-360,self.speed);
    wait ((self.speed)-0.1); // removes the slight hesitation that waittill("rotatedone"); gives.
  // self waittill("rotatedone");
  }
}

/*
post if you need help
*/
Last Edit: September 10, 2013, 04:32:09 am by codmoddd1234

 
Loading ...