ID:1156877
 
(See the best response by Keeth.)
mob/Elite4/verb     
Warp_To_Gym()
set category = "Elite 4"
if(usr.GymType=="Ice")
usr.loc = locate(/turf/IceE4Exit)
if(usr.GymType=="Bug")
usr.loc = locate(/turf/BugE4Exit)
if(usr.GymType=="Steel")
usr.loc = locate(/turf/SteelE4Exit)
if(usr.GymType=="Rock")
usr.loc = locate(/turf/RockE4Exit)
if(usr.GymType=="Champion")
usr.loc = locate(/turf/ChampionExit)
return
mob/Elite4/verb
Give_Badge(mob/M in world)
set name = "Give Badge"
set category = "Elite 4"
if(usr.GymType=="Ice")
var/obj/IceE4Badge/B = new/obj/IceE4Badge
B.loc = M
if(usr.GymType=="Bug")
var/obj/BugE4Badge/B = new/obj/BugE4Badge
B.loc = M
if(usr.GymType=="Steel")
var/obj/SteelE4Badge/B = new/obj/SteelE4Badge
B.loc = M
if(usr.GymType=="Rock")
var/obj/RockE4Badge/B = new/obj/RockE4Badge
B.loc = M
if(usr.GymType=="Champion")
var/obj/ChampionRibbon/B = new/obj/ChampionRibbon
B.loc = M
usr<<"You have given [M] your badge"
M<<"[usr] has given you the [usr.GymType] Badge"
world<<"[M] has obtained the [usr.GymType] Badge!


Problem description: how do i get these 2 to create an Elite 4 tab. i tried creating a new code.dm but that didnt work either... ive tried putting "Elite4" and "Elite_4" where "Gym" is stated and all i get are errors. i have another code for countdown. but once i get the tab to show it should appear in there as well... at least i would assume so...

Best response
Presumably you are giving these verbs to someone at some point, or creating a mob for them of this type (/mob/Elite4)?
A bit of an aside, but you don't need to create a variable if all you're doing is placing a new instance of a badge in the player's contents.
var/obj/IceE4Badge/B = new/obj/IceE4Badge
B.loc = M

Can be written as:
new /obj/IceE4Badge(M)

And so forth.
@keeth: yes these are for when someone gets promoted to elite 4 member. it not showing up every which way i have tried as explained in the beginning post.

@lordandrew: ok...
In response to Str8 D3str0y3r
Str8 D3str0y3r wrote:
@keeth: yes these are for when someone gets promoted to elite 4 member. it not showing up every which way i have tried as explained in the beginning post.

Which one? I gave two possibilities; you're either giving them the verbs, or setting their mob to that type of mob. Furthermore, do you simply not have the verbs, or are they just not going into the Elite 4 tab?

@lordandrew: still new with coding, can you give an example please??

The first argument to atom/New() is the location you wish to place the atom at. So new /obj/IceE4Badge(M) is equivalent to your code, essentially, as he said in the previous post.
@keeth: giving them the verbs when the promotion to elite takes place. no elite4 tab is showing and no verbs are popping up. like wise when i added these verbs to the regular "gym" codes. still nothing.

also, i edited the message after sending please explain. i misread and overlooked what he meant. sorry for the confusion.
In response to Str8 D3str0y3r
Str8 D3str0y3r wrote:
@keeth: giving them the verbs when the promotion to elite takes place. no elite4 tab is showing and no verbs are popping up. like wise when i added these verbs to the regular "gym" codes. still nothing.

Please show the place where you're giving them the verbs.

mob/Admin/verb
Give_Elite_4(mob/M in world)
set category="Game Owner"
switch(input("What Type of Elite 4?") in list ("Bug","Ice","Rock","Steel","Champion","Demote Elite 4","Nevermind"))
if("Bug")
M.Rank = "Bug Elite 4"
world << "[usr] has made [M] The Bug Elite 4 member"
M.icon = 'All POKEMON TEAM RIOT TRAINER ICONS.dmi'
M.icon_state = "Aaron E4 Bug"
M.E4Type = "Bug"
M.Elite4=1
// M.verbs+=typesof(/mob/E4/verb)
return
if("Ice")
M.Rank = "Ice Elite 4"
world << "[usr] has made [M] The Ice Elite 4 member"
M.icon = 'Pokemon XD Icons.dmi'
M.icon_state = "Juan"
M.E4Type = "Ice"
M.Elite4=1
// M.verbs+=typesof(/mob/E4/verb)
return
if("Rock")
M.Rank = "Rock Elite 4"
world << "[usr] has made [M] The Rock Elite 4 member"
M.icon = 'All POKEMON TEAM RIOT TRAINER ICONS.dmi'
M.icon_state = "Bruno E4 Rock"
M.E4Type = "Rock"
M.Elite4=1
// M.verbs+=typesof(/mob/E4/verb)
return
if("Steel")
M.Rank = "Steel Elite 4"
world << "[usr] has made [M] The Steel Elite 4 member"
M.icon = 'Pokemon XD Icons.dmi'
M.icon_state = "Norman"
M.E4Type = "Steel"
M.Elite4=1
// M.verbs+=typesof(/mob/E4/verb)
return
if("Champion")
M.Rank = "Elite 4 Champion"
world << "[usr] has made [M] The Champion of the Elite 4"
M.E4Type = "Champion"
M.Elite4=1
// M.verbs+=typesof(/mob/E4/verb)
return
if("Demote Elite 4")
world << "[usr] has Demoted [M] from [rank]"
M.Rank = "Elite 4"
M.GymType = ""
M.GymLeader=0
M.verbs-=typesof(/mob/Gym/verb)
return
if("Nevermind")
return

thats is how i am giving them elite 4.
as for to give them the verbs i want, that is in the initial post...
lock and close, figured out the solution. the "//" in front of M.verbs+=typesof(/mob/E4/verb)was the issue... thank you anyways for the help...
In response to Str8 D3str0y3r
Str8 D3str0y3r wrote:
lock and close, figured out the solution. the "//" in front of M.verbs+=typesof(/mob/E4/verb)was the issue... thank you anyways for the help...

That'll do it. Commenting out the portion of code you want to execute tends to stop it from executing.
yeah, i posted another post with another problem. thought u had locked this one already...