weapon swappage idea

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

weapon swappage idea

Post by darksmaster923 »

okay, i got a scripted pickup and im trying to make it swap with weapons on the ground..... would this work:
i put if the player presses use key to swap his gun, theres other invisible guns inside the gun on the ground. when player swapps, he gets his gun and the gun he swapped invis gun becomes vis
Herp derp.
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

slash that idea.
okay, im doing drop weapon move a pickup next to player. it works, cept for the fact that if i drop it, pick it up and drop it i automatically pick it back up. heres my two scripts

Code: Select all

{
	Spawn[ ()
	{
		Console(true); //Turns on debug
		Gravity(false); //No grav
		SetNoCollision(); //No collision
		BoxHeight(75); //height of bounding box
		HideFromRadar(true); //uh... speaks for itself
		BoxWidth(75); //width of bounding box
		LowLevel("Setup");
	} ]

	Setup[ ()
	{
		PawnRender(false);
		self.think = "Wait";
	} ]

	Wait[ ()
	{
		self.ThinkTime = "0.1";
		if(IsKeyDown(30))
		{
			if(self.player_weapon = 10)
			{
				SetPosition("mg", self.player_X, self.player_Y, self.player_Y, true, true);	
			}
		}
	} ]
}

Code: Select all

{
	X	[0]
	Y	[0]
	Z	[0]

	Spawn[ ()
	{
		Console(true);
		BoxWidth(20);
		BoxHeight(20);
		SetCollision();
		AddCollisionOrder("Setup");
	} ]

	Setup[ ()
	{
		LowLevel("Idle");
	} ]

	Idle[ ()
	{
		if(GetAttribute("galil","Player") < 1 and (GetAttribute("m16","Player") < 1))
		{
			if(GetAttribute("mp7","Player") < 1 and (GetAttribute("mac","Player") < 1))
			{
				if(GetAttribute("mg36","Player") < 1 and (GetAttribute("awp","Player") < 1))
				{
					if(GetAttribute("m3","Player") < 1)
					{
						ModifyAttribute("mg36", 1, "Player");
						ModifyAttribute("mg_shell", random(25,80), "Player");
						PlaySound("respawn.wav");
						TeleportEntity("mg" , "temp" );  
					}
				}
			}
		}
	} ]
}
Herp derp.
User avatar
fps
Posts: 504
Joined: Mon Sep 26, 2005 9:54 pm
Location: in a magical land devoid of hope, happiness, and sanity.

Post by fps »

i am not quite sure what this script exactly does.
could you elaborate on it a bit?
i would love to make picking up and droping weapons work but i am not sure how to properly define the pickups or how to bring them back.

thanks,
fps
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

err.. i fixed it. i just added a var to true when picked up
Herp derp.
Post Reply