ID:169839
 
When I'm doing Bunshin No jutsu, how do I make it so a copy of the persons icon shows up as you see in naruto.
mob/verb
Createclones(mob/M)
var/mob/clone=new(usr.loc)
clone.icon=usr.icon
In response to Itachi1
Itachi1 wrote:
mob/verb
Createclones(mob/M)
var/mob/clone=new(usr.loc)
clone.icon=usr.icon

Thanks, man you rule. Also do you have a formula for chakra control, I can't seem to think of one. for example 4/5 jutsu not converted, 5/5 jutsu converted, and 6/5 Jutsu converted
In response to Broly103
Ya. im sure i can make 1 give me a couple mins. Also i made a mistake in my code i think o.O it would be easyier to define a proc then call it using a verb like so.
mob/proc
Createclones(mob/M)
var/mob/clone=new(usr.loc)
clone.icon=usr.icon

mob/verb
Bunshin_No_Jutsu()
set category = "Genjutsu"
Createclones()
In response to Itachi1
Why would it make any difference? Procs and verbs are almost (but not quite) the same. By creating a verb and a proc, you're making extra 'traffic'. I don't think such a negligible thing would lag the game, but it might be important to keep file size to a minimum.
And yes, you did make a mistake. Why have you defined mob/m for the CreateClones proc, then not used it?
In response to Itachi1
This is completly off the top of my head but it should work. all this does is if your Chakra Control (CControl) is more than 100 then it generates a random number 1-10 and takes that away from your Chakra and creates a clone depending on whether you converted 5 or more chakra.

And if CControl is 100 then it just takes 5 away from your Chakra and creates the clone.
mob/proc
Createclones()
var/mob/clone=new(usr.loc)
clone.icon=usr.icon

mob/var
CControl = 150
Chakra = 200

mob/verb
Bunshin_No_Jutsu()
set category = "Genjutsu"
if(usr.CControl >= 101)
var/CCusage = rand(1,10)
if(CCusage <= 5)
usr << "[CCusage]/5 Chakra converted"
usr.Chakra -= CCusage
return
if(CCusage >= 5)
usr << "[CCusage]/5 Chakra converted"
usr.Chakra -= CCusage
view(usr) << "[usr]: Bunshin No Jutsu"
Createclones()
if(usr.CControl <= 100)
usr << "5/5 Chakra converted"
usr.Chakra -= 5
view(usr) << "[usr]: Bunshin No Jutsu"
Createclones()
In response to Hazman
I made it a proc cause there is more than 1 kind of replication tech in naruto and i would be smaller to make 1 proc that made a replication then 10 verbs that made there own replication. as for defining the proc for mob/M... i dont know what that was about. just habbit i guess.
In response to Itachi1
Itachi1 wrote:
I made it a proc cause there is more than 1 kind of replication tech in naruto and i would be smaller to make 1 proc that made a replication then 10 verbs that made there own replication. as for defining the proc for mob/M... i dont know what that was about. just habbit i guess.

Okay, I used your code for my bunshin.I will do the rest for Kage,Tajuu kage etc.

mob/verb
Bunshin_No_Jutsu()
set category = "Genjutsu"
if(Chakra <= 0)
usr << "Not enough Chakra"
if(usr.CControl >= 101)
var/CCusage = rand(1,7)
if(CCusage <= 4)
usr << "[CCusage]/5 Chakra converted"
usr.Chakra -= CCusage
return
if(CCusage >= 5)
view(usr) << "[usr] says, Bunshin No Jutsu"
usr << "[CCusage]/5 Chakra converted"
usr.Chakra -= CCusage
Createclones()
if(usr.CControl <= 100)
view(usr) << "[usr] says, Bunshin No Jutsu"
usr << "5/5 Chakra converted"
usr.Chakra -= 5

I added if Chakra = 0 or less the jutsu will not work, but it still does the jutsu any help?
In response to Broly103
mob/verb
Bunshin_No_Jutsu()
set category = "Genjutsu"
if(Chakra <= 0)
usr << "Not enough Chakra"
return

Ya you have to tell it to cancell the rest of the proc if there isnt enough Chakra. so you put in a return command under that if statment
In response to Itachi1
Itachi1 wrote:
> mob/verb
> Bunshin_No_Jutsu()
> set category = "Genjutsu"
> if(Chakra <= 0)
> usr << "Not enough Chakra"
> return
>

