RPG Starter

by Falacy
An Open Source Demo/Game with everything you'll need to get started on your very own BYOND Game!
ID:292220
 
Hey Fal,

I need help with coding clans and beams i've already posted this twice and i didn't get any awnswer so im trying agian by being patient :)

When i last had a code for clans it works but it auto adds the person i choose and the player has no choice and when i log out the clan vanishes so i need to know how to make a save file aswell for clans

Also i got the ki blast, powerup and some others perfect but i need beams like kamehameha and galick gun <-- i think i spelt it wrong anyways.

I hope this time you read my post. Thanks
Because you're asking for help on overly complex systems
In response to Falacy
Its not that I have Clans on my game the things work but the problem is the saving system :/

var/list/Clans = list()//This defines the list that we store the created Clan in
mob/var/list/Clanmembers = list()//This defines the list we store Clanmembers in
mob/var/Clan//Defines the variable Clan
mob
verb
World_Say(var/T as text)//Makes it so the player can enter the message he wants to tell the world
if(!src.Clan)
world << "[src] says: [T]"//If the player is not in a Clan it just shows the message
else
world << "{[Clan]} [src] says: [T]"//If the player is in a Clan it just shows the message with his Clan's name infront

Make_Clan(var/Clanmaking as text)
set category="Clan"//The var/Clanmaking as text means whatever the player enters is what the variable Clanmaking is
if(!usr.Clan)
if(Clans.Find(ckey(Clanmaking)))//Next we check if the Clan name is taken
alert("There is already a Clan named this. Pick another name.")//If it is we tell them that is is and to pick another name
else
Clans += ckey(Clanmaking)//If its not we add the new Clan's name to the list of created Clans
src.Clan = "[Clanmaking]"//Now we make the players Clan variable equal the new quilds name (This will be used when inviting a player to the Clan)
src.verbs += /mob/Clan/verb/Clan_Chat//We give the player the new Clan verbs
src.verbs += /mob/Clan/verb/Clan_Members//We give the player the new Clan verbs
src.verbs += /mob/Clan/verb/Clan_Invite//We give the player the new Clan verbs
src.verbs += /mob/Clan/verb/Clan_Disband//We give the player the new Clan verbs
src.verbs -= /mob/verb/Make_Clan//Now we delete this verb so the player cannot create multiple Clans
else
usr << "You already have a Clan."
Clan
verb
Clan_Members()
set category="Clan"
src << "The following are in your Clan:"
for(var/mob/M in world)//Checks all the players in the world
if(M.Clan == src.Clan)//If the player is in the players Clan
src << "[M]"//then is tells the player

Clan_Chat(var/T as text)
set category="Clan"//Makes it so the player can enter the message he wants to tell the Clanmembers
for(var/mob/M in world)
if(M.Clan == src.Clan)//Makes sure the other players in his Clan can head
M << "[src] says: [T], to the Clan."//Gives all the Clan members the message

Leave_Clan()
set category="Clan"
switch(alert("Are you sure you want to leave [Clan]","","Yes","No"))//We make sure the character wants to leave the Clan
if("Yes")
for(var/mob/M in world)
if(M.Clan == src.Clan)
M << "[src] has left [Clan]."//If he wants to leave the Clan it tells all the members he left
src.Clan = null//Then it makes his Clan null so he can join other ones

Clan_Invite(mob/M as mob in view())
set category="Clan"//We make it so only players around the player can be invited to the Clan
if(!M.Clan)//Now we have sure they are not in a Clan
switch(alert(M,"[usr] would like you to join their Clan [usr.Clan]. Would you like to join?","","Yes","No"))//If they arent in a Clan we ask them to join
if("Yes")
src << "[M] has joined [usr.Clan]!"//Since he chose yes we tell the player that the new player has joined the Clan
src.Clanmembers += M//We add the new Clanmember to the list
M << "You have joined [usr.Clan]!"//We tell the player he has joined
M.Clan = usr.Clan//Now we make the players Clan the same as the other players
M.verbs += /mob/Clan/verb/Leave_Clan//We give the player the new Clan verbs
M.verbs += /mob/Clan/verb/Clan_Chat//We give the player the new Clan verbs
M.verbs += /mob/Clan/verb/Clan_Members//We give the player the new Clan verbs
M.verbs -= /mob/Clan/verb/Clan_Chat//We give the player the new Clan verbs
M.verbs -= /mob/Clan/verb/Clan_Members//We give the player the new Clan verbs
else
usr << "[M] is already in a Clan."//If they are in a Clan we dont invite them and it tells the player that person is already in a Clan

Clan_Disband()
set category="Clan"
switch(alert("Are you sure you want to delete [Clan]?","","Yes","No"))//Makes sure the player really wants to disband his Clan
if("Yes")
for(var/mob/M in Clanmembers)//If he wants to it makes all the players in the Clan leave
M.Clan = null//Makes their Clan = nothing
src.verbs -= new/mob/Clan/verb/Clan_Invite//Deletes the owner of the Clans verbs
src.verbs -= new/mob/Clan/verb/Clan_Disband//Deletes the owner of the Clans verbs
src.verbs -= new/mob/Clan/verb/Clan_Chat//Deletes the owner of the Clans verbs
src.verbs -= new/mob/Clan/verb/Clan_Members//Deletes the owner of the Clans verbs
src.verbs += new/mob/verb/Make_Clan//Gives him the make Clan verb so he cant create another one later
src.Clan = null//Makes the owners Clan = nothing
src.Clanmembers = null//Make the Clanmembers list = nothing so no more info is stored in it

mob
proc
SaveClan()//defines the Save proc
var/savefile/F = new("players/[src.key].sav")//Defines the var F
F["ClanMembers"] << src.Clanmembers//Saves the Clannmembers list
F["Clan"] << src.Clan//Saves what Clan the player is in
F["Verbs"] << src.verbs//saves the players verbs

LoadClan()//defines the character Load proc
var/savefile/F = new("players/[src.key].sav")//Defines the var F
var/verbsave
F["ClanMembers"] >> src.Clanmembers//Loads the Clanmembers list
F["Clan"] >> src.Clan//Loads what Clan the player is in
F["Verbs"] >> verbsave//Loads the players verbs
src.verbs += verbsave//Adds the loaded verbs to the players


It still doesn't save :/
In response to Vent Matalik
You can't save verbs, saving lists of players is a bad idea, and though saving their Clan var like that could work, it would probably be better to save a global list of clans and check to see if they're in one.
In response to Falacy
Ok, Thanks Its Works Perfectly :)