Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
WEAPON CHAINGING SYSTEM #304614
01/09/10 10:01
01/09/10 10:01
Joined: May 2009
Posts: 5,365
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,365
Caucasus
I worked with all of you weapon workshops, I learnd allot of usefull things, thank you allot!!! laugh But, I whant to create weapon changing system, to make player drop and pick up to two weapons, primary and secondary. As in Couter Strike, how can I make that? I think allot it will be very usefull, if you will make such a workshop))) or just a simple demo, of how does it work. Thank you))

Last edited by 3run; 01/09/10 10:03.

Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: WEAPON CHAINGING SYSTEM [Re: 3run] #304616
01/09/10 10:13
01/09/10 10:13
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Create an action for the pickup weapon
like this:
Code:
//skill1 WeaponID 0
//skill2 PickupDist 100
action weapon_pickup()
{
	while(vec_dist(my.x,player.x) < my.PickupDist)
	{
		my.pan += time_step; //Let the Weapon rotate
		wait(1);
	}
	switch_active_weapon(my.skill1);
	ent_remove(me);
}
}



now you need the weapon change code:
Code:
var active_weapon_id = 0;
var active_weapon = 0;
var weapons[2];

//Switches the active weapon
function switch_active_weapon(var weapon_id)
{
	weapons[active_weapon] = weapon_id;
}

//Used to cycle the Weapons
function weapon_changer_startup()
{
	while(1)
	{
		active_weapon = cycle(active_weapon + mickey.z / 120,0,2); //Change Weapon with mousewheel
		active_weapon_id = weapons[active_weapon];
		wait(1);
	}
}

// Use to shoot
function shoot()
{
	switch(active_weapon_id)
	{
		case 0:
			//Weapon with first ID
			break;
		case 1:
			//Weapon with second ID
			break;
		case n:
			//Weapon with n ID
			break;
		default:
			//No Weapon or Weapon not defined
			break;
	}
}




Visit my site: www.masterq32.de
Re: WEAPON CHAINGING SYSTEM [Re: MasterQ32] #304619
01/09/10 10:46
01/09/10 10:46
Joined: May 2009
Posts: 5,365
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,365
Caucasus
And how about drop? How can player drop weapon? If I have 4 weapons, for example, I whant to be able to drom and pick an other weapon. And can you make a small demo of this please? laugh I'll be very grateful


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: WEAPON CHAINGING SYSTEM [Re: 3run] #304837
01/11/10 08:21
01/11/10 08:21
Joined: May 2009
Posts: 5,365
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,365
Caucasus
Some one, help with this please


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: WEAPON CHAINGING SYSTEM [Re: 3run] #304842
01/11/10 10:43
01/11/10 10:43
Joined: Aug 2003
Posts: 2,008
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,008
Bucharest, Romania
Dropping a weapon means to remove it (ent_remove, etc) from player's inventory and create it again (ent_create) close to his feet.

Re: WEAPON CHAINGING SYSTEM [Re: George] #304848
01/11/10 11:45
01/11/10 11:45
Joined: May 2009
Posts: 5,365
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,365
Caucasus
I know that George, but I do not know how to realize all that. That why I'm asking for workshop or small demo.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: WEAPON CHAINGING SYSTEM [Re: 3run] #305057
01/12/10 18:12
01/12/10 18:12
Joined: Aug 2003
Posts: 2,008
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,008
Bucharest, Romania
I've got a long list but I'll see what I can do about it.

Re: WEAPON CHAINGING SYSTEM [Re: George] #305074
01/12/10 19:54
01/12/10 19:54
Joined: May 2009
Posts: 5,365
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,365
Caucasus
Thank you George, I'm sure this kind of workshop will be very useful, with it and all previous weapon workshops, GS users will be able to create they own full working weapon system laugh


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: WEAPON CHAINGING SYSTEM [Re: 3run] #308198
02/02/10 06:00
02/02/10 06:00
Joined: May 2009
Posts: 5,365
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,365
Caucasus
Still waiting for you help dear George. laugh I know, you are very busy... But I hope, that you will finish that workshop soon... You may just make an example for now, and when you will be free, you may just add workshop to it. laugh Really need your help man.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: WEAPON CHAINGING SYSTEM [Re: 3run] #308214
02/02/10 10:16
02/02/10 10:16
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Nidhogg Offline
Serious User
Nidhogg  Offline
Serious User

Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Hey 3run how about having a go at it yourself and if you are having problems post your code on what you have done and then maybe somebody will help you.

Also do NOT double post you have the same question in the lite_c forum.


Windows XP SP3
Intel Dual Core CPU: E5200 @ 2.5GHz
4.00GB DDR3 Ram
ASUS P5G41T-M LX
PCIE x16 GeForce GTS 450 1Gb
SB Audigy 4
Spyware Doctor with AntiVirus
Page 1 of 3 1 2 3

Moderated by  George 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1