Home   Help Search Login Register  

Author Topic: adding score when movin over penguins  (Read 762 times)

0 Members and 1 Guest are viewing this topic.

Commando

  • Guest
adding score when movin over penguins
« on: 08 Mar 2005, 18:53:57 »
Hi all i wonder how do i do if i want to have a scoring system for players that gives them a point after every penguin they drive over?  ;D

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:adding score when movin over penguins
« Reply #1 on: 08 Mar 2005, 19:32:05 »
well, first of all i'm reporting you to the Penguin Protection Squad.

secondly, i would suggest doing it thus:

use getin and getout event handlers on whichever vehicles are likely to be used for this appalling escapade. set a global variable called in_vehicle. set this variable to true on getin, false on getout.

secondly, create a script which loops around all the poor defenceless little penguins and checks both if the distance between player and penguin is less than... ooh 2 metres would do it, and also that in_vehicle is true.

if both of those are the case for any of the picked-upon penguins, then call some other script which deals with the demise of these innocent and cuddly animals, and then adds a paltry and wholly undeserved point to the player, with a player addrating 1 command.

i'm telling the polar bears on you.... :P

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:adding score when movin over penguins
« Reply #2 on: 08 Mar 2005, 20:08:13 »
Does penguinman know about this??


Planck
I know a little about a lot, and a lot about a little.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:adding score when movin over penguins
« Reply #3 on: 08 Mar 2005, 20:25:12 »
Quote
i'm telling the polar bears on you....
But Polar Bears have never seen a penguin

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:adding score when movin over penguins
« Reply #4 on: 08 Mar 2005, 20:39:02 »
all the more reason why they should be told, don't you think?

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:adding score when movin over penguins
« Reply #5 on: 08 Mar 2005, 21:40:30 »
Lol

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:adding score when movin over penguins
« Reply #6 on: 09 Mar 2005, 01:09:14 »
Pah!   What a pathetic mission!   Any fool can drive over a penguin....  Now if it was driving over polar bears, then I'd be impressed.    ;D ;D ;D

bedges' answer sounds about right.

PS - if you were to introduce a polar bear to a penguin, I've got 50p that says the polar bear eats him before you can say "chocolate biscuit".
« Last Edit: 09 Mar 2005, 01:10:18 by macguba »
Plenty of reviewed ArmA missions for you to play

Commando

  • Guest
Re:adding score when movin over penguins
« Reply #7 on: 09 Mar 2005, 21:42:45 »
 ;D thx for all the happy replies, is there any easier way? becaus ei don't know squat about writing a script from scratch  :-[
haha lol my non ofp playing friend wants me to do a race mission in gta style where you drive over penguins and the race track is all walled in  ::)
i said to him i will give it a go but this seems more difficult than putting togheter a coop  :P

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:adding score when movin over penguins
« Reply #8 on: 09 Mar 2005, 22:36:25 »
create a group of penguins. in the init line of the lead penguin put

Code: [Select]
penguins = group this
create a vehicle and call it car_name.

open up notepad and copy/paste the following:

Code: [Select]
;check penguins

stop_checking = false

#start
_units = units penguins
_imax = count _units
_i = 0
#loop
?(_units select _i) distance player <4:[_units select _i] exec "splat.sqs"
_i=_i+1
?not (_i >= _imax):goto "loop"
~1
?not (stop_checking):goto "start"

exit

save that as "check_penguins.sqs"

open up a fresh notepad and copy/paste the following:

Code: [Select]
;splat

_whosplat = _this select 0
_whosplat switchmove "FXDismay"
_whosplat setdamage 1
_b="shell" camcreate getpos _whosplat
[_whosplat] join grpnull
player addrating 1
hint "Be kind to all animals, virtual or otherwise"

exit

save that as "splat.sqs"

in the init.sqs file, copy and paste the following:

Code: [Select]
car_name AddEventHandler ["getin",{[] exec "check_penguins.sqs"}]
car_name AddEventHandler ["getout",{stop_checking = true}]

save and preview.
« Last Edit: 09 Mar 2005, 22:37:43 by bedges »

Commando

  • Guest
Re:adding score when movin over penguins
« Reply #9 on: 09 Mar 2005, 23:03:55 »
thx for the script! I tried writing car_car1 but it didn't work but then it worked when i had car_name as you had written it  ;D ( i thought that the _name could be any name i could think of because it was in italics  ;D )

very nice script great thx  :) i think the thread is solved now  8)
btw liked the little explosion effect that  came with it too , that was more than i wanted to have but hey it was very cool  :D
« Last Edit: 09 Mar 2005, 23:04:34 by Commando »