Jump to content
Sign in to follow this  
lonesoldier

Creating a unit

Recommended Posts

How?

I need it for my Resident Evil style mission.

Ive got the player walking into the house, and need a civillian created behind the player, then walk up to him and strokefist him.

How is this possible?

Share this post


Link to post
Share on other sites

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

"Civilian" createUnit [getMarkerPos "house" , zombies, "houseZombie=this"]

~1

houseZombie move getPos player

@houseZombie distance player <2

houseZombie action ["strokefist"]

These are the basics you need.

Share this post


Link to post
Share on other sites

Cheers man!

EDIT - No civillian appears at my specified marker...

I dont get any errors either.

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"Civilian" createUnit [getMarkerPos "house" ,zobies, "houseZombie=this"]

~0.5

[houseZombie] join grpnull

~0.5

houseZombie move getPos player

@houseZombie distance player <2

houseZombie action ["strokefist"]

First make a unit on the map (out of site) and put this in its init field:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">zombies = group this

RED

Share this post


Link to post
Share on other sites

To make the "zombie" move, would it not be <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">houseZombie domove getpos player and not <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">houseZombie move getpos player

Or does it not really matter?

[Gareth Gates must die]

Share this post


Link to post
Share on other sites

write <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"Civilian" createUnit [getMarkerPos "house" ,zombies, "houseZombie=this"]

mind the M in zombies!

@skul: i think in this case it doesnt really matter.

Share this post


Link to post
Share on other sites
write <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"Civilian" createUnit [getMarkerPos "house" ,zombies, "houseZombie=this"]

mind the M in zombies!

Thanks. Post updated.

@LoneSoldier:

you need marker "house"

and then do it RED's way or place civilian on the map and into his init line put:

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

zombies = group this; deletevehicle this

Share this post


Link to post
Share on other sites

WOO!!! THANKS!!!!!!!!!!!!!!!!!!!!!!112!!!1@!

Also!

Is it possible to make them continually strokefist? (until i blow them away)

Share this post


Link to post
Share on other sites

I'm not up on looping but;

#loop

housezombie action ["strokeFist"]

~2

goto "loop"

put this in the trigger; [] exec "#loop"

I tested it and unit does strokefist every two seconds, just change that number....hope this helps.

smile_o.gif

You might be able to use something like this for your other question. Will be an interesting mission.

Share this post


Link to post
Share on other sites

Cheers buddy!  biggrin_o.gif

*EDIT*

Ok, it works.

Here's the script that makes the zombies look like theyre eating:

#loop

eat1 switchmove "PutDownToCombat"

?(eat1 knowsAbout aP >0): goto "end"

?(eat2 knowsAbout aP >0): goto "end"

eat2 switchmove "PutDownToCombat"

goto "loop"

#end

exit

See the bits in Bold, that detects if they know about me.

And when it does they stand up, but with thier hands in a "holding gun" stance. As if they have weapons in thier hands.

I just need the animation to end when i am seen by them, how can i do that?

Also, one more simple question.

How can i put a Truck onto its side? I need it to look like the truck has skidded and slipped over.

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  

×