Home   Help Search Login Register  

Author Topic: Blood script: excellent  (Read 3976 times)

0 Members and 3 Guests are viewing this topic.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Blood script: excellent
« Reply #15 on: 15 May 2003, 12:16:48 »
Hi,

first i'd like to say that your blood addon was an excellent
idea.

Second:

upon a request from one of my squad m8's i've combined your blood addon with
a script, where you (or anyone else being hit) will die after
a while, unless he's gone for healing.

I thought it could be worth showing you that, so that you
probably gonna implement that too. Maybe so that the
option could be switched on/off by another boolean
(default false).

I've added a script to be executet when it comes to blood,
where the wounded unit's damage value increases.

Code: [Select]
Original parameters:

[] exec "\OFPEC_Blood\blood_init.sqs"; "if ({Man} counttype [_x] == 1) then {_x addeventhandler [{hit},{_this exec {\OFPEC_Blood\blood_squirt.sqs}}]}" forEach thislist


Modified parameters to be used with damage increasing:


[] exec "\OFPEC_Blood\blood_init.sqs"; "if ({Man} counttype [_x] == 1) then {_x addeventhandler [{hit},{_this exec {\OFPEC_Blood\blood_squirt.sqs},_this select 0 exec {injured.sqs}}]}" forEach thislist


Off course you also need a script called INJURED.SQS then.

<<injured.sqs>>

_man = _this
_inc = 0.001
;note - _inc is the value, which will be added every
;second to the unit's damage
;by altering _inc, you can define how slow/fast
;units gonna die

#loop

?(not alive _man): goto "end"

?(getdammage _man < 0.1): goto "end"

_man setdammage (getdammage _man + _inc)

~1

goto "loop"

#end

exit

:edit - ah yeah and i've attached an example mission,
where you just need to hit some of your guys and
let them bleed till death or send them for healing
to revitalize.

hope this makes some sense

~S~ CD
« Last Edit: 15 May 2003, 12:57:15 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

asmodeus

  • Guest
Re:Blood script: excellent
« Reply #16 on: 15 May 2003, 14:44:35 »
Cool idea Chris!   8)

I just got done working on the blood models some more...  It's lookin a little better I think.  (We'll see what snYpir thinks)   ;)

I'll have a look at this example mission!   ;)

Asmo

Offline snYpir

  • BIS Team
  • ****
  • OFPEC Jedi Master
    • OFPEC
Re:Blood script: excellent
« Reply #17 on: 16 May 2003, 07:03:46 »
Chris - thanks for the idea ;)

I have implemented it in version 1.3 (yet to be released).

Asmo - reading your emails.

will be back...
Bohemia Interactive Simulations

B-2-0

  • Guest
Re:Blood script: excellent
« Reply #18 on: 16 May 2003, 08:55:28 »
It would be really cool if someone could make an animation where the soldier, only when hit by a head-shot, falls to his knees, stays there for a sec with a nice blood spurt from the head, then falls flat!! ;D

Surely we all agree that it's nice to know when you have scored a direct head-shot and this would look really cool thru the scope of a sniper rifle!! ;D

Could it be done??

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:Blood script: excellent
« Reply #19 on: 20 May 2003, 14:44:16 »
This message to say how cool I find the blood add-on, and thank you for crediting me whereas you did all the improvements. I also tried Mr. Death's suggestion, and it does add a lot of fun to the whole thing. One could even imagine to increase the increment as the unit gets more damage. Something like :

?(getdammage _man)>0.8:_inc=0.05

Anyway, this creates quite a strong enticement to find a medic, and I hope that the injured.sqs script will be integrated to the add-on soon, and that the final version will be up for download here on this site.

Just let me express two regrets :
1) aren't the blood drops a little too big ?
2) I remember that you snYpir said in one of your Tuts that add-ons, when compared to scripts, were **** (it was smarter than this, but you get the picture  ;)). It took me time to agree with this, but now I fully endorse this idea. Since then, I've been trying to create FX or new sensations WITHOUT add-ons, and I can't help feeling that this blood thing would be "ultimate" if it were only a script (sorry Asmodeus, nothing personal, it's just that my add-on repertory has devoured half of my CPU's memory !!)

