Rotating weapon help
Moderator: Core Staff
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Rotating weapon help
My guess is that you have chosen to use "trigger_once" in the mapping?

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: Rotating weapon help
It's not a trigger, it's a weapon entity.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Rotating weapon help
In that case, the weapon is deleting itself once picked up, I would assume.

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- Core Staff
- Posts: 2155
- Joined: December 7th, 2004, 2:07 am
- Location: Netherlands
- Contact:
Re: Rotating weapon help
Maybe that is the case, dunno.Drofder2004 wrote:In that case, the weapon is deleting itself once picked up, I would assume.
But I want the weapon you drop to be deleted before the spawn otherwise during gameplay their will be a whole pileup of weapons people drop

-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: Rotating weapon help
Right, but what's the new weapon that has been dropped called now?Drofder2004 wrote:In that case, the weapon is deleting itself once picked up, I would assume.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Rotating weapon help
Not sure what you mean, the error is because we are referencing "self" which is deleted after the trigger?Rezil wrote:Right, but what's the new weapon that has been dropped called now?Drofder2004 wrote:In that case, the weapon is deleting itself once picked up, I would assume.

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: Rotating weapon help
I mean now that we've picked up 'weapon' and dropped our currently selected weapon, can we assign a targetname to this dropped weapon(to delete it afterwards)?
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Rotating weapon help
Is the weapon dropped automatically by ingame code or you handling it by "removing" the weapon form the player and placing it manually on the floor?
If everything at this current stage is working with no error, can you post the new current script?
(Or jump on Xfire, I think you are now on my list
)
If everything at this current stage is working with no error, can you post the new current script?
(Or jump on Xfire, I think you are now on my list


Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: Rotating weapon help
Me? Sam?
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Rotating weapon help
Whoever has the code?Rezil wrote:Me? Sam?


Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: Rotating weapon help
Have added you on XFire, didn't recieve any invitation, hence the confusion.
That's what I've gathered so far.
Code: Select all
main()
{
WeaponRespawner("redeemer", 10);
}
WeaponRespawner(targetname, defaultrespawndelay)
{
weapons = getentarray("redeemer", "targetname");
if(weapons.size > 0)
{
for(i=0; i < weapons.size; i++)
{
if(!isdefined(weapons[i].script_timescale))
weapons[i].script_timescale = defaultrespawndelay;
weapons[i] thread weapon_think(weapons[i].script_timescale);
}
}
}
weapon_think(delaytime)
{
classname = self.classname;
model = self.model;
count = self.count;
org = self.origin;
angles = self.angles;
targetname = self.targetname;
flags = self.spawnflags;
self waittill("trigger");
wait delaytime;
weapon = spawn(classname, org, flags);
weapon.angles = angles;
weapon.count = count;
weapon setmodel(model);
weapon.script_timescale = delaytime;
weapon.targetname = targetname;
weapon playsound("spawnsound");
weapon thread weapon_think(delaytime);
}
Ingame code, probably hard-coded from cod1 since I didn't find any reference to weapons and picking them up in any .gsc.Is the weapon dropped automatically by ingame code or you handling it by "removing" the weapon form the player and placing it manually on the floor?
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Rotating weapon help
Yes, its hard coded.
So, one way of doing this would be get a list of entities and filter them by classname or model, or you could even compare the entities origins and locate the neareast to the player and this is almost always going to be the weapon...
Also, might be worth testing to see if "ent.owner" is used in CoD2.
So, one way of doing this would be get a list of entities and filter them by classname or model, or you could even compare the entities origins and locate the neareast to the player and this is almost always going to be the weapon...
Also, might be worth testing to see if "ent.owner" is used in CoD2.

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: Rotating weapon help
Reworking the whole pick-up script. brb
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: Rotating weapon help
Done, see here.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
-
- Core Staff
- Posts: 2155
- Joined: December 7th, 2004, 2:07 am
- Location: Netherlands
- Contact:
Re: Rotating weapon help
Thx alot guys... going to experiment with that for a bit. I have no clue on what it lookslike ingame but I soon will.Rezil wrote:Done, see here.
I tried to spawn the weapon with your script m8 but I get a bad syntax error ;
Code: Select all
******* script compile error *******
bad syntax: (file 'maps/mp/_weapon_pickup.gsc', line 33)
setupWeaponForPickup("panzerschreck_mp", "xmodel/weapon_panzerschreck", 5);
*
Code: Select all
*/
setupWeaponForPickup("panzerschreck_mp", "xmodel/weapon_panzerschreck", 5);
{
precachemodel(weapon_xmodel);
trig = getentarray("weapon_pickup_" +weapon_name,"targetname");
org = getentarray("weapon_origin_" +weapon_name,"targetname");
if(org.size == trig.size) //same ammount of origins and triggers, otherwise you get errors
{
for(i=0;i<org.size;i++)
{
trig[i] thread WeaponPickup(org[i], weapon_name, weapon_xmodel, delay);
}
}
}
WeaponPickup(o, weapon, xmodel, delay)
{
while(1)
{
o setmodel(xmodel);
o notsolid(); //already true, just not sure about all script_models
self waittill("trigger", user);
c_weap = user getcurrentweapon();
if(user hasweapon(weapon))
{ //user already has that weapon, so keep the model showing and only max out the ammo
user givemaxammo(weapon);
wait 10; //to prevent unlimited ammo while staying inside the trigger
o playsound("weapon_maxammo");
}
else
{
user takeweapon(c_weap);
user giveweapon(weapon);
user switchtoweapon(weapon);
o playsound("weapon_pickup");
o hide();
self maps\mp\_utility::TriggerOff();
if(isdefined(delay))
{
wait delay;
}
self maps\mp\_utility::TriggerOn();
o playsound("spawnsound");
o show();
}
}
}
Who is online
Users browsing this forum: No registered users and 0 guests