ID:162347
 
progress further then i can iam working on a project i like to call Trade Winds...
I have levels classes
where you can be American French English Spanish or Pirates
and go around blthowing eachother up or the other ships in the game or go around and kill the wonder monster i have like sea serpants and or Boss mobs form, partys group up and Enjoy the 7Seas on your own epic ship combat game experiance...
the code i am giveing works perfectly fine to load and loginto the game...i do not have a map yet because iam still working on the code files....
here is a copy of my characters file.

var
speede = 1 - speed
speedw = 1 - speed
speeds = 2 - speed
speedn = 2 + speed

world
view = 7// Sets the size of the scree. Can be 1 to 10. 6 is used on most games though..
mob = /mob/player///Sets the mob the player is gonna be.
mob/player // This defines the PLAYER, the player is ALWAYS a mob. Monsters are usually mobs too.
Login() // Login() defines when the player logs into the game. You can add character selection here, loading, etc.
sleep(20)//Waits for a sec.
world << " \red [usr] logs on!" // tell the world who logs on
alert("Welcome to the Tutorial!!!","Welcome","Ok") // This brings up a windows style text box with the text you type in then the OK button..
src.name = input("What is your characters name foo?!","Name",src.key)// This brings up another windows style text box but has an area to enter text, which in this case in your name.
var/a = input("What class do you want?")in list("Americans","French","Spanish","English","Pirates")
if(a=="Americans")
icon = 'player.dmi'
icon_state = "2"
hp = 25
HP = 25
xp = 0
next = 1000
level = 1
crew = 35
CREW = 55
ammo = 30
AMMO = 50
gshot = 0
GSHOT = 25
cshot = 0
CSHOT = 25
sshot = 0
SSHOT = 25
gfire = 0
GFIRE = 15
cargo = 85
CARGO = 140
speed = 3
SPEED = 6
hull = 60
HULL = 80
int = 5
INT = 10
str = 5
STR = 10
dex = 5
DEX = 10
cha = 5
CHA = 10
class = "Americans"
if(a=="French")
icon = 'player.dmi'
icon_state = "1"
hp = 25
HP = 25
xp = 0
next = 1000
level = 1
crew = 35
CREW = 55
ammo = 30
AMMO = 50
gshot = 0
GSHOT = 25
cshot = 0
CSHOT = 25
sshot = 0
SSHOT = 25
gfire = 0
GFIRE = 15
cargo = 85
CARGO = 140
speed = 3
SPEED = 6
hull = 60
HULL = 80
int = 5
INT = 10
str = 5
STR = 10
dex = 5
DEX = 10
cha = 5
CHA = 10
class = "French"
if(a=="English")
icon = 'player.dmi'
icon_state = "3"
hp = 25
HP = 25
xp = 0
next = 1000
level = 1
crew = 35
CREW = 55
ammo = 30
AMMO = 50
gshot = 0
GSHOT = 25
cshot = 0
CSHOT = 25
sshot = 0
SSHOT = 25
gfire = 0
GFIRE = 15
cargo = 85
CARGO = 140
speed = 3
SPEED = 6
hull = 60
HULL = 80
int = 5
INT = 10
str = 5
STR = 10
dex = 5
DEX = 10
cha = 5
CHA = 10
class = "English"
if(a=="Spanish")
icon = 'player.dmi'
icon_state = "4"
hp = 25
HP = 25
xp = 0
next = 1000
level = 1
crew = 35
CREW = 55
ammo = 30
AMMO = 50
gshot = 0
GSHOT = 25
cshot = 0
CSHOT = 25
sshot = 0
SSHOT = 25
gfire = 0
GFIRE = 15
cargo = 85
CARGO = 140
speed = 3
SPEED = 6
hull = 60
HULL = 80
int = 5
INT = 10
str = 5
STR = 10
dex = 5
DEX = 10
cha = 5
CHA = 10
class = "Spanish"
if(a=="Pirates")
icon = 'player.dmi'
icon_state = "5"
class = "Pirates"
hp = 25
HP = 25
xp = 0
next = 1000
level = 1
crew = 35
CREW = 55
ammo = 30
AMMO = 50
gshot = 0
cshot = 0
sshot = 0
gfire = 0
cargo = 85
CARGO = 140
speed = 3
SPEED = 6
hull = 60
HULL = 80
int = 5
INT = 10
str = 5
STR = 10
dex = 5
DEX = 10
cha = 5
CHA = 10


// This takes care of the login. It takes the player to the starting location
// Lets it choose its name, then plays some music!

//Now for the Logout.
mob/player
Logout()// Tells the computer thatt the player is trying to log out...
speede = -1
speedw = -1
speeds = -2
speedn = 2 << "
\red [usr] logs out!"// Tells everybody who is logging out.
sleep(5)// Sleeps 5 half seconds..
del(src)// Deletes the player. If you dont do this its like the players soul leaves, but the body is still there

// Now that we have Login,Logout done lets get started with the players variables, also know as var.
mob/player

