2 Simple Things That I Need Help For Again

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

2 Simple Things That I Need Help For Again

Post by metal_head » Thu Oct 16, 2008 4:02 pm

I'm sure that's possible,but as always I need help for this.

Alternative Fire: I know that the built in weapon system hasn't got that. I didn't actually think that I can possibly need that,but I'll need it for one of the weapons.I want when the player presses the right mouse button a granade to be launched from the weapon.Unfortunately I realize that for this I'll need a scripted weapon,and I've never made something like this and I don't even know where to start,soo is there an alternative way to make the alt. fire.Just of one of the weapons.
I hope that's possible.I think I can make the script detect if the player has armed the weapon in slod 3 for example,but I'm not sure if the script will be able to make the weapon execute an animation and launch the different projectile.If a scripted weapon is needed,I'll need a little help just to get started,I think I'll be able (or I hope ) to make the weapon shoot and execute the shooting animation etc. But I'll definetely need help. also I won't know how to make the weapon execute the arming animation when I press "3" and choose the weapon.

and now something that I don't have an idea how it can be done...
zooming! There's a built in zoom yes,but it's really not good for the type of zoom I want.
1- when you press the zoom button,the it starts to zoom slowly and you can see the weapon,you are using.
2-
it starts to zoom slowly
it's too slow. I want when you press the zoom button the zoom immediately to zoom for example 6 times,than if you press it again to zoom 8 times.
also there's something uncool: when I arm another weapon (with no zoom scope) and press the zooming key,than arm the sniper,there's the zooming overlay appeared...
I said two simple things,but this one I don't even have an idea of how it can be done,but I'm sure that it is possible,because the zoom in nirhis is just like what I described.

User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: 2 Simple Things That I Need Help For Again

Post by Juutis » Thu Oct 16, 2008 9:26 pm

I'd definitely go with scripted weapons. You could fake the secondary attack stuff with an invisible pawn that would shoot a grenade every time the weapon is armed an the secondary attack key is pressed. However, there's no way to find out if the currently armed weapon is reloading or something so you would be able to shoot grenades while reloading and arming the weapon. And on top of that, it wouldn't play any animation while firing the grenade.

The zooming thing could probably be done with the built-in weapons. Just check if a certain weapon is armed, then check if the zoom key is pressed and use the SetCameraWindow() command to zoom in. With scripted weapons this too would be a bit easier. It's just that scripting the weapons ain't that easy... :?

I'm planning to write a little something about scripting weapons one day. Maybe a tutorial with a basic weapon template or something. Dunno yet.
Pain is only psychological.

User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: 2 Simple Things That I Need Help For Again

Post by metal_head » Thu Oct 16, 2008 9:32 pm

Yeah,I'm looking at one of your script right now and I can't figure out where to start :D

Code: Select all

