ID:273818
 
I do not know if this is the right forum, but:
I want to make a multiplayer resource management game like Travian & Grepolis,
I know how to do: resources gain, build & lvup,
What I need is codes or ideas for: make an army, attacking other cites, making alliances,
info pages for players & alliances and awards to put in them, a resource you buy from the host, NPC cites/army,
Thank you Prf X
Have you started coding at all yet? It will help me get an idea of what you are doing.
In response to Xirre (#1)
My code for wood gain:
mob/var
wood//How much wood you have on hand
gwood//How much wood you get per hour
maxwood//How much wood you can hold
world
New() // after a certain amount of time the world will add wood with this code,
spawn
while(1)
for(var/mob/P in world)
var/T1=round(36000/P.gwood,1)//Divide an hour by the amount for wood per hour
sleep(T1)
if(P.wood<P.maxwood)
P.wood+=1
if(P.wood>=P.maxwood)
P.wood=P.maxwood

repeat for the other resources
For lvup:
#define IS icon_state
turf
Granary
IS = "wheat"
lv = 0
nwood = 5
TtB = 1
Click()
if(src.code!=usr.code)
usr<<"Not your"
return
if(usr.time>0)
alert({"Lv [src.lv] Holds: [usr.maxwheat]
need to level up:
wood
[src.nwood] time: [TtB] mins
your builders are working"}
)
return
if(usr.wood<src.nwood)
alert({"Lv [src.lv] Holds: [usr.maxwheat]
need to level up:
wood
[src.nwood] time: [TtB] mins
you need more wood"}
)
return
if(usr.gwheat<src.Mwheat+3)
alert({"Lv [src.lv] iron: [src.miron]
need to level up:
wood
[src.nwood] population [src.Mwheat] time: [TtB] mins
you need to Lv up Wheat"}
)
return
else
switch(alert({"Lv [src.lv] Holds: [usr.maxwheat]
need to level up:
wood
[src.nwood] time: [TtB] mins"},,"Level up","Cancel"))
if("Level up")
usr.wood-=src.nwood
usr.time += src.TtB*600
sleep(1)
Time(usr)
src.lv += 1
src.TtB = 1+src.lv
usr.maxwheat += 30*src.lv
usr.gwheat -= 1
usr.Mwheat += 1
src.nwood += 5
return
if("Cancel")
return
var
code="ne11"
lv
LV
TtB
mwood//How much wood each makes per hour
nwood//How much wood you need to lvup
mclay//"
nclay//"
miron//"
niron//"
mwheat//"
nwheat//"
Mwheat//How much wheat is use by this building
proc/Time()
if(usr.time>0)
usr.time-=1
sleep(1)
Time(usr)
else
return

build//and for building
IS = "build"
Click()
set src in oview(5)
if(src.code!=usr.code)
usr<<"Not your"
return
if(usr.time>0)
usr<<"your builders are working"
return
else
usr<<"Hillo"
var/TURF = input("Build what:","Build") in list("Woodcutter","Wheat Field","Granary")
if(TURF == "Woodcutter")
usr<<"Woodcutter I'm working on building right now"
return
if(TURF == "Wheat Field")
usr<<"Wheat Field I'm working on building right now"
return
if(TURF == "Granary")
switch(alert({"Granary
holds: 120 wheat, need to level up:
wood 5 time: 1 mins"}
,,"Level up","Cancel"))
if("Level up")
var/turf/T = new /turf/Granary
usr.wood -= 5
usr.time += 600
sleep(1)
Time(usr)
T.loc = src.loc
T.lv += 1
T.TtB = 1+src.lv
usr.maxwheat = 120
usr.gwheat -= 1
usr.Mwheat += 1
T.nwood += 5
del(src)
if("Cancel")
return

In response to Prf X (#2)
bump