Jump to content
Sign in to follow this  
D.murphy man

Busy pavements (side walks) and roads?

Recommended Posts

Hey all,

With my little time i have for OFP these days i am thinking about making a nice little project with my spare time.

A livining city!

Now theres one thign i need to make before i can start this project.A script for civilians to randomly walking around and Cars to randomly drive around the roads with out crashing.

Now for the civillian bit i was thiking about somthing like this:

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

#start

_x=random 100

_y=random 100

_z=random 100

_man=_this select 0

_time=random 50

_man domove [_x,_y,_z]

~_Time

goto "start"

Now for some reason this dose not work. I have not much expirience with Random command so i might be doing somthing wrong.The civilian "test subject" did not move at all and no warning was given.

As for making the cars drive acros the road,I have no idea how i might do that.If it is possible at all!?

Thanks for your help in advance.

Allso i would like some ideas for a possible mission in this living city? I was thinking somthing like you are leader of a terrorist orginisation and must fight a secret war agaisnt the Evil neo Nazi goverment. Or somthing like that.

Should be fun wen complete biggrin_o.gif

Share this post


Link to post
Share on other sites

Remember the x,y,z values on map are normally 0 -12800m left to right and bottom to top (x,y) z is the elevation above sea level and I would leave that at 0.

So if you tell someone to move to say [50,50,50] they will just report can't get there, since it's in the lower left part of the map on the acid sea. Try something like

#start

_x=random 100

_y=random 100

_z=random 100

_man=_this select 0

_time=random 50

_man domove [((getpos _man) select 0) + _x -50 ,((getpos _man) select 1) + _y -50,_z]

~_Time

goto "start"

Share this post


Link to post
Share on other sites

Hi,

I've been thinking about a similar idea, but more of how to keep a living Island supplied.

I thought waypoints would be the best way to get someone to move from A to B? The problem lies with creating the AI population only when they can be seen by the player.

My idea is to maintain a Diary for every character:

Jim the bus drivers, get up at 7:00 hours, Leaves his house at 7:30, and arrives at the bus depot at 8:00.

This way if you the player, are half way between Jim's house and the bus depot at 7:45, you should see him going to work. If you attack his car, he will be late. If you are nowhere near, it's assumed he got there ok and Jim is never created.

The rest is trying to figure out what happens, if or when he does make it to work, and how to check and update all of the relevant inhabitants who use Jim’s bus service,  along with everyone in the players (players AI if he has any) proximity, without slowing down the entire game.

Share this post


Link to post
Share on other sites
Offtopic, but - Why not keep going with the Skye Virus project?

Iv spent 3 years of my OFP life working on and towards the skye virus. Belive me it gets a bit boring. So i desided to start on fresh projects intill i get inspired to work on the skye virus again.

If i start working on it now i lack the motovation and inspreation to do it witch would mean it be a shit job so instead im gonna work on some frsh ideas.

As for the rest of you..

Thnx Bn880,as all ways your a great help biggrin_o.gif I will got test it now. And good ideas wilson but like you said it would be a big proplem sorting out the lag and other proplems so i think ill just stick to one city for now.

All tohugh i had my idea for a living island.How about you have load zones for every city and every lil group of villages.So you enter a City and it blacks out and says "Loading.." in this time it will cam create all the civs and cars,then wen u leave the city it will say "Loading.." again and it will delete all the civs and cars and load up all the civs and cars in the bitr you are entering.

Share this post


Link to post
Share on other sites

OK i tested out what Bn880 said but.. They dont walk,they only run.And before you say use the setbehaviour or setspeedmode command both of them seem to have no effect.I been trying for about a hour now trying to get them to walk but as of yet no sucess crazy_o.gif .

Any ideas on why the hell they wont walk?! coz it looks kinda strange all these civies running around in a city.

Share this post


Link to post
Share on other sites

Just make them so badly injured they have to crawl biggrin_o.gif

j/k, sorry for not beeing a big help sad_o.gif

Share this post


Link to post
Share on other sites
OK i tested out what Bn880 said but.. They dont walk,they only run.And before you say use the setbehaviour or setspeedmode command both of them seem to have no effect.I been trying for about a hour now trying to get them to walk but as of yet no sucess crazy_o.gif .

Any ideas on why the hell they wont walk?! coz it looks kinda strange all these civies running around in a city.

use 'move' instead of 'domove'. Then the setbehaviour and setspeedmode functions will take affect.

Share this post


Link to post
Share on other sites

AhhhHH i didnt kno that. Cheers mate biggrin_o.gif That will allso solve a proplem in my RTS test mission.

Share this post


Link to post
Share on other sites
Quote[/b] ]And good ideas wilson but like you said it would be a big proplem sorting out the lag and other proplems so i think ill just stick to one city for now.

Of course, just thought they were similar problems. Even in a city there must be somethings going on, you may never get to see?

Its something I've been toying with as I learn more about OFP scripts. Your cutscene idea may be the best, I dont think you can create that many objects on the fly, without lag?

Are you handling all the logic that checks to see when each destination is reached using the move command? How complex are the paths your setting up?

Cheers

Share this post


Link to post
Share on other sites
Quote[/b] ]Its something I've been toying with as I learn more about OFP scripts. Your cutscene idea may be the best, I dont think you can create that many objects on the fly, without lag?

There would be Huge lag with my idea,Thats why i said make it Black out first and say "Loading.." so that it will cover the lag of creating the object at the same time.Then at the end of the units being created simply make it back in again.I might test this idea out after i made my lving city.

Quote[/b] ]Are you handling all the logic that checks to see when each destination is reached using the move command? How complex are the paths your setting up?

Im intirly sure what you mean,I am just useing the script that BN880 did for me (Great thnx to him) witch is completly random script.So there is no Set path the civilians just walk around in random directions.And if they go out side the city limits they will get teleported back to the town center.

Hope that answers your questions.

Cheers,

     Murphy.

Edit:

I tohught id tell what iv done so far too.

Well the city i am useing is Lipany (Nogova island) So far i have placed all the civilians(all with the random walk script) and i have done a Bank.

The bank is where you can withdraw and put money into your bank account.As well as the bank account you have a "Wallet" witch is basically the money witch you can carry around the streets with you.

Whats that i hear u ask?? "Whats the point of a bank account if you got a wallet??"

Well your wallet can only carry 1000 at any one time,allso the bank account is where the "Tax man" takes money of you.Every ten minuts of real life time you must pay 100 to the tax man.

"But what if you dnt have enough money to pay the taxes?!"

Well the tax man reposes your house,and the police come after you to beat you to a bloody polp and throw u into prision for a while.

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  

×