{

DAMAGEATTRIBUTE		[hp]



currentweapon		[-1]
firemode		[1]
zoom			[1]
zoomtimer		[0]
unzoomtimer		[1000000]

mouseleft_pressed	[false]
mouseright_pressed	[false]
reloading		[false]
temp			[0]
baseaccx		[0]
baseaccy		[0]

tilttime		[0]
tiltmin			[0]
tiltmax			[0]
tiltamount		[0]
tilt			[0]
rotatetime		[0]
rotatemin		[0]
rotatemax		[0]
rotateamount		[0]
rotate			[0]

offsetX			[0]
offsetY			[0]
offsetZ			[0]
OFFSETY			[75]

muzzleoffsetX		[0]
muzzleoffsetY		[0]
muzzleoffsetZ		[0]
muzzle			[]
hylsy			[]
hylsyx			[0]
hylsyy			[0]
hylsyz			[0]
hdelay			[0]
htimer			[1000000]

accuracy		[0]
accpershot		[0]
accreturn		[0]
bullet			[nobullet]
firerate		[0]
sound			[]
emptysound		[]
fullauto		[0]
crosshair		[0]

clipsize		[0]
bullets			[0]
bulletspershot		[0]
ammoattribute		[]

firetime		[0]
acc			[0]
acctimer		[0]
burstacc		[0]
maxacc			[0]

offsettemp		[0]
offsettime		[0]

infotext		[]
infotime		[0]

IDLE			[]
SHOOT			[]
RELOAD			[]
ARM			[]



WEAPON
{
	{
	IDLE		[smg_idle]
	SHOOT		[smg_shoot]
	RELOAD		[smg_reload]
	ARM		[smg_arm]

	ACCURACY	[40]
	ACCPERSHOT	[20]
	MAXACCURACY	[100]
	FIRERATE	[0.08]
	BULLET		[smgbullet]

	OFFSETX		[2]
	OFFSETY		[0]
	OFFSETZ		[-5]
	MUZZLEOFFSETX	[0.5]
	MUZZLEOFFSETY	[0.5]
	MUZZLEOFFSETZ	[0]
	MUZZLE		[Muzzle_smg]
	HYLSY		[hylsybullet]
	HYLSYX		[-3.5]
	HYLSYY		[-2]
	HYLSYZ		[6.5]
	HDELAY		[0]

	SOUND		[weapon_smg.wav]
	EMPTYSOUND	[weapon_click.wav]
	HEARRANGE	[600]

	AUTO		[1]
	CROSSHAIR	[1]

	CLIPSIZE	[25]
	BULLETSPERSHOT	[1]
	BURSTACC	[0]
	AMMOATTRIBUTE	[ammosmg]

	TILTMIN		[-120]
	TILTMAX		[50]
	TILT		[0.1]
	ROTATEMIN	[-30]
	ROTATEMAX	[30]
	ROTATE		[0.1]

	WEAPON		[SMG]
	}

	{
	IDLE		[tommy_idle]
	SHOOT		[tommy_shoot]
	RELOAD		[tommy_reload]
	ARM		[tommy_arm]

	ACCURACY	[25]
	ACCPERSHOT	[20]
	MAXACCURACY	[80]
	FIRERATE	[0.1]
	BULLET		[tommybullet]

	OFFSETX		[2]
	OFFSETY		[0]
	OFFSETZ		[-6.5]
	MUZZLEOFFSETX	[0.5]
	MUZZLEOFFSETY	[0.5]
	MUZZLEOFFSETZ	[0]
	MUZZLE		[Muzzle_tommy]
	HYLSY		[hylsybullet]
	HYLSYX		[-3]
	HYLSYY		[-4]
	HYLSYZ		[2]
	HDELAY		[0]

	SOUND		[weapon_tommy.wav]
	EMPTYSOUND	[weapon_click.wav]
	HEARRANGE	[1400]

	AUTO		[1]
	CROSSHAIR	[2]

	CLIPSIZE	[70]
	BULLETSPERSHOT	[1]
	BURSTACC	[0]
	AMMOATTRIBUTE	[ammotommy]

	TILTMIN		[-10]
	TILTMAX		[10]
	TILT		[0.1]
	ROTATEMIN	[-60]
	ROTATEMAX	[60]
	ROTATE		[0.1]

	WEAPON		[Tommy]
	}

	{
	IDLE		[sniper_idle]
	SHOOT		[sniper_shoot]
	RELOAD		[sniper_reload]
	ARM		[sniper_arm]

	ACCURACY	[5]
	ACCPERSHOT	[20]
	MAXACCURACY	[30]
	FIRERATE	[1.4]
	BULLET		[sniperbullet]

	OFFSETX		[2]
	OFFSETY		[0]
	OFFSETZ		[-5]
	MUZZLEOFFSETX	[0]
	MUZZLEOFFSETY	[0]
	MUZZLEOFFSETZ	[0]
	MUZZLE		[Muzzle_sniper]
	HYLSY		[hylsybullet]
	HYLSYX		[-4]
	HYLSYY		[-4]
	HYLSYZ		[10]
	HDELAY		[0.75]

	SOUND		[weapon_sniper.wav]
	EMPTYSOUND	[weapon_click.wav]
	HEARRANGE	[2000]

	AUTO		[0]
	CROSSHAIR	[5]

	CLIPSIZE	[5]
	BULLETSPERSHOT	[1]
	BURSTACC	[0]
	AMMOATTRIBUTE	[ammosniper]

	TILTMIN		[-40]
	TILTMAX		[0]
	TILT		[0.2]
	ROTATEMIN	[-10]
	ROTATEMAX	[10]
	ROTATE		[0.2]

	WEAPON		[Sniper]
	}
}
	Spawn[ ()
	{
		Console(false);
		Gravity(false);
		SetNoCollision();
		HideFromRadar(true);
		BoxWidth(0);
		BoxHeight(20);

		LowLevel("Setup");
	} ]

	Setup[ ()
	{
		self.ThinkTime = 0;

		self.yaw_speed = 10000;
		self.pitch_speed = 10000;

		PawnRender(false);
		ActivateHudElement("ammo_primary",false);
		ActivateHudElement("clips_primary",false);

		if(GetAttribute("weapon_primary","Player") != -1)
		{
			currentweapon = GetAttribute("weapon_primary","Player");
			changeweaponinfo(currentweapon);

			bullets = GetAttribute("ammo_primary","Player");
			SetAttribute("clips_primary",GetAttribute(ammoattribute,"Player"),"Player");

			HighLevel("ChangeWeapon_start");
			return 0;
		}

		self.think = "wait";
	} ]

	ininventory[ ()
	{
		self.ThinkTime = 0.1;
		PawnRender(false);

		if(currentweapon != GetAttribute("weapon_primary","Player"))
		{
			currentweapon = GetAttribute("weapon_primary","Player");

			if(currentweapon != -1)
			{
				bullets = 0;
				changeweaponinfo(currentweapon);
				handleammo();
			}
			HighLevel("ChangeWeapon");
			return 0;
		}

		if(GetEventState("InInventory") = false)
		{
			if(currentweapon != -1)
			{
				handleammo();
			}
			self.think = "wait";
			return 0;
		}
	} ]

	wait[ ()
	{
		self.ThinkTime = 0.1;
		PawnRender(false);

		if(GetEventState("InInventory"))
		{
			ModifyAttribute(ammoattribute,bullets,"Player");
			bullets = 0;
			self.think = "ininventory";
			return 0;
		}

		if((GetAttribute("WeaponSlot","Player")=1) and (GetEventState("InInventory")=false) and (currentweapon != -1))
		{
			AnimateHold(ARM);
			ActivateHudElement("ammo_primary",true);
			ActivateHudElement("clips_primary",true);
			self.think = "arm";
			return 0;
		}
	} ]

	ChangeWeapon_start[ ()
	{
		SetWeapon(WEAPON[currentweapon].WEAPON);
		LowLevel("wait");
	} ]

	ChangeWeapon[ ()
	{
		if(currentweapon = -1)
		{
			RemoveWeapon();
		}
		else
		{
			SetWeapon(WEAPON[currentweapon].WEAPON);
		}

		LowLevel("ininventory");
	} ]

	arm[ ()
	{
		self.ThinkTime = 0;

		basicroutines();

		PawnRender(true);
		SetNoCollision();

		if(self.animate_at_end)
		{
			AnimateHold(IDLE);
			self.think = "idle";
			return 0;
		}
	} ]

	idle[ ()
	{
		self.ThinkTime = 0;

		basicroutines();
		clearkeys();

		if(self.lbutton_pressed and (mouseleft_pressed = false) and (firetime < self.time))
		{
			if(bullets > 0)
			{
				fire();
				AnimateHold(SHOOT);
				self.think = "shoot";
				return 0;
			}
			else
			{
				PlaySound(emptysound);
				firetime = self.time + firerate;
				if(fullauto = 0)
				{
					mouseleft_pressed = true;
				}
			}

		}

		if(self.rbutton_pressed and (mouseright_pressed = false))
		{
			altattack();
			mouseright_pressed = true;
		}

		if(self.animate_at_end)
		{
			AnimateHold(IDLE);
		}

		if(((bullets = 0) or ((bullets < clipsize) and IsKeyDown(17))) and (GetAttribute(ammoattribute,"Player") > 0))
		{
			reloading = true;
		}

		if(reloading)
		{
			zoom = 1;
			reloading = false;
			AnimateHold(RELOAD);
			self.think = "reload";
			return 0;
		}
	} ]

	shoot[ ()
	{
		self.ThinkTime = 0;

		basicroutines();
		clearkeys();

		if(self.lbutton_pressed and (mouseleft_pressed = false) and (firetime < self.time))
		{
			if(bullets > 0)
			{
				fire();
				AnimateHold(SHOOT);
			}
			else
			{
				PlaySound(emptysound);
				firetime = self.time + firerate;
				if(fullauto = 0)
				{
					mouseleft_pressed = true;
				}
			}
		}

		if(self.rbutton_pressed and (mouseright_pressed = false))
		{
			altattack();
			mouseright_pressed = true;
		}

		if(self.animate_at_end)
		{
			AnimateHold(IDLE);
			self.think = "idle";
		}

		if((bullets < clipsize) and IsKeyDown(17) and (GetAttribute(ammoattribute,"Player") > 0))
		{
			reloading = true;
		}
	} ]

	reload[ ()
	{
		self.ThinkTime = 0;

		basicroutines();
		clearkeys();

		if(self.animate_at_end)
		{
			handleammo();

			AnimateHold(IDLE);
			self.think = "idle";
		}
	} ]

	basicroutines[ ()
	{
		if(GetEventState("crouch"))
		{
			if(OFFSETY > 40)
			{
				OFFSETY = OFFSETY - 5;
			}
			else
			{
				OFFSETY = 40;
			}
		}
		else
		{
			if(OFFSETY < 75)
			{
				OFFSETY = OFFSETY + 5;
			}
			else
			{
				OFFSETY = 75;
			}
		}

		PositionToPawn("player",offsetX,OFFSETY+offsetY+offsetZ*sin(-self.camera_pitch),offsetZ*cos(self.camera_pitch),true,false);

		self.ideal_pitch = self.camera_pitch;
		self.ideal_yaw = self.player_yaw;
		ChangeYaw();
		ChangePitch();

		if(acctimer < self.time)
		{
			acctimer = self.time + 0.1;

			if(acc > accuracy)
			{	
				acc = acc - accreturn;
			}
			else
			{
				acc = accuracy + 0;
			}

			if(acc > maxacc)
			{
				acc = maxacc + 0;
			}
		}


		if(GetEventState("InInventory") = false)
		{
			if(GetEventState("fall"))
			{
				accuracy = WEAPON[currentweapon].ACCURACY*2;
				accpershot = WEAPON[currentweapon].ACCPERSHOT*2;
			}
			else
			{
				if(GetEventState("move") and (offsettime < self.time))
				{
					if(GetEventState("crouch") or GetEventState("walk"))
					{
						offsettemp = offsettemp+0.05;
						offsettime = self.time + 0.01;
						accuracy = WEAPON[currentweapon].ACCURACY + 0;
						accpershot = WEAPON[currentweapon].ACCPERSHOT + 0;
					}
					else
					{
						offsettemp = offsettemp+0.1;
						offsettime = self.time + 0.01;
						accuracy = WEAPON[currentweapon].ACCURACY*1.5;
						accpershot = WEAPON[currentweapon].ACCPERSHOT*1.5;
					}
				}
				else
				{

					if(GetEventState("crouch"))
					{
						accuracy = WEAPON[currentweapon].ACCURACY/2;
						accpershot = WEAPON[currentweapon].ACCPERSHOT/2;
					}
					else
					{
						accuracy = WEAPON[currentweapon].ACCURACY + 0;
						accpershot = WEAPON[currentweapon].ACCPERSHOT + 0;
					}
				}

				offsetZ = WEAPON[currentweapon].OFFSETZ + sin(offsettemp);
			}

			DrawFlipBookImage("crosshair",crosshair,GetScreenWidth()/2-16,GetScreenHeight()/2-16,255,0,0,0,20);

			if(tilttime>self.time)
			{
				TiltCamera(tiltamount/10000);
			}
			if(rotatetime>self.time)
			{
				RotateEntity("Player",0,rotateamount/100,0);
			}
		}

		if(currentweapon = 2)
		{
			if((zoom != 1) and (unzoomtimer < self.time))
			{
				SetCameraWindow(2);
				crosshair = 5;
				unzoomtimer = self.time + 1000000;
			}

			if(zoomtimer < self.time)
			{
				if(zoom = 1)
				{
					SetCameraWindow(2);
					crosshair = 5;
				}
				if(zoom = 2)
				{
					SetCameraWindow(1);
					crosshair = 6;
				}
				if(zoom = 3)
				{
					SetCameraWindow(0.2);
					crosshair = 6;
				}
			}
		}

		if(htimer < self.time)
		{
			SetTargetPoint(500 + random(-100,100),1000 + random(-100,100),0);
			FireProjectile(hylsy,"shootbone",hylsyx,hylsyy,hylsyz,DAMAGEATTRIBUTE);
			htimer = self.time + 1000000;
		}

		if((GetAttribute("WeaponSlot","Player")!=1) or GetEventState("InInventory") or (GetAttribute("weapon_primary","Player") = -1))
		{
			PawnRender(false);

			ActivateHudElement("ammo_primary",false);
			ActivateHudElement("clips_primary",false);

			zoom = 1;
			SetCameraWindow(2);
			zoomtimer = 0;
			unzoomtimer = 1000000;

			reloading = false;
			rotatetime = 0;
			tilttime = 0;
			firetime = 0;
			acctimer = 0;
			acc = 0;
			offsettime = 0;
			infotime = 0;
			self.think = "wait";
		}

		SetAttribute("ammo_primary",bullets,"Player");
		SetAttribute("clips_primary",GetAttribute(ammoattribute,"Player"),"Player");

		if(infotime > self.time)
		{
			DrawText(infotext,GetScreenWidth()/2-6*GetStringLength(infotext),GetScreenHeight()/2 + 64,255,8,150,150,150);
		}
	} ]

	clearkeys[ ()
	{
		if(self.lbutton_pressed = false)
		{
			mouseleft_pressed = false;
		}
		if(self.rbutton_pressed = false)
		{
			mouseright_pressed = false;
		}
	} ]

	fire[ ()
	{
		baseaccx = random(-acc,acc);
		baseaccy = random(-acc,acc);

		htimer = self.time + hdelay;

		for temp = 0 to bulletspershot
		{
			SetTargetPoint(baseaccx+random(-burstacc,burstacc),baseaccy+random(-burstacc,burstacc),1000);
			FireProjectile(bullet,"shootbone",0,0,10,DAMAGEATTRIBUTE);
		}

		PlaySound(sound);
		AddExplosion(muzzle,"muzzlebone",muzzleoffsetX,muzzleoffsetY,muzzleoffsetZ);

		DamageAtBone(1000,WEAPON[currentweapon].HEARRANGE,"playersound","shootbone");

		acc = acc + accpershot;
		accreturn = acc/10;
		tilttime = self.time + tilt;
		rotatetime = self.time + rotate;
		tiltamount = random(tiltmin,tiltmax);
		rotateamount = random(rotatemin,rotatemax);
		firetime = self.time + firerate;
		bullets = bullets - 1;
		SetAttribute("ammo_primary",bullets,"Player");

		unzoomtimer = self.time + 0.2;
		zoomtimer = self.time + 1.4;

		if(fullauto = 0)
		{
			mouseleft_pressed = true;
		}
	} ]

	altattack[ ()
	{
		if(currentweapon = 0)
		{
			if(firemode = 1)
			{
				firemode = 2;
				fullauto = 0;
				infotext = StringCopy("Switched to Semi-Automatic");
				infotime = self.time + 2;
			}
			else
			{
				firemode = 1;
				fullauto = 1;
				infotext = StringCopy("Switched to Full-Automatic");
				infotime = self.time + 2;
			}
		}

		if(currentweapon = 2)
		{
			if(zoom = 1)
			{
				zoom = 2;
			}
			else
			{
				if(zoom = 2)
				{
					zoom = 3;
				}
				else
				{
					zoom = 1;
				}
			}
		}
	} ]

	changeweaponinfo[ (changeto)
	{
		accuracy = WEAPON[changeto].ACCURACY + 0;
		burstacc = WEAPON[changeto].BURSTACC + 0;
		accpershot = WEAPON[changeto].ACCPERSHOT + 0;
		maxacc = WEAPON[changeto].MAXACCURACY + 0;		
		bullet = StringCopy(WEAPON[changeto].BULLET);
		ammoattribute = StringCopy(WEAPON[changeto].AMMOATTRIBUTE);
		firerate = WEAPON[changeto].FIRERATE + 0;
		offsetX = WEAPON[changeto].OFFSETX + 0;
		offsetY = WEAPON[changeto].OFFSETY + 0;
		offsetZ = WEAPON[changeto].OFFSETZ + 0;
		muzzleoffsetX = WEAPON[changeto].MUZZLEOFFSETX + 0;
		muzzleoffsetY = WEAPON[changeto].MUZZLEOFFSETY + 0;
		muzzleoffsetZ = WEAPON[changeto].MUZZLEOFFSETZ + 0;
		muzzle = StringCopy(WEAPON[changeto].MUZZLE);
		hylsyx = WEAPON[changeto].HYLSYX + 0;
		hylsyy = WEAPON[changeto].HYLSYY + 0;
		hylsyz = WEAPON[changeto].HYLSYZ + 0;
		hylsy = StringCopy(WEAPON[changeto].HYLSY);
		hdelay = WEAPON[changeto].HDELAY + 0;
		sound = StringCopy(WEAPON[changeto].SOUND);
		emptysound = StringCopy(WEAPON[changeto].EMPTYSOUND);
		fullauto = WEAPON[changeto].AUTO + 0;
		crosshair = WEAPON[changeto].CROSSHAIR + 0;
		clipsize = WEAPON[changeto].CLIPSIZE + 0;
		bulletspershot = WEAPON[changeto].BULLETSPERSHOT + 0;

		tiltmin = WEAPON[changeto].TILTMIN + 0;
		tiltmax = WEAPON[changeto].TILTMAX + 0;
		tilt = WEAPON[changeto].TILT + 0;
		rotatemin = WEAPON[changeto].ROTATEMIN + 0;
		rotatemax = WEAPON[changeto].ROTATEMAX + 0;
		rotate = WEAPON[changeto].ROTATE + 0;

		IDLE = StringCopy(WEAPON[changeto].IDLE);
		SHOOT = StringCopy(WEAPON[changeto].SHOOT);
		RELOAD = StringCopy(WEAPON[changeto].RELOAD);
		ARM = StringCopy(WEAPON[changeto].ARM);

		acc = accuracy + 0;
	} ]

	handleammo[ ()
	{
		if(GetAttribute(ammoattribute,"Player") < (clipsize-bullets))
		{
			bullets = bullets + GetAttribute(ammoattribute,"Player");
			SetAttribute(ammoattribute,0,"Player");
		}
		else
		{
			ModifyAttribute(ammoattribute,bullets-clipsize,"Player");
			bullets = clipsize + 0;
		}
	} ]
}