Ya you have to tell it to cancell the rest of the proc if there isnt enough Chakra. so you put in a return command under that if statment

here
mob/proc
Createclones()
var/mob/clone=new(usr.loc)
clone.icon=usr.icon
mob/var
CControl = 150
Chakra = 200
bunshinclone

mob/verb
Bunshin_No_Jutsu()
set category = "Genjutsu"
if(bunshinclone >= 10)
usr << "To many clones out"
return
if(Chakra <= 0)
usr << "Not enough Chakra"
return
if(usr.CControl >= 101)
var/CCusage = rand(1,7)
if(CCusage <= 4)
view(usr) << "[usr] says, Bunshin No Jutsu"
usr << "[CCusage]/5 Chakra converted"
usr.Chakra -= CCusage
return
if(CCusage >= 5)
view(usr) << "[usr] says, Bunshin No Jutsu"
usr << "[CCusage]/5 Chakra converted"
usr.Chakra -= CCusage
Createclones()
if(usr.CControl <= 100)
view(usr) << "[usr] says, Bunshin No Jutsu"
usr << "5/5 Chakra converted"
usr.Chakra -= 5
In response to Broly103
ok your proc needs to be this cause atm your defining an if statement but not giving it anything to go by... i mean Your saying

if(bunshinclone >= 10)
usr << "To many clones out"
return

But nowhere in your code are you telling your code to add 1 to bunshinclone when Bunshin No Jutsu is used. so instead make your proc like this and that code should work fine.
mob/proc
Createclones()
var/mob/clone=new(usr.loc)
clone.icon=usr.icon
usr.bunshinclone++

That is the only thing i see off the top of my head.
In response to Itachi1
Itachi1 wrote:
ok your proc needs to be this cause atm your defining an if statement but not giving it anything to go by... i mean Your saying

> if(bunshinclone >= 10)
> usr << "To many clones out"
> return
>

But nowhere in your code are you telling your code to add 1 to bunshinclone when Bunshin No Jutsu is used. so instead make your proc like this and that code should work fine.
> mob/proc
> Createclones()
> var/mob/clone=new(usr.loc)
> clone.icon=usr.icon
> usr.bunshinclone++
>

That is the only thing i see off the top of my head.
mob/verb
Bunshin_No_Jutsu()
set category = "Genjutsu"
clone.ninjutsu=usr.ninjutsu/2
clone.genjutsu=usr.genjutsu/2
clone.Taijutsu=usr.Taijutsu/2
if(bunshinclone >= 10)
usr << "To many clones out"
return
if(Chakra <= 0)
usr << "Not enough Chakra"
return
if(usr.CControl >= 101)
var/CCusage = rand(1,7)
if(CCusage <= 4)
view(usr) << "[usr] says, Bunshin No Jutsu"
usr << "[CCusage]/5 Chakra converted"
usr.Chakra -= CCusage
return
if(CCusage >= 5)
view(usr) << "[usr] says, Bunshin No Jutsu"
usr << "[CCusage]/5 Chakra converted"
usr.Chakra -= CCusage
Createclones()
if(usr.CControl <= 100)
view(usr) << "[usr] says, Bunshin No Jutsu"
usr << "5/5 Chakra converted"
usr.Chakra -= 5


I think i made my stats divide in half.
In response to Broly103
I'm going to pre-empt Lummox here:

"No put usr in proc. Ungh"

Your code is riddled with errors. I suggest wiping it, and then start again by writing your own code, that you thought of because you read the DM Guide and several tutorials. It makes it much better, and much less buggy.
In response to Jp
How would you make the clones:
Sorround the user?
Attack?
Stay Still?(I edited the Move() proc to make them move)
I hope someone can help me.
In response to BakaSan
BakaSan wrote:
How would you make the clones:
Sorround the user?
Attack?
Stay Still?(I edited the Move() proc to make them move)
I hope someone can help me.

Use the walk_to proc or walktowards forgot which one,dunno about stay still or attack.
In response to Broly103
Thanks. I'll try it.
Edit:

This worked quite well. Now i have to figure out how to make them do stuff.