spin healthpak

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

spin healthpak

Post 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?
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Increase the value.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Ric-hard
Sergeant Major
Posts: 102
Joined: Sun Feb 29, 2004 6:44 am
Location: sweden
Contact:

Post by Ric-hard »

$healthspin rotateY 360
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post 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
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

the funny thing is - i accidently rotated a door open and it kept spinning (like i want) but i cant remember how.
Ric-hard
Sergeant Major
Posts: 102
Joined: Sun Feb 29, 2004 6:44 am
Location: sweden
Contact:

Post 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
Post Reply