Jump to content
Sign in to follow this  
Smokey

Buses

Recommended Posts

Basically I want to make a very dynamic script.

I have three buses that each follow their own route, stoping for 15 seconds at each bus stop. That seems to work ok.

Next I want to be able to say when an object of type bus, enters the busstop range, all the objects of type men (within a given range) are order aboard.

The key here is how do I get an array of objects within adistance from a given point. There doesn't seem to be a scripting command for that. Any ideas?

Share this post


Link to post
Share on other sites

Make trigger that cover station area - acivated repeatly by anybody with condition :

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

"Bus" countType thislist >0

<span id='postcolor'>

Trigger will be activated only if any bus enters its are. (but there can be problems if another bus enters area with another one already inside)

And then you can execute "getin" script with parameter thislist (that is array of all units in trigger area) from trigger's on activation line :

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

thislist exec "getin.sqs"

<span id='postcolor'>

You must filter these object in your script.

Share this post


Link to post
Share on other sites

Ok, thanks. I think I understand how to use countType now.

Hmm, how do you do quotes in quotes?

" "man" countType [_x] " foreach etc...

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 (Smokey @ Feb. 19 2003,03:50)</td></tr><tr><td id="QUOTE">Hmm, how do you do quotes in quotes?

" "man" countType [_x] " foreach etc...<span id='postcolor'>

I'd suggest using different types of quotes to avoid confusion:

{ "man" countType [_x] } foreach etc...

That should work for sure.

EDIT: In case you're interested I recently made a dynamic AI bus driver & passenger script which creates that nice and lively atmosphere. Here is a sample mission of 4 AI buses and 42 passengers. Feel free to use it.

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  

×