Page 1 of 1

spin healthpak

Posted: Thu Aug 25, 2005 8:50 pm
by ViPER
ive seen this in a thread but couldn't find it (in the game too).

How do i spin a spawned healthpak where is targetname "healthspin"

tried

$healthspin rotateY -1

i thought but doesntwork

i tried a few other things but didnt get it?

Posted: Fri Aug 26, 2005 10:41 am
by Rookie One.pl
Increase the value.

Posted: Sun Aug 28, 2005 12:10 pm
by Ric-hard
$healthspin rotateY 360

Posted: Sun Aug 28, 2005 7:27 pm
by ViPER
arrggg nope, this should be easy LOL.

All i want to do is spin it perpetually.

i dont think it needs a node to do this ???

time / waitmove / speed / rotatey / rotateydown / rotateydownto

played with all these - nothing

Posted: Mon Aug 29, 2005 3:43 pm
by lizardkid
put a while 1 loop around it.

Code: Select all

while(42)
{
      $healthpak rotateY 360 // one rotation
      wait 5
}
it might spin too fast to be noticed, but i doubt .speed deals with rotation so i can't help you there.

Posted: Mon Aug 29, 2005 6:43 pm
by ViPER
the funny thing is - i accidently rotated a door open and it kept spinning (like i want) but i cant remember how.

Posted: Tue Aug 30, 2005 10:46 am
by Ric-hard
Allo allo :)
I dunno exactly what youre doing but maybe this peace of script is useful, its an old mod I made, I called it SelfHealing-mod and it shall be executed from Mike_legs.st like this.. exec global/selfhealing.scr
(when the player stands still/rests, a healthpack is spinning above his head and he slowly recovers health)

Code: Select all

////////////////////////////////////////////////////////////////
//
// Standing
//
////////////////////////////////////////////////////////////////

state STAND
{
	entrycommands
	{
		modheight "stand"
		movementstealth "1.0"
		moveposflags "standing"
		//iprint "stand"
		exec global/selfhealing.scr
	}
and here is the selfhealing-script...

Code: Select all

main:
local.master = spawn ScriptMaster
local.master aliascache med_canteen sound/items/Health_Canteen_01.wav soundparms 1.0 0.0 1.0 0.0 160 1600 item loaded maps "m dm obj"

	level.heal = int(getcvar(heal))
	local.player = self
	if (((local.player.selfhealing == 1) || (local.player.health == 100) || (getcvar("heal") != "1")))
	{
	end
	}
	else
	{
	local.player.selfhealing = 1
	local.healspot = spawn trigger_multiple 
	local.healspot.origin = self.origin
	local.healspot setsize ( -20 -20 -20 ) ( 20 20 20 )

	local.canteen = spawn script_model 
	local.canteen model "items/item_25_healthbox.tik"
	local.canteen.origin = (self.origin + (0 0 100))
	local.canteen notsolid
	local.canteen rotateY 360
	local.canteen playsound med_canteen
	}
	while ((self istouching local.healspot) && (self.health != 100))
	{
	if ((self.health >= 70) && (self.health < 100))
	{
	local.canteen light 0.0 0.65 1.0 150.0
	self heal 0.02
	}
	if ((self.health >= 30) && (self.health < 70))
	{
	local.canteen light 1.0 0.6 0.0 150.0
	self heal 0.05
	}
	if ((self.health >= 1) && (self.health < 30))
	{
	local.canteen light 1.0 0.0 0.0 150.0
	self heal 0.1
	}
	wait .8
	local.canteen light 1.0 0.0 0.0 0
	wait .2
	}
	local.healspot delete
	local.canteen delete
	local.player.selfhealing = 0
	end
Richard