world |
when ever then thing changes to rain or snow etc
i want 3 NPC to change their locations according ot the weather
can some help me or give me any suggestions?
ID:140003
Jun 20 2010, 6:07 am
|
||
here is my DM code..
when ever then thing changes to rain or snow etc i want 3 NPC to change their locations according ot the weather can some help me or give me any suggestions? | ||
#1 Jun 20 2010, 6:13 am
|
|
You would just change their loc. Are you sure you wrote that code by yourself? You should know how to change a location of something if you are able to do that, assuming you aren't borrowing an idea or something of the sort.
| |
hmmm...
no its not mine i found this demo and liked it so i used it... i want it like when the weather changes the location of the NOC changes | |
#3 Jun 20 2010, 12:34 pm
|
|||
Gokussj22 wrote:
This doesn't do what you think it does. What is ACTUALLY happening is that Shower300() is called, then Shower120() is called, then, then Shower600() is called, etc. until they're all called, then it picks between their return values (which are all null). What you want is to remove all these procs, just have one Shower(var/X) proc, and have it sleep(X) and do whatever it is you want it to do. Then, you would do var/time = rand(30,600); Shower(time). Or, use pick() for time if you absolutely MUST have it pick from one of those values. Same with Clear. Anyway, to have your NPCs respond to the weather, either have the area loop through each mob in its contents to call a proc on all the NPCs in it when the weather changes, or have the NPC check its area's weather, like so:
You'd also have to give the Weather area a weather variable to keep track of the current weather, obviously. | |||
Garthor wrote:
Gokussj22 wrote: AND WHAT IS THIS "BLAH BLAH BLAH"?? You'd also have to give the Weather area a weather variable to keep track of the current weather, obviously. anyways thnks very much for making my code flaw less.. but my question was How will i make 3 NPC's change their Location according to weather | |||
"blah blah blah" is whatever it is you want to happen when that condition is met. If you want them to move elsewhere, then that's what it is.
In retrospect, my example should've been the other way around, as I doubt your NPCs would have a constantly-running AI loop. So:
| ||
Garthor wrote:
"blah blah blah" is whatever it is you want to happen when that condition is met. If you want them to move elsewhere, then that's what it is. do i put it to the NPC code?? and btw, i want to change their location | ||
You misunderstand Garthor.
He's expecting you to put forth a minimal effort on your own and display a basic understanding of the language at hand, since without this any effort to help you would be in vain and you'd be better off with just hiring assistance. He won't provide you with a copy and paste-able code snippet and detailed instructions as to where to paste this code into 'your own'. He provided the logic structure and pointed out the main functionality you'd want to look at in order to implement this yourself. | |