Anyway, great job, thx again.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Blood script: excellent
« Reply #20 on: 20 May 2003, 16:03:29 »
Thx for welcomming the idea of implementing the injured.sqs

I'd like to enhance the script though, because it was just
the idea of showing you what i could imagine to be included
to the blood_addon.

I'll try to reach my comp and create another injured.sqs,
where there will be a random possibility that the script
exits, and maybe some kind'a message so that the player
gets informed about his increasing wounds (wouldn't you
wonder about getting hit on the toe and dying after 5 mins
when all enemies already were killed?).

Also when a unit gets hit twice or tripple times, the unit will
run injured scripts of the same number of hits.
I'm not sure if this is good or not.

Some might say: if he gets hit 3 times, then why shouldn't he
die 3 times faster

and some might say: after getting hit 3 times you won't find
a medic/mash that quick that you can heal your wounds.

Maybe this could become an option to be enabled/disabled
aswell by a boolean -> gimmie some input here <-

:edit

OK, i've just seen you've already released the final version
and you've yet implemented it to be userfriendly modified.
  ;D

~S~ CD
« Last Edit: 20 May 2003, 16:16:17 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:Blood script: excellent
« Reply #21 on: 20 May 2003, 16:19:46 »
Well I think snYpir has already fixed it all  ;D

http://ofp.gamezone.cz/index.php?newlang=eng

« Last Edit: 20 May 2003, 16:22:28 by Igor Drukov »

Offline snYpir

  • BIS Team
  • ****
  • OFPEC Jedi Master
    • OFPEC
Re:Blood script: excellent
« Reply #22 on: 20 May 2003, 23:14:07 »
Yes, I am now out of the blood game. It was fun while it lasted.

Igor - thanks for the idea in the first place. You got it all started ;D

Asmo - thanks for your help. If there are any more blood objects, we'll release them as a 'blood pack'.

The next time you'll see blood raising it's ugly head is when it is incorporated into the super config a few of us are making.
Bohemia Interactive Simulations

Rubble_Maker

  • Guest
Re:Blood script: excellent
« Reply #23 on: 22 May 2003, 15:45:02 »
Well the blood addon is really excellent, the only prob is that I can hardly use it. Made a small mission yesterday with like 40 east and west units fighting, and the game was nearly unplayable - although I have a 1.2 Ghz pentium with Radeon 9700 Pro!

Well dont have the time to do it myself now, but someone really should take a look at this addon and OPTIMIZE it. For example, do a very simple culling of invisible units. if the player can't see the unit, there's no need to display the effect. This can be done by using simple trigonometry; at the very beginning of the hit EH, just check if the unit's coordinates are inside the player's field of view (two line equations in point-normal form, then check which side of the lines the unit is to determine wether its inside the 2-dim FOV or not).
There's also a number of subtle optimizations that could be done to make the overall thing simpler (for example, I absolutely see no reason for that "monitor" script, it only takes up CPU resources).  In the blood_spawn_particles script I see absolutely no delay, which is prolly the main reason why it adds so much lag. Either make it a while loop construct if you're sure you cannot have a slight delay, or put something like
~.001
into the loop. If there is no delay at all, four or five scripts running simultaneously will goggle all the CPU resources that the engine has left.


asmodeus

  • Guest
Re:Blood script: excellent
« Reply #24 on: 23 May 2003, 00:58:05 »
Good ideas Rubble Maker!

We'll see what snYpir has to say about that..

I was just curious.. Were you still experiencing lag after changing the settings like the number of blood objects, max number, delay time and such?  

I must admit that I also experience some lag on bigger battles and I like the idea's here.  

It makes sense to turn off the particles if you can't see them...  The only problem I see for that is MP, or would it be able to consider each player and what they can see in that situation?  (let me know if I'm making any sense)   ::)

@ snYpir

Quote
Asmo - thanks for your help. If there are any more blood objects, we'll release them as a 'blood pack'.

You're welcome!  I'll let you know about the blood objects, I do have a few things in the works at this point.   ;)

V1.4 is looking good!   ;D  I've made a couple notes of small things I've noticed and I'll send them to you soon.   ;)

@ Chris Death

