Home   Help Search Login Register  

Author Topic: Satchels  (Read 1710 times)

0 Members and 1 Guest are viewing this topic.

duckwilliamson

  • Guest
Satchels
« on: 05 Jul 2003, 08:50:10 »
This is probably the wrong place to ask this but;

How do you check to see if a player has satchels??

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:Satchels
« Reply #1 on: 05 Jul 2003, 14:22:12 »
unitname hasweapon "pipebomb"

duckwilliamson

  • Guest
Re:Satchels
« Reply #2 on: 05 Jul 2003, 20:21:37 »
I've tried that already and it doesn't work ...

I've also tried timebomb ...

Does it matter whether or not you are picking it up out of a crate which had pipebomb added through addweaponcargo or addmagazinecargo?

_hammy_

  • Guest
Re:Satchels
« Reply #3 on: 05 Jul 2003, 20:25:11 »

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:Satchels
« Reply #4 on: 05 Jul 2003, 20:35:14 »
where you got it from shouldn't matter, the problem may be "timebomb" and "pipebomb" are both magazines, not "weapons"

_hammy_

  • Guest
Re:Satchels
« Reply #5 on: 05 Jul 2003, 20:42:53 »
i always thought the pipebomb and timebomb where both weapons? oh well... first try the has weapon command with an m16, then if that works, try it with a pipebomb, and if that doesn't work, then the pipebomb is a magazine.

duckwilliamson

  • Guest
Re:Satchels
« Reply #6 on: 05 Jul 2003, 20:43:40 »
OK ... so does that mean I should try the ammo command??

I never thought of that ... I'll try out the idea & close this thread if it works:

player ammo "pipebomb" < 0:obj_1 "done"

duckwilliamson

  • Guest
Re:Satchels
« Reply #7 on: 09 Jul 2003, 23:11:09 »
I did some testing and here are my retarded results:

- satchels through addmagazinecargo don't count as either ammo nor weapon
- satchels through addweaponcargo don't give any actual satchels, but give you the empty weapon which can now be seen through hasweapon
- if you have satchel weapon and then take satchel magazine, any number of magazines will only give you '1' ammo

My recommendation (what I am doing) for if you want to have satchels detected: this addweapon "pipebomb" in the player's init, and when you want to detect if he has satchels just call the player ammo "pipebomb" (or even 'someammo' command)

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:Satchels
« Reply #8 on: 10 Jul 2003, 00:05:44 »
Satchels are considered as magazines, therefore if you want to check whether someone carries any, here is a loop you could do :

Code: [Select]
_unit=_this select 0
_mag=count magazines _unit
_i=0
#loop
? (magazines _unit select _i)=="pipebomb":hint "I've got some !";exit
_i=_i+1
?_i>_mag:exit
~0.001
goto "loop"

Implementation : [myloon] exec "ammocheck.sqs"

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Satchels
« Reply #9 on: 10 Jul 2003, 02:19:14 »
i always thought the pipebomb and timebomb where both weapons? ...


The "Weapon" for those kinda toys is the default (and hidden) "PUT", which (as "Throw" for handGrenades) is pre-defined in the main configuration file for all units.  :)


As stated, "PipeBomb" is a magazine; and to check if a units has the bomb, do this:


   UnitName Ammo "PipeBomb" >0

...should work fine in the condition field of a trigger.  :-*



Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:Satchels
« Reply #10 on: 10 Jul 2003, 12:44:50 »
 :-\ I'm afraid I couldn't get the "ammo" command to work, and the line :

Code: [Select]
UnitName Ammo "PipeBomb" >0
in the condition field of a trigger doesn't work. For what reason, now you tell me...  ::)
Sometimes you do need to do complicated things to obtain simple results.

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Satchels
« Reply #11 on: 10 Jul 2003, 19:00:24 »
yer right there, m8  ::) it's one of those buggy weapons.... well, try something about removing/adding the "PUT" weapon that is needed for a unit to be able to put satchels. :)

If ya don't have to put anything before you have the bomb, try & remove his "PUT" via the INIT field.

this removeWeapon "PUT"

maybe you can figure out how to let a trigger fire when you get close enough to the pipe to be able to actually grab it... som'n like:


      [condition]: player distance crate <4
     [activation]: player addWeapon "PUT"

Then you can take the bomb.... and another trigger fires with the condition:


      [condition]: player hasWeapon "put"
     [activation]: whatever it was... end#1 or alike



fiddle around w/ it mate!  :-*

later
« Last Edit: 10 Jul 2003, 19:02:38 by Tomb »

duckwilliamson

  • Guest
Re:Satchels
« Reply #12 on: 12 Jul 2003, 05:46:24 »
OK boys ... Like i was saying ...

Satchels are ammo, but you need a weapon to find the ammo, and you must have the PUT ability ...

So in order to overcome this you either add a PUT ability or add an empty weapon ... if you addweapon "pipebomb" it doesn't affect anything but allowing you to check for ammo ...

If anyone has any problems with my result reply here and I'll respond in detail if necessary ...