hp
HP
xp
next
level
crew
CREW
ammo
gshot
GSHOT
cshot
CSHOT
sshot
class
race
SSHOT
speed
SPEED
gfire
GFIRE
cargo
profile
CARGO
hull
HULL
int
INT
str
STR
dex
DEX
cha
CHA
Click()//Checks if you clicked on them
mob/var
hp
HP
xp
next
level
crew
CREW
ammo
gshot
GSHOT
cshot
CSHOT
sshot
hull
HULL
speed
SPEED
AMMO
class
race
SSHOT
gfire
GFIRE
cargo
CARGO
int
INT
str
STR
dex
DEX
cha
CHA
// Thats it with the Players and mobs variables, lets go to verbs now.

mob/player
verb// Verbs are like the players commands, like say, attack, etc.
say(msg as text) // Brings up another box where you type what you wanna say.
view() << "\red[usr.name]:\blue [msg]" // The thingys are just HTML coding so dont worry bout it.

Attack()//The Attack verb. Attacks a mob in view.
for(var/mob/M in get_step(src,src.dir))//If anybody is right next to them...
var/damage = rand(1,str)// The Damage is between 1 and the players power.
usr << "You attack [M] for [damage] damage!!"// Tell you how much damage you did.
M << "[src] attack you for [damage]!!!"// Tell the person who you attacked how much damage they got.
M.hp -= damage// Takes Hp away.
M.Death()//Calls the Death Proc, which checks if the player is dead.
usr.Check()


mob
proc
Death(mob/M)// Makes sure its only a mob
if(src.type == /mob/player)// If the player dies go to PlayerDie().
PlayerDie()
if(src.hp <= 0)//checks if the hp is smaller than 0
range() << "[src] has been killed by [usr]!!" // tells who died, and who or what killed it.
src.overlays -= 'Etc.dmi'
del(src)// deletes it.
PlayerDie(mob/M)//If the player dies.
if(src.hp <= 0)// if hp is smaller than 0
view() << "[src] died!"// In the view tells who died.
src.loc = locate(5,5,1)//Brings them back to the start position.
src.hp = HP// Sets the HP back to the Max.




mob
proc
Check(mob/player/M)
if(usr.xp>=usr.next)
usr.LevelUp()


mob/proc
LevelUp(mob/Player/M)
if(usr.class=="Americans")
if(usr.xp>=usr.next)
usr.level += 1
usr.str += rand(3,5) * usr.level
usr.hp += rand(3,5) * usr.level
usr.HP += rand(4,7) * usr.level
usr.next += src.level * 23
usr.hp = usr.HP
world << " [usr.name] the [usr.class] has leveled up to [usr.level]"
return
if(usr.class=="French")
if(usr.xp>=usr.next)
usr.level += 1
usr.str += rand(1,3) * usr.level
usr.hp += rand(2,5) * usr.level
usr.HP += rand(3,7) * usr.level
usr.STR += rand(4,9) * usr.level
usr.CREW += rand(5,11) * usr.level
usr.next += src.level * 23
usr.hp = usr.HP
world << " [usr.name] the [usr.class] has leveled up to [usr.level]"
return
if(usr.class=="Spanish")
if(usr.xp>=usr.next)
usr.level += 1
usr.str += rand(2,4) * usr.level
usr.hp += rand(3,5) * usr.level
usr.HP += rand(1,6) * usr.level
usr.crew += rand(4,9) * usr.level
usr.str += rand(5,10) * usr.level
usr.xp += src.level * 23
usr.hp = usr.HP
world << " [usr.name] the [usr.class] has leveled up to [usr.level]"
return
if(usr.class=="English")
if(usr.xp>=usr.next)
usr.level += 1
usr.str += rand(2,4) * usr.level
usr.hp += rand(3,5) * usr.level
usr.HP += rand(1,6) * usr.level
usr.crew += rand(4,9) * usr.level
usr.str += rand(5,10) * usr.level
usr.xp += src.level * 23
usr.hp = usr.HP
world << " [usr.name] the [usr.class] has leveled up to [usr.level]"
return
if(usr.class=="Pirates")
if(usr.xp>=usr.next)
usr.level += 1
usr.str += rand(2,4) * usr.level
usr.hp += rand(3,5) * usr.level
usr.HP += rand(1,6) * usr.level
usr.crew += rand(4,9) * usr.level
usr.str += rand(5,10) * usr.level
usr.xp += src.level * 23
usr.hp = usr.HP
world << " [usr.name] the [usr.class] has leveled up to [usr.level]"

none of this is in a real order because when i found out how to do stuff i just add in as i go, and i dont really understand the order of things as they go....

mob
Stat()
statpanel("Vitalz")
stat("Health:",hp )
stat("Level:",level)
stat("class:",class)
stat("str:",str)
stat("int:",int)
stat("dex:",dex)
stat("cha:",cha)
stat("Crew:",crew)
stat("Cargo:",cargo)
stat("Ammo:",ammo)
stat("Hull:",hull)
stat("Exp:",xp)
stat("Nextlx:",next)

