Create_Guild()
set category = "Commands"
if(!usr.in_guild)
if(usr.level >= 100)// Change if needed.
if(usr.money >= 1000)// Change if needed.
usr.Create_G()
else usr << "Need more money."
else usr << "Need a higher level."
else usr << "You are in a guild."
proc
Create_G()
switch(alert(src,"Are you sure you would like to create a guild?","Create Guild","Yes","No"))
if("Yes")
src.guild_name = "None"
src.guild_name = input(src,"What would you like to call your guild?","Guild Name")as text|null
if(length(guild_name) < 5)
alert(src,"More letters than 5 please. Create a proper guild name.")
src.Create_G()
if(length(guild_name) > 100)
alert(src,"You trying to spam OOC or something? Don't have more letters than 100.")
src.Create_G()
var/list/html = list("<",">")
if(html in src.guild_name)
alert(src,"No html!")
src.Create_G()
else
world << "<b><font color=aqua>Guild Info:</font> <font color=white>[src] created the guild, [src.guild_name]"
src.money -= 1000 //Change if needed.
src.in_guild = 1
src.guild_rank = 5
src.guild_title = "Guild Leader"
src.verbs += typesof(/mob/Guild_Leader/verb) //Problem 1
src.verbs += typesof(/mob/guild/verb)
if("No")
src.guild_name = "None"
return
mob/Guild_Leader
verb
Give_A_Verb(mob/M in world)
set category = "Guild"
var/list/GVerbs = list()
for(var/Verb in typesof(/mob/Guild_Leader/verb/)) //Problem 2
GVerbs += Verb
var/theverb = input("Which verb do you wish to give to [M]?","Give Verb")in GVerbs
M.verbs += theverb
Problem description:
Verbs.dm:67:error:/mob/Guild_Leader/verb/: compile failed (possible infinite cross-reference loop)
Guild.dm:75:error:/mob/Guild_Leader/verb: compile failed (possible infinite cross-reference loop)
What I am trying to do is make it so the guild leader can give a verb to one of his members without giving a verb he doesn't want his member to have. There is more verbs, but I only posted the one since others arn't needed in here.
EDIT:
mob/Guild_Leader
verb
Give_A_Verb(mob/M in world)
set category = "Guild"
var/list/GVerbs = list()
GVerbs += typesof(/mob/Guild_Leader/verb/)
var/theverb = input("Which verb do you wish to give to [M]?","Give Verb")in GVerbs
M.verbs += theverb
// I have also tried this way but I still get the loop error.
You need to enclose the type with double quotes in typesof() so it gets evaluated at runtime and not compile-time, or the compiler will get confused.
For future reference, the forum search</a href> does wonders.