Rotating weapon help
Moderator: Core Staff
-
- 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
You don't change anything in _weapon_pickup.gsc. Just follow the tutorial, you add a line of code to your main function(in this case setupWeaponForPickup("panzerschreck_mp", "xmodel/weapon_panzerschreck", 5);) and include this .gsc by using #include maps\mp\_weapon_pickup; at the very top of your maps main .gsc.
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 guys it worked.... but ;
- First time you pick up the weapon you have no ammo
- Second time you get the max amount of ammo... I want it to give only 1 projectile (panzerschreck remember ).
- First time you pick up the weapon you have no ammo
- Second time you get the max amount of ammo... I want it to give only 1 projectile (panzerschreck remember ).
-
- 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
No problem, modify _weapon_pickup.gsc. Add this line under user giveweapon(weapon); :
I'm not sure whether the panzerschreck has start ammo defined but this is the basic script.
Code: Select all
user givestartammo(weapon);
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
Panzerschreck doesn't have startammo.
But I changed the panzer file into 1 missile and the max ammo aswell, now it works like a charm.
Again thx
But I changed the panzer file into 1 missile and the max ammo aswell, now it works like a charm.
Again thx
-
- 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
No prob.
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
Can I use this script for 3 different weapons, I mean I want the pick up sounds to be different ?
for the redeemer/damageamp/normal pick up I mean.
for the redeemer/damageamp/normal pick up I mean.
-
- 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 can modify the script so you have to input different sounds for picking up the weapon. Do you want the same sound for maxammo and respawning?
Code: Select all
setupWeaponForPickup(weapon_name, weapon_xmodel, soundalias, delay)
{
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, soundalias, delay);
}
}
}
WeaponPickup(o, weapon, xmodel, sound, 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(sound);
o hide();
self maps\mp\_utility::TriggerOff();
if(isdefined(delay))
{
wait delay;
}
self maps\mp\_utility::TriggerOn();
o playsound("weapon_respawned");
o show();
}
}
}
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
Maxammo and spawn are all the same.
But I'm at a loss
how does this work, putting the sound here plays the same sound for all weapons .. right ?
But I'm at a loss
how does this work, putting the sound here plays the same sound for all weapons .. right ?
Code: Select all
user takeweapon(c_weap);
user giveweapon(weapon);
user switchtoweapon(weapon);
o playsound(sound);
-
- 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
No, you add multiple setupWeaponForPickup in your main script for multiple weapons. You have to add multiple triggers and origins for multiple weapons as well. For example if you wanted a luger and an m1garand respawning, you would create a trigger and script_model for the luger and a different trigger and script_model for the garand. Then you just add multiple setupWeaponForPickup in your main script. You don't modify _weapon_pickup.gsc. I did that for your convenience.
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
Ok I 'll give it a go.....doing so many things at the same time at the moment
-
- Core Staff
- Posts: 2155
- Joined: December 7th, 2004, 2:07 am
- Location: Netherlands
- Contact:
Re: Rotating weapon help
Got it all working, still 10 weapons or so to go
But when I pick up the ammo the sound doesn't play (the normal pickup ammo sound I mean)
Any ideas ?
But when I pick up the ammo the sound doesn't play (the normal pickup ammo sound I mean)
Any ideas ?
-
- 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
That's because everything is scripted. You have to make sounds for picking up, picking up ammo and respawning the weapon(or at least make the soundaliases).
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
Aha ok. I'll try that.
I made 3 weapons respawn and picked up by a trigger multiple but 1 of em (panzeschreck) doesn't work, I get this error;
Oh yeah, is it also possible to let players carry more then 2 weapons ( 15 for instance) ?
I made 3 weapons respawn and picked up by a trigger multiple but 1 of em (panzeschreck) doesn't work, I get this error;
Oh yeah, is it also possible to let players carry more then 2 weapons ( 15 for instance) ?
You do not have the required permissions to view the files attached to this post.
-
- 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
Precache the weapon first, then try again.
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
My main code is like this now ;
but still I get the error, did I precache right ?
Code: Select all
#include maps\mp\_weapon_pickup;
main()
{
maps\mp\_load::main();
ambientPlay("ambient_mp_deck16");
maps\mp\bounce_jump::main();
maps\mp\teleport::main();
maps\mp\poison::main();
maps\mp\elevators::main();
//maps\mp\redeemer_rotate::main();
game["allies"] = "british";
game["axis"] = "german";
game["british_soldiertype"] = "airborne";
game["british_soldiervariation"] = "normal";
game["german_soldiertype"] = "fallschirmjagergrey";
game["german_soldiervariation"] = "normal";
game["attackers"] = "allies";
game["defenders"] = "axis";
setcvar ("g_gravity", 800);
setcvar ("g_speed" , 300);
setcvar ("jump_height" ,55);
setcvar ("bg_fallDamageMinHeight", 100000);
setcvar ("bg_fallDamageMaxHeight", 200000);
setcvar ("scr_dm_timelimit" , "6");
level thread precache();
setupWeaponForPickup("bren_mp", "xmodel/weapon_bren","weap_pickup", 30);
setupWeaponForPickup("panzerschreck_mp", "xmodel/weapon_panzerschreck","weap_pickup", 10);
setupWeaponForPickup("m1garand_mp", "xmodel/weapon_m1garand","weap_pickup", 10);
}
precache()
{
precachemodel("xmodel/weapon_panzerschreck");
}
Who is online
Users browsing this forum: No registered users and 3 guests