Home   Help Search Login Register  

Author Topic: Is anyone here good at editing?  (Read 797 times)

0 Members and 1 Guest are viewing this topic.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Is anyone here good at editing?
« on: 14 Jan 2003, 05:31:26 »
I posted this message in the Editing: General board, but got no replies, so I'm hoping someone here can help me.

So I'm working on a mission where you command other units over the radio, aside from your own squad. Right now, I have a "status report" action that gives you a list of each supporting team and how many men are left in them (I have 5 teams of 4, and 1 team of 2). Anyway, what I want to do is also display how many  :gunman:kills each team has gotten (so you can tell if a team is being effective or not).

Is there a way find out how many kills a certain unit or group has gotten? Or maybe some code I could use to keep track of this (version 1.4)? I'm kinda lost on this one... ???

Another question that might answer this one is this: in the default death sequence, how does the camera know which unit to zoom to? This (as far as I know) is always the unit that killed you, so unless BIS has some hidden commands, there must be a command or way to find out which unit killed another unit. Does someone know how to get the default OnPlayerKilled.sqs? Or at least how BIS did it?

If there is no answer to any of this, just say "hey, it can't be done", and I'll stop looking for an answer.

Thanks for the help!  :wave:
« Last Edit: 14 Jan 2003, 05:33:56 by General Barron »
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!

Offline Dinger

  • Contributing Member
  • **
  • where's the ultra-theoretical mega-scripting forum
Re:Is anyone here good at editing?
« Reply #1 on: 14 Jan 2003, 08:17:50 »
Time to do some experimenting Barron.
Try having OnPlayerKilled.sqs report back:
titletext [format ["%1", _This], "PLAIN DOWN", 2]

that might give you the info that onplayerkilled has to work with.

If you slap a "Killed" eventhandler on everything in sight, you can tally up your own kills.
The EH passes _this which has:
[unitkilled, killingunit]

or you can do something fancy and approximate using the rating.
Dinger/Cfit

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Wow, good one, but...
« Reply #2 on: 15 Jan 2003, 06:05:55 »
Ok, so now I see that OnPlayerKilled has an array with 2 elements: [you, guy who killed you]. I didn't know you could use _this like that. What exactly does _this do? I know it selects the parameters you pass a script, but what else? Anyway, back on topic: what is an event handler? Is it just a trigger? What kind?
Maybe I'm not in the right board, because I'm not that experienced with editing, but so far I've learned pretty easily. From what your saying, it sounds like an OnPlayerKilled script, but for any unit. That would work like a charm. However, I do have around 100 enemy units to kill, so would I have to make 100 different scripts/triggers? I do have a trigger that, using this_list, gives an array of all the enemies. Could I use that?
Oh, and lastly, what do you mean "approximate using the rating"? Do you mean, divide someone's score by whatever I set the rating of each enemy to be (using Addrating)? That also would work, however, do AI teams gather score? And is it by team, or by unit? Remember, I want to know the kills of teams not in your group (but somewhat under your control via the radio).
Thanks for your help! A little more and I'll be in the clear! ;D
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!

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Is anyone here good at editing?
« Reply #3 on: 15 Jan 2003, 21:11:17 »
Ok, I answered almost all my questions using a little bit of research. I found another post that basically asks the same question as me, and the solution is exactly what I'm looking for! Except, there is one minor detail :o: it uses eventhandlers (I now know what they are), but I'm using OFP v1.45! I still haven't gotten resistance :-[.

So that method is out. I looked into score, and learned that only players get score, not AI, so that is out too. Using rating seems to be my best  bet: the only problem, though, is that killing different unit types gives you and your men different amounts of rating points! (A normal soldier gives you 200 points, while a spetznatz gives you 800!) So dividing a units acquired score by 200 or so won't give an exact kill count, though this is better than nothing, so I may just run with it. I'm sure that this is what you were talking about, but it took me a little bit to get it  ;).

Another method I tried was to have a script that is on a perpetual loop, which waits for a unit's rating to increase, then adds 1 to a kill counter. The only problem with this is that if you kill 2+ guys at once (with a grenade, or by taking out a tank), it only gives you one kill.

What would be perfect is if there is any way to change the amount of points/rating a unit gives you when it is killed. I tried addrating, but that only changes a units accquired score, which has nothing to do with how much you get from killing it. Is there a way to change how much you get from killing something? If not, I guess I'm SOL.

Thanks again for the help!  :wave:
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!

Offline Dinger

  • Contributing Member
  • **
  • where's the ultra-theoretical mega-scripting forum
Re:Is anyone here good at editing?
« Reply #4 on: 16 Jan 2003, 05:10:52 »
Hmmm -- yeah there is a way.
You can make mods of all the units, and give them different (and discrete) values.  Then you can tell by the rating what units were killed.
Kind of a PIA, huh?
Welcome to advanced scripting, General Barron.
Dinger/Cfit

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
That's what I was afraid of
« Reply #5 on: 16 Jan 2003, 19:08:59 »
Hah, I figured as much. Oh well, I think I can get close enough using the rating as is. Thanks for your help, Dinger!  ::)
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!