ID:149994
 
I want to make it so that when I walk into a room some it says GET HIM GUYS!!! and it creates 3 guys that come attack you. Here is my code.


area/baddyspop
var/destination
var/baddy
Entered(mob/m)
usr << "GET HIM GUYS!"
baddy = new /mob/baddys/Henchmen()
var/baddylocation = locate(26,9,1)
baddy = baddylocation


what the prob




TK6000 wrote:
I want to make it so that when I walk into a room some it says GET HIM GUYS!!! and it creates 3 guys that come attack you. Here is my code.


area/baddyspop
var/destination
var/baddy
Entered(mob/m)
usr << "GET HIM GUYS!"
baddy = new /mob/baddys/Henchmen()
var/baddylocation = locate(26,9,1)
baddy = baddylocation


what the prob

A few things...for one, the last line doesn't move the mob. You actually want to call baddy.Move().

Next, the bad guys themselves will probably trigger area.Entered(), so you want to do a check to see if m.client exists before you do this.
In response to Deadron
They arn't on the map yet. I need them to be created on the map. How do I use move()? Like baddy.move(26,9,1)?
In response to TK6000
TK6000 wrote:
They arn't on the map yet. I need them to be created on the map. How do I use move()? Like baddy.move(26,9,1)?

Using your previous code, it would be:

baddy.Move(buddylocation)
In response to Deadron
I get this error.

3139:error:baddy.Move:bad proc

why?
In response to TK6000
TK6000 wrote:
I get this error.

3139:error:baddy.Move:bad proc

why?

Because baddy is defined like this:

var/baddy


That means baddy is totally generic, and the system doesn't know it's a mob. Try:

var/mob/baddy
In response to Deadron
ok thanks. I will try that. Right now tho I have to do some other stuff. I will post if it dosn't work.
In response to TK6000
well, the code I would use is:

var/mob/baddys/henchmen/H = new(src)
H:loc = locate(?,?,?)

You may have to repeat this for multiple members however

Da_Rushyo
In response to Da_Rushyo
You shouldn't use the : operator in this place, you should use the . operator.