ID:269921
 
people, whats the correct code to "if(mob/M in oview(3))"???

please help i need this to 3 verbs!
In response to Jp
i dont understand half of the guide...
In response to Pharaoh Atem
Learn english?
In response to Jp
yeah, but its too complex the byond guide, i need a guide more simple
In response to Pharaoh Atem
people, please explain me how to do this code!i need this very much!
In response to Pharaoh Atem
Okay, first read the Community Standards, as your bump was obviously in violation.

If you know how to read English, the DM Guide is one of the most comprehendable resources you have at your disposal. If you need more, open up Dream Maker, press F1, go to the Index tab, and read through every topic you find.

*sigh* The worst thing to ask is "What is the code to ____," as there is no one specific code to do most things, and it would be better for you to learn the language in its (near-)entirety so that you can design the code yourself.

Hiead
for(var/mob/M in oview(3))//for all mobs in oview(3) do the following code
//what happens...
break //so it only happens once
In response to CIB
CIB wrote:
> for(var/mob/M in oview(3))//for all mobs in oview(3) do the following code
> //what happens...
> break //so it only happens once
>


thanks for this, i finded in the help(f1) how to use for and its very helpful!
now i want to know why the icon not changes to 'bass_summ.dmi'...

look at the code
obj/Bass_Summon_chip
icon='cheese.dmi'
verb
Summon_Bass()
if(usr.Custom >= 200)
set category = "Fight"
var/mob/M
var/temp = usr.icon // hold the icon in a variable
var/bshot = 'bshot.dmi'
for(M in oview(3))
usr.icon = 'bass_summ.dmi'
spawn(25)
view(5)<<"<font color = brown><BIG>[usr] : Multi Gun!!!! </BIG></font>"
M.overlays += bshot
spawn(10)
M.HP -= 220
spawn(10)
M.overlays -= bshot
usr.icon = temp // revert the icon back
usr.Custom -= 200
else
usr << "You Dont Have Enough Custom!"



NO runtime errors, thanks to all who helped me, thanks so much!But, why the icon of the player not changes?Ah about the usr, i can use this in the other objs and they change the usr icon.Why dont change?
In response to Pharaoh Atem
Pharaoh Atem wrote:
CIB wrote:
> > for(var/mob/M in oview(3))//for all mobs in oview(3) do the following code
> > //what happens...
> > break //so it only happens once
> >

thanks for this, i finded in the help(f1) how to use for and its very helpful!
now i want to know why the icon not changes to 'bass_summ.dmi'...

look at the code
> obj/Bass_Summon_chip
> icon='cheese.dmi'
> verb
> Summon_Bass()
> if(usr.Custom >= 200)
> set category = "Fight"
> var/mob/M
> var/temp = usr.icon // hold the icon in a variable
> var/bshot = 'bshot.dmi'
> for(M in oview(3))
> usr.icon = 'bass_summ.dmi'
> spawn(25)
> view(5)<<"<font color = brown><BIG>[usr] : Multi Gun!!!! </BIG></font>"
> M.overlays += bshot
> spawn(10)
> M.HP -= 220
> spawn(10)
> M.overlays -= bshot
> usr.icon = temp // revert the icon back
> usr.Custom -= 200
> else
> usr << "You Dont Have Enough Custom!"

NO runtime errors, thanks to all who helped me, thanks so much!But, why the icon of the player not changes?Ah about the usr, i can use this in the other objs and they change the usr icon.Why dont change?


Sorry about the longest quote of the developers forum XD, but, i maked a 100% code(who wants to use it, i permit)

obj/Bass_Summon_chip
icon='cheese.dmi'
verb
Summon_Bass()
if(usr.Custom >= 200)
set category = "Fight"
var/mob/M
var/temp = usr.icon // hold the icon in a variable
var/bshot = 'bshot.dmi'
usr.icon = 'bass_summ.dmi'
for(M in oview(3))
sleep(2)
M.overlays += bshot
M.HP -= 220
sleep(2)
M.overlays -= bshot
usr.Custom -= 200
sleep(2)
view()<<"<B>[usr]: Multi Gun!!!!</font><B>"
usr.icon = temp // revert the icon back
else
usr << "You Dont Have Enough Custom!"