It's really a lot to do,but I'll get on it(or at least try to)!
can you just explain to me something?
I couldn't figure out how the weapon is attatched to the player and how do you position it?
If you help me with that I might get somewhere,looking at your scripted weapons and trying to make mine.

Oh yeah and I saw this in your script:

Code: Select all

self.yaw_speed = 10000;
      self.pitch_speed = 10000;
does that mean that if I make the yaw and pitch speed smaller,the weapon will rotate slower with the player,cuz that will create the illusion that the weapon is heavy and it will be cool (like in half life 2 for example)

User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: 2 Simple Things That I Need Help For Again

Post by Juutis » Thu Oct 16, 2008 9:48 pm

I couldn't figure out how the weapon is attatched to the player and how do you position it?
I have a method called 'basicroutines' there. Whenever the weapon is active this method is called (the stuff in there is executed). These lines move and rotate the weapon:

Code: Select all

PositionToPawn("player",offsetX,OFFSETY+offsetY+offsetZ*sin(-self.camera_pitch),offsetZ*cos(self.camera_pitch),true,false);

self.ideal_pitch = self.camera_pitch;
self.ideal_yaw = self.player_yaw;
ChangeYaw();
ChangePitch();
does that mean that if I make the yaw and pitch speed smaller,the weapon will rotate slower with the player,cuz that will create the illusion that the weapon is heavy and it will be cool (like in half life 2 for example)
Yes, but it also means if you wave the mouse fast enough the weapon will disappear from the screen. And on top of that, if you rotate say, 270 degrees to the right fast enough the weapon could very well appear from the right side of the screen instead of left where it should.
Pain is only psychological.

User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: 2 Simple Things That I Need Help For Again

Post by metal_head » Thu Oct 16, 2008 10:06 pm

Well,I'll make the valude a very little bit smaller,so the weapon won't appear on the other side (which is funny :D:D )

I stardet immediately to work on a script with my skills (that means that what I've done so far will not work surely).

{
WEAPON [assultrifle]
IDLE [idle]
ARM [arm]
SHOOT [shoot]
ALTSHOOT [altshoot]
DISARM [disarm]

Code: Select all

Spawn[ ()
{
Console(true);
Gravity(false);
SetNoCollision(true);
HideFromRadar(true);
PawnRender(false);
NewOrder("Selected");
} ] 

Selected[ ()
{
SetWeapon(WEAPON,"Player");
AnimateHold(ARM);
ActivateHudElement("10mm_shell",true);
ActivateHudElement("~10mm_shell",true);
NewOrder("Idle");
} ]

Idle[ ()
{
Animate(IDLE);
I've never had to make something like that so it will be a little hard for me.For example now I don't know how to make the script watch if a button is pressed and change the weapon.I know the command for that,but I don't know how would I put it in the script... maybe in the "Selected" order of the script?

Post Reply