Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
BaronVonRed

Advanced question

Recommended Posts

I searched the forum using "hide bodies" and came up with nothing  sad.gif

Here is the scenario:

* I have some soldiers in an array.

* I have a script where other soldiers will detect that one of the others is dead and will sound the alarm IF the player doesn't hide the body.

* However, if the player DOES hide the body, it doesn't get removed from the array and this causes problems down the road with other scripts.

Thus, my question is: How do I detect that the body is no longer in existence so I can remove it from the array?

<ADDITIONAL DETAILS>

The process that gets into trouble is where the sentry comes out and does a check by running through all the elements in the array and checking to see if they are dead. If they are, then HE sounds the alarm, but there is no body!?!? Here is that script (exerpt):

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#

#Now see if any local civs know about other civs assigned to

#their zone and are dead

#

if((_civ1 in mycivs) and (!alive _civ1) and  ((_civ2 knowsabout theplayer > 2) or (_civ3 knowsabout theplayer > 2)))

then {allflee=true; allfleetime=time}

<span id='postcolor'>

It works GREAT with the other soldiers because they are physically looking for the body, meaning they are not using the array:

((!alive victim) and (soldier distance victim < 10))

Any ideas? I know it is probably something stupid that I am overlooking, and I am standing with hat-in-hand  confused.gif

Share this post


Link to post
Share on other sites

remove the dead bodies when they are sunk into the ground

this should solve it.

This can be done timed. So let´s say 2 secs after body has been sunk into ground.

Alternative way:

Check the dead bodies height in comparison to guards height. If the height is lower than the actual guard height plus minus 1 or 2 it should do the trick.

Make sure the array is updated in a very short loop so array is cleared of unpresent bodies.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Balschoiw @ Dec. 01 2002,00:45)</td></tr><tr><td id="QUOTE">remove the dead bodies when they are sunk into the ground

this should solve it.

This can be done timed. So let´s say 2 secs after body has been sunk into ground.<span id='postcolor'>

I see what you mean, but how do I detect that they have been sunk?

Share this post


Link to post
Share on other sites

If body is digged, its Z position is less then -1.

condition : getPos soldier select 2 < -0.9

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Bart.Jan @ Dec. 01 2002,01:26)</td></tr><tr><td id="QUOTE">If body is digged, its Z position is less then -1.

condition : getPos soldier select 2 < -0.9<span id='postcolor'>

wink.gif

Unbelievable! I was just now experimenting with that based on what Bals said earlier to see if I could do it and I noticed after I killed a guy, his position went negative, but it was VERY close to neg when he was alive (0.001083), so I thought, eh! But you have confirmed it for me - THANK YOU!

Guys like you and Bals keep this forum alive and KICKIN!

Share this post


Link to post
Share on other sites

wow.gif

upcoming christmas time makes people say weird and lovely things, doesn´t it  biggrin.gif

BTW i made sure this year that noone else but me will get presents tounge.gif

                            |||||||||||||||

                            vvvvvvvvvvv

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Balschoiw @ Nov. 30 2002,20:18)</td></tr><tr><td id="QUOTE">wow.gif

upcoming christmas time makes people say weird and lovely things, doesn´t it biggrin.gif

BTW i made sure this year that noone else but me will get presents tounge.gif

|||||||||||||||

vvvvvvvvvvv<span id='postcolor'>

lol,

every time I see things like that picture I realize just how weird some ideas are, and am reminded about the fact that there are after all, billions of people to come up with them. biggrin.gif

This 0.000000015887% of homo sapien sapien species is going to bed (hohoho, and he doesn't have to make his bed every day).

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×