statpanel("shipCharts")
stat("HULL",hull)
stat("MaxAmmo:",AMMO)
stat("MaxCrew:",CREW)
stat("MaxCargo:",CARGO)
statpanel("CarGoHolD")
stat("crew:",crew)
stat("ammo:",ammo)
stat("Food:",food)
stat("Jewls:",jewls)
stat("water:",water)
stat("ale:",ale)
stat("Wiskey",Wiskey)
stat("run",rum)
stat("wine",wine)
stat("gems",gems)
statpanel("upgradez")



var
food
jewls
gems
water
ale
Wiskey
rum
wine
this is my current stat pannel...
the issuse iam have with it, are
i dont know how to make crew take up cargo space
or ammo take up cargo space, or how the items are going to take up cargo space. i dont know how to make combat use my ammo and make it deplete from cargospace.
or how to make buttons and icons show up in cargo space.



world
loop_checks = 0
var
ticket
raining=0
WEATHER
parent_type=/area/
TIME
icon='DN.dmi'
layer=10
WEATHER2
parent_type=/obj/
WEATHERA
icon='RAIN.dmi'
layer=9
proc
TIMESTREAMD()
sleep(10)
ticket+=1
world<<"[ticket]"
if(ticket==10)
var/WEATHER/TIME/A
for(A in world)
A.icon_state="N"
A.luminosity=0
var/WEATHER2/WEATHERA
for(WEATHERA in world)
var/dice="1d4"
var/h = roll(dice)
world<<"Dice [h]"
if(h==1)
goto mess
if(h==2)
goto mess
if(h==3)
goto mess
if(h==4)
if(raining==0)
for(WEATHERA in world)
WEATHERA.icon_state="RAIN"
world<<"Rain starts falling"
raining=1
goto mess
if(raining==1)
for(WEATHERA in world)
WEATHERA.icon_state="RAINOFF"
world<<"Rain stops falling"
raining=0
goto mess
mess
world<<"It is now night"
ticket=0
spawn TIMESTREAMN()
return
spawn TIMESTREAMD()
TIMESTREAMN()
sleep(10)
ticket+=1
world<<"[ticket]"
if(ticket==10)
var/WEATHER/TIME/A
for(A in world)
A.icon_state="D"
A.luminosity=1
var/WEATHER2/WEATHERA
for(WEATHERA in world)
var/dice="1d4"
var/h = roll(dice)
world<<"Dice [h]"
if(h==1)
goto mess
if(h==2)
goto mess
if(h==3)
goto mess
if(h==4)
if(raining==0)
for(WEATHERA in world)
WEATHERA.icon_state="RAIN"
world<<"Rain starts falling"
raining=1
goto mess
if(raining==1)
for(WEATHERA in world)
WEATHERA.icon_state="RAINOFF"
world<<"Rain stops falling"
raining=0
goto mess
mess
world<<"It is now day"
ticket=0
spawn TIMESTREAMD()
return
spawn TIMESTREAMN()
world/New()
..()
spawn TIMESTREAMN()

verb
mob
var
proc
nwind()
speed = -2
swind()
speed = 2
ewind()
speed = -1
wwind()
speed = -1


var speed
var hp
var layer
var icon





client
var/tmp
next_move_time = 0
movement_delay = 10

client
Move()
// If we've reached the next move time, allow the move.
if (world.time >= src.next_move_time)
src.next_move_time = world.time + src.movement_delay

// Calls the regular Move() function to allow the move to happen.
return ..()
else
// Not allowed to move yet.

heres a weather snip iam useing i dont know how to define
speed to be reduced down or added depending on were they are
compaird to were the wind is going.
ied perfer to have a tutorial
so if you know of tutorials that i may have missed
that could help me define these issuse, i can and like to
keep it as much my code as i can...

ive been cruzing youtube too for demos, and ive looked though
most of the demos / libaries on this byond. ..but then again iam not saying there isnt anything that ive missed too, so give me an assist,...and ill make sure to make some sort of credit to in my game...


Peace.
`and
What isn't working? What is your error?

I will help you out, this could be an interesting game. The most glaring thing right now is that you waste so much on defining the variables at player creation. Class inheritance is the Second Coming.

You should make each class its own mob, but if it works for now, then it would be better to focus on what isn't working right now.
In response to Dragon151
Technically there's nothing wrong with your code, but it's VERY VERY INEFFICIENT. It could be done much shorter.
In response to EGUY
there is no errors on my code side
all though ill take your advice on the individual mobs for player classes...right now

iam working with stat panels...defining them
so that they all have - and + when people
use ammo and food water crew or get hit for dammage and loose the same ..and it all has to reflect cargo space...
In response to Iuss
what would you suggest to shorten it, iam not familiar enough yet to know short cuts.
In response to Dragon151
http://www.gamescreen.citymax.com/src.html
heres a vew of my early stage, hud, ingame screnshot
In response to Dragon151