It's definately cool to have the option to add that extra difficulty factor and realism of bleeding to death.  Good stuff!   ;D

Asmo
« Last Edit: 23 May 2003, 00:59:24 by Asmodeus »

Offline snYpir

  • BIS Team
  • ****
  • OFPEC Jedi Master
    • OFPEC
Re:Blood script: excellent
« Reply #25 on: 23 May 2003, 08:40:49 »
Chris Death - I have implemented a basic damage from bloodloss system. It is basic because there is no feedback to the user that they are dying from bloodloss. If you can work out a way that looks nice, I'd be happy to make version 1.5, and credit you appropriately ;)

Quote
Well dont have the time to do it myself now, but someone really should take a look at this addon and OPTIMIZE it.

Hehe I'd like to see you try. Do you  think I haven't?

Think about what we are trying to do: Create up to 40 or so new objects for everytime a unit in the game is hit. Even at a maximum object count of only 500 or so, the processor still needs to work out where these are for every frame that is produced.  This, unfortunately, sucks frame rate.

Even though I monitor every blood splat that is created, if 100 units are hit at the same time, up to 100 * 40 = 4000 blood objects will be created. It then takes time for the scripts to remove however many blood objects need to be removed in order to match the 'blood_object_maximum' variable.

The script is customisable by global variables - you can easily lower the number of blood objects created to suit.

Putting a pause in spawn_particles will do nothing except make the blood look like it is flowing out of the unit, whereas realistically the blood will come out like a shotgun blast due to transfer of momentum.

If you've ever shot a pig with a shotgun, you'll know what i mean. It is a spray, not a trickle.

spawn_particle will only loop 10 or so times in any case.

If you can make a script that spawns hundreds of objects from particles, and then monitors all of these objects in order to make them dissappear after a certain amount of time, and keep the frame rate unhindered, then I take my hat off to you ;D
« Last Edit: 23 May 2003, 08:48:02 by snYpir »
Bohemia Interactive Simulations

Offline Kuro

  • Former Staff
  • ****
  • 2./FschJgBtl 251 Green Devils
    • VBS2 Mission Download Site
Re:Blood script: excellent
« Reply #26 on: 26 May 2003, 06:18:43 »
By the way i have reworked the Clean Sweep Mission to include the Blood script. Every body interested in it  can download it in the Mission Beta Forum.

WolfFlight

  • Guest
Re:Blood script: excellent
« Reply #27 on: 26 May 2003, 23:08:01 »
I love the blood addon

using it to track a wounded enemy thru their blood trail is the perfect concept

all those missions where everyone spends so darn much time trying to find the wounded guy who went off and hid so that the mission will finally end
will be so much easier using simple tracking based on blood loss

of course smaller machines might have trouble if there are lots of wounded around cuz of the limit of blood particles displayed

having a wounded enemy finally die of blood loss will solve some of those issues as well... after a given amount of time without medical assistance those enemy will finally die anyway



thanks for a great addon

now... to my problem...

I made a simple DM mission based on the DM-Ruins with blood added for testing...

I inserted the trigger...

I have my MP enabler

when I shoot an AI blood goes everywhere

when they shoot me and wound me... blood flies and I leave blood trails as I move... as do they if I only wound them...

now....
export mission to multiplayer
same thing happens...GREAT

except...

any unit that spawns...including myself... no longer leaves blood
back to the original animation
no blood splatter
no trail
nothing

????

I haven't gotten the new config yet...
I am sure that will change some of this as it will make every unit bleed all the time?? without the trigger and MP enabler??

solution??


Offline snYpir

  • BIS Team
  • ****
  • OFPEC Jedi Master
    • OFPEC
Re:Blood script: excellent
« Reply #28 on: 27 May 2003, 01:07:25 »
check the readme ;)

u need to manually add the eventhandler to spawned units.
Bohemia Interactive Simulations

WolfFlight

  • Guest
Re:Blood script: excellent
« Reply #29 on: 27 May 2003, 02:45:58 »
ah.... well there is that I suppose

but by installing the config took care of that problem

all units all the time have blood

I gotta say again... great addon

goes right up there with the utility pack you made for arty and airstrikes...

just what the 'sniper' ordered... rofl
 :o