Home   Help Search Login Register  

Author Topic: Rearming Kozlice without spacebar at start  (Read 1997 times)

0 Members and 1 Guest are viewing this topic.

Celeriac

  • Guest
Rearming Kozlice without spacebar at start
« on: 18 Aug 2004, 16:21:12 »
Hey people and folks.  :)

I am trying to add kozlice to a unit via a reload script, and done everything that works on all other weapons. Still you have to press space to "activate" the shotgun every time you get a new one. I know the selectweapon command, but kozlice doesnÂ't want to co-operate.

Is there any way to rearm a unit with the shotgun so it will have one of the 2 ammo types active at startup? Any help will be appreciated.  :P
« Last Edit: 19 Aug 2004, 21:23:44 by Celeriac »

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Selectweapon dilemma
« Reply #1 on: 18 Aug 2004, 16:39:22 »
did you add one of the magazines before you added the weapon?

if you added all the mags after you added the weapon, you'll have to press space, or somthin like that

e.x.
Code: [Select]
this AddMagazine "KozliceShell"; this AddWeapon "Kozlice"
try dat
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

DBR_ONIX

  • Guest
Re:Selectweapon dilemma
« Reply #2 on: 18 Aug 2004, 17:05:04 »
Yup, thats the way
;)
- Ben

Celeriac

  • Guest
Re:Selectweapon dilemma
« Reply #3 on: 18 Aug 2004, 17:50:14 »
No, I have checked everything.

This is how the rearm.sqs looks like.

Code: [Select]
_Unit=_this;
RemoveAllWeapons _Unit;

_Unit AddMagazine "KozliceShell";
_Unit AddMagazine "KozliceShell";
_Unit AddMagazine "KozliceShell";
_Unit AddMagazine "KozliceShell";
_Unit AddMagazine "KozliceShell";
_Unit AddMagazine "KozliceBall";
_Unit AddMagazine "KozliceBall";
_Unit AddMagazine "KozliceBall";
_Unit AddMagazine "KozliceBall";
_Unit AddMagazine "KozliceBall";
_Unit AddWeapon "Kozlice";
_Unit SelectWeapon "Kozlice";

exit

It works on all single ammo weapons I know of, but this one is a toughie.  :-\

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Selectweapon dilemma
« Reply #4 on: 18 Aug 2004, 20:50:57 »
What happens if you add the weapon after one ammo type, but before the other ammo type?
Plenty of reviewed ArmA missions for you to play

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Selectweapon dilemma
« Reply #5 on: 18 Aug 2004, 22:14:06 »
I remember doing this a while back, but it was on AI guys, not a player, so I'm not sure if it will work right or not. Basically, you can use a 'fired' event-handler to detect when they shoot a shell, and then add another shell to their inventory:

this addeventhandler ["fired", {if (_this select 4 == "kozliceShell) then {(_this select 0) addmagazine "kozliceShell"}}]

Not sure if "kozliceShell" is the name of the ammo fired by the gun though, but you can check it using this:

this addeventhandler ["fired", {hint format ["%1", _this select 4]}]

As long as they still have ammo in their weapon when you give them more ammo, there shouldn't be a problem. I'm guessing you are waiting until they are out of ammo to give them more.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Celeriac

  • Guest
Re:Selectweapon dilemma
« Reply #6 on: 19 Aug 2004, 15:18:53 »
Actually, IÂ'm making a script for a deathmatch to rearm a guy when he respawns. The weapon works fine but by a long shot itÂ's tedious to press space every time to activate the weapon.


@mac
The same as adding the weapon before, after or in middle of the whole script: no weapon active.  :-\

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Rearming Kozlice without spacebar at start
« Reply #7 on: 20 Aug 2004, 00:08:02 »
is it just me or don't u have 2 do that in all mp missions

check the bis mp missions and see what they do. they're actually helpful if you can figure out the variables :)
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Celeriac

  • Guest
Re:Rearming Kozlice without spacebar at start
« Reply #8 on: 20 Aug 2004, 00:22:19 »
@Tyger
No, you have to do it only in very poorly scripted ones because the selectweapon command helps in most cases. Try arming a non-hunter guy with kozlice, so the gun is active at start and you know what I mean.

The problem is that I know how to do this script with all other weapons. There are no info or references on a double ammo weapon like kozlice though. BIS uses shotties with AI in some missions but the bots donÂ't have to bother pressing spacebar.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Rearming Kozlice without spacebar at start
« Reply #9 on: 20 Aug 2004, 00:24:51 »
well, then im stumped. havent actully ran into this prob before, so i cant help much :P

good luck m8 :)
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Celeriac

  • Guest
Re:Rearming Kozlice without spacebar at start
« Reply #10 on: 21 Aug 2004, 00:18:04 »
Could there be a command to make a unit change its weapon mode once, to possibly replace the spacebar "manual override"?

Bluelikeu

  • Guest
Re:Rearming Kozlice without spacebar at start
« Reply #11 on: 21 Aug 2004, 10:25:01 »
    I've ran into your problem several times, Celeriac. I've tried many ways to fix this problem ???. Apparently the only way to make it work is to already have the unit with the kozlice, and a Kozlice magazine on him. Then add the magazines afterwards. In your case, you were using a script to add both magazines and the weapon, you would always have to press spacebar. If you already have the weapon on him, with no magazines you still have to press spacebar. However, I've come up with a very lengthy idea. ::)

        First, add all the magazines that your entire game will be using into the init field of a unit. Then add all the weapons possible. Then activate your script and use removeallweapons _Unit. When your script activates, and the new weapon, and extra ammo is given to the unit. You will not need to press spacebar, plus your gun will be fully loaded. ;D It's that simple :o, but depending on the number of weapons you are using, it will take some time to finish.

this addmagazine "m16"; This addweapon "m16"; This addmagazine "kozliceball"; this addweapon "kozliceball"; this addmagazine "m21"; this addweapon "m21"; Hint "Does it end?"

#removed scrolling text - this is supposed to be a helpful forum, not one full of effects....
« Last Edit: 15 Oct 2005, 11:42:16 by bedges »

Celeriac

  • Guest
Re:Rearming Kozlice without spacebar at start
« Reply #12 on: 21 Aug 2004, 10:49:23 »
I appreciate it, but the idea is still blurry to me. Can you explain it step by step please?

Bluelikeu

  • Guest
Re:Rearming Kozlice without spacebar at start
« Reply #13 on: 21 Aug 2004, 12:18:10 »
Sorry about being vague.

Step1:
Double Click on the unit you wish to use

Step2:
Click in the init field of the unit and write the following:
This addmagazine "kozliceBall"; This addmagazine "kozliceshell"; this addweapon "kozlice"

Repeat step 2 for all weapons that you wish to use

Step3:
Initiate the script on the unit. Should remove all weapons of the unit.

Step4
Preview the mission. You should see that you don't have to press spacebar.


Notes:
You should add all the weapons and ammunition that you will be using in the mission to the init field of the unit
EX: This addweapon "m16"; this addweapon "Kozlice"
You should also add the ammunition before the weapons.

When you remove a weapon to add another, the weapons should have at least one magazine in it; you can add more ammunition if you like. And every time you remove another weapon and switch it with a different one, you will always be able to add more magazines to the weapon without having to press spacebar to select the ammo.

Basically, you declared all the ammunition and weapons you can use. And the game will think that you have all weapons and magazines one you. Disabling the problem of having to press spacebar every time you switch a weapon or start the game.

I'm not sure if it works for respawning, but it's good as a one time deal, if you know what I mean.

Celeriac

  • Guest
Re:Rearming Kozlice without spacebar at start
« Reply #14 on: 21 Aug 2004, 14:02:18 »
Sorry, doesnÂ't work for me.  :(