Home   Help Search Login Register  

Author Topic: Infection  (Read 1063 times)

0 Members and 1 Guest are viewing this topic.

sjickells

  • Guest
Infection
« on: 24 Oct 2002, 14:36:57 »
I have just started development of a military research gone wrong campaign and I have run into a bit of a stumbling block! Basically East have been experimenting and developed a virus that turn people into zombie,etc.

Not giving too much away I need a script that will tell if a zombie is very close to a player and inflict some damage. maybe even infect them?

Anybody any ideas?

Bremmer

  • Guest
Re:Infection
« Reply #1 on: 24 Oct 2002, 16:17:16 »
Interesting idea - I like it!

Heres how I would go about it:

First define an array of infected units in your init file. At the start this might be quite small - just a couple of units. eg.

infected = [man1,man2]

Now for every other unit that is liable to be infected you can run a small background check script. There may be dozens of these scripts running, but it shouldn't affect performance providing we are smart about it. Here's the sort of thing I'm thinking about:


;call the script by placing a trigger over everyone on your map
;make it anyone present and leave condition as this
;set On Activation to "[_x] exec ""infected.sqs""" foreach thislist

;get the unit to check
_unit = _this select 0
;a random delay so multiple scripts do not run cocurrently
~(random 10)

#loop
~10
? _unit in infected : _unit sedammage (getdammage _unit + 0.01); goto "loop"
;need to make the checked unit a global variable to work with count command
;this shouldn't be required after v1.85
checkthis = _unit
? "checkthis distance _x < 20" count infected > 0 : infected = infected + [_unit]
goto "loop"


This will kill any infected unit approximately 17min after it first becomes infected. It would probably be worth randomising the damage done on each loop such that some units die faster than others. You should also probaly have some way of exiting the script (eg if the player puts on proctective gear of discover a vaccine) and some way of removing units from the infected list (if they are successfully treated). Great idea - its really got me thinking (more biological warfare tha zombies, but same sort of idea).

Good luck.
« Last Edit: 24 Oct 2002, 16:19:43 by Bremmer »

sjickells

  • Guest
Re:Infection
« Reply #2 on: 24 Oct 2002, 17:59:45 »
I'll be trying that tonight.... cheers Bremmer

Bremmer

  • Guest
Re:Infection
« Reply #3 on: 24 Oct 2002, 18:42:54 »
This has really got my creative juices flowing (I think thats what the puddle is anyway  ;)). Heres a slightly more advanced version of the script. The infection starts off quite benign, but lapses into a fatal state after a random amount of time. The chance of infection is also more random, and is based on the closeness of the nearest infectious unit. Still lots of possible improvements, and this is all totally untested, but I think this is a good starting point.


;set up these arrays in the init file
;infected = [man_1, man_2]
;deathstage = []
;immune = []

;-------------------------------------- Define Variables -----------------------------------

_unit = _this select 0
~(random 10)

;----------------------------------------- Main Loop ---------------------------------------

#loop
? count infected == 0 : exit
~10
? _unit in infected : goto "infected"
? _unit in immune : goto "loop"
? "_unit distance _x < 25" count infected > 0 : goto "infection"
goto "loop"

;------------------------------------- Check Infected Units --------------------------------

#infected
? _unit in deathstage : _unit setdammage (getdammage _unit + (random 0.05)); goto "loop"
? random 100 < 1 : deathstage = deathstage + [_unit]
goto "loop"

;--------------------------------- Check Whether to Infect Unit ----------------------------

#infection
_dist = 25
_i = (count infected) - 1

#nearest
_unclean = infected select _i
? _unit distance _unclean < _dist : _dist = _unit distance _unclean
_i = _i - 1
? _i >= 0 : goto "nearest"

? random 25 > _dist : infected = infected + [_unit]
goto "loop"


I'll pitch my idea for a small campaign here as well:

The government has been experimenting with new 'improved' plague as a biological weapon. Unfortunately things go wrong and some scientists and guards are infected. Instead of offering help the government confines the area and sends in observers (and guards) to monitor the effects - the outbreak becomes one big experiment. The stage is set for an island wide fight between those trying to get hold of an antidote, and those trying to stop them. There is great possibility for a fork in the campaign, with the player starting off as one of those sent to guard the observers, but with the possibility of being forced to join the other side if they become infected.

Any opinions ?

 :)
« Last Edit: 24 Oct 2002, 22:34:28 by Bremmer »

Spliff air

  • Guest
Re:Infection
« Reply #4 on: 24 Oct 2002, 18:47:46 »
no offence but isnt your idea copying Half Life The Thing and Resident Evil

Bremmer

  • Guest
Re:Infection
« Reply #5 on: 24 Oct 2002, 18:55:27 »
Spliff air - If you are talking about my idea, then:

Half Life - never played it.

The Thing - No not really - That was one creature against everyone else.

Resident Evil - Sort of I guess, except that the infected guys would be just normal guys trying to stay alive. In fact the side keeping them from the vaccines they need would be the real bad guys. In fact no - It would be nothing like Resident Evil.

 :-\

Offline Arctic

  • Members
  • *
  • In Utero
Re:Infection
« Reply #6 on: 24 Oct 2002, 23:16:45 »
It would be cool if you made an animation for the infected people as they died.

You could use that animation editor thing.......  ;)

Spliff air

  • Guest
Re:Infection
« Reply #7 on: 27 Oct 2002, 14:28:51 »
what i meant by the thing was the game when your comrades get infected and you do blood tests on them to see if they are infected and half life well i cant exspain it but play it for your self and u will understand