Home   Help Search Login Register  

Author Topic: armo editing  (Read 457 times)

0 Members and 1 Guest are viewing this topic.

AvalanCh3

  • Guest
armo editing
« on: 01 Dec 2004, 10:22:44 »
Question 1 . does anyone knows how to edit to check how many shots your player had used in the game? i would like to check the armo the soldier used permission for sniper to check the accuracy.

Question 2 . if i want to limit my bullets used to lets say 1 bullet per shot how will i do it?

thanks people for troubling u again

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:armo editing
« Reply #1 on: 01 Dec 2004, 11:50:06 »
1. You could look into using an Event Handler.  Something like:

unit addEventHandler("Fired",{[] exec script.sqs})

syntax not guaranteed.  script.sqs will be run everytime the unit fires.

2.   Do you mean one bullet per magazine?
« Last Edit: 01 Dec 2004, 11:55:59 by THobson »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:armo editing
« Reply #2 on: 01 Dec 2004, 14:31:27 »
1) I believe you could use the ammo command to get how many rounds are left, but that will only work right if there is no ammo for the player to get and he doesn't change weapons. otherwise, use THobsons idea. In some units init line, you would need to put  shotCounter = 0 and then in the script just have this line:
shotcounter = shotCounter + 1
exit

If you want to tell the player, then at the end you would need to exec another script with this in it:

_msg = format [%1,"%2",%3,"You used",shotCounter,"rounds"]
hint _msg
exit
not sure on that exactly

2) you could use a fired eventhandler:
sniper addeventhandler ["fired",{this exec "NoMoreShooting.sqs"}]

NoMoreShooting.sqs

disableuserinput true
~5
disableuserinput false
exit

that will stop the player from doing anything for 5 seconds after he shoots
if its in multiplayer you would need to add:
_shooter = _this select 0
?_shooter != player:exit

i think thats right, but not garunteed
« Last Edit: 01 Dec 2004, 14:42:00 by Triggerhappy »

AvalanCh3

  • Guest
Re:armo editing
« Reply #3 on: 06 Dec 2004, 02:45:54 »
thanks people however is there anyway to check the number of bullets the player have in game?

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:armo editing
« Reply #4 on: 06 Dec 2004, 02:54:30 »
ammo unit
*i think*
check the comref
« Last Edit: 06 Dec 2004, 02:54:50 by Triggerhappy »

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:armo editing
« Reply #5 on: 06 Dec 2004, 03:11:34 »
I'm pretty unclear about the second part of Q1, and all of Q2. I don't see how you can use more than 1 bullet per shot, so I must be missing something. Unless you are talking about making it so the player can't use fully automatic or burst fire? If that is the case, there isn't any practical way to do it. Best you can do is not place any automatic weapons in the mission. But generally machineguns suck in ofp, so I think most people use semi-auto weapons anyway...

As for counting bullets the player has fired: You coupld put this in the player's init field:

Shot_Count = 0; this addeventhandler["fired", {Shot_Count = Shot_Count + 1}]

Whenever the player fires ANYTHING (grenades, bullets, AT weapons, etc), the variable Shot_Count will be increased. If you don't want to count grenades or other non-bullets, then it gets slightly more complicated.
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!