Ok here is my problem, I have cars coded in and when I coded in my Monster A.I (for monsters), my cars start going crazy and attack players along with the monsters.
Any suggestions?
1
2
ID:171000
Nov 23 2004, 2:03 pm
|
|
In response to Hell Ramen
|
|
Yes they are and Ok.
mob |
In response to Chwgt
|
|
Are the cars mobs?
|
In response to Chwgt
|
|
Try making what you want each different mob type, a different thing.
Example: mob By the way...its and ... not (DM) and (/DM) |
In response to Hell Ramen
|
|
yes
|
In response to N1ghtW1ng
|
|
The verb is in the battle system dm i made and i want you to attack monsters same way you would attack a player do you want to see my battle system?
|
In response to Chwgt
|
|
Make it like.
/mob/monster/<insert stuff here> /mob/car/<insert stuff here> |
In response to Hell Ramen
|
|
Hell Ramen wrote:
Make it like. How do you mean like /mob/car/<?> |
In response to Chwgt
|
|
Know how you did mob/monster?
Move the New() proc into it. |
In response to Hell Ramen
|
|
so it would be
mob/monster/<mob If not plz fix - -" |
In response to Chwgt
|
|
...
Take the "<" and ">" and the "mob" part(the second one) |
In response to Hell Ramen
|
|
K fixed but now it's giving me proc definetion allowed inside another on this right here.
ai_random_wander() Any suggestion's to this newb coder? |
In response to Chwgt
|
|
ai_random_wander()
if(src.key) return else walk_rand(src,5) src.ai_run_away() spawn(10)ai_random_wander() Try that, I really don't know though. |
In response to Chwgt
|
|
Should be:
mob/monster You don't need to check for "if(!client)"(The "!" operator basically means not), unless you're planning on making players into mob/monster types. |
In response to Hell Ramen
|
|
Yeah..those errors are caused by indentation errors, you called a proc, and then indented the next line wrong(is what is usually wrong)
|
In response to Chwgt
|
|
Well, first of all, you need to prevent an infinite loop, so you'd better add while(src):
mob/proc/ai_random_wander() Of course, since you're using mob/monster, I'd suggest: mob/monster/proc/ai_random_wander() |
In response to Lenox
|
|
Ok guys if you can read this and try and correct it for me I have to work on another game and if I cant get this A.I system im probally gonna give up on the game im working on it for. (Sorry if there are grammer errors I wuz typing fast becouse im rushing)
mob/monster |
In response to Chwgt
|
|
Look, you can't just post code like that and expect us to correct it. If you don't tell us what's wrong, we can't help. Still, just browsing through the code, I see ways to improve it, and a couple errors to be fixed. Here's the correct code:
mob/monster//These procs will only be used by mob/monsters, so these should obviously be mob/monster procs. Keep in mind that I haven't fully checked for functionality, but just for correct coding. In other words, it's organized, and won't output runtimes, but I didn't look at it thouroughly enough to prevent runtimes. If you coded it right in the first place, however, there won't be any runtimes. If there are, this time, I want you to try and fix it yourself before you post on the forum. If you've tried and you honestly can't, then post the error and we'll see what we can do. |
In response to Wizkidd0123
|
|
Argh, Wizkidd, you beat me to it, I was still trying to fix the stupid indentations >_<. But your indentations seemed off(directed towards the creator of the code). One proc, the proc name was "further indented" past the actual proc(which I believe would cause an error). At first, I couldn't tell if it was actually a proc, or if you were just calling a proc named that until you posted the full code and I saw that there was nothing before it >_<.
|
1
2
Show us the coding, we can't really help if we don't know anything.