ID:273259
 
Well, i want make a Mission Code, like Battle Raditz, and when you defeat he u got the Next Mission: Train with Kai
Post here if you want other people to make your games for you.
In response to Duelmaster409
i know coding -_-
mob/var/inmission = 0
mob/var/raditzmission = 0
mob/var/completedraditz = 0
mob/var/killedraditz = 0
mob/var/trained = 0
mob/var/trainingwithkai = 0


mob
missiongiver
icon = 'test.dmi'
icon_state = ""
Click()
if(!usr.inmission)
if(usr.completedraditz == 0)
if(usr.raditzmission == 0)
alert (usr,"[usr.name], I want you to go and kill Raditz!")
switch(input("Do you accept the mission 'Battle Raditz'?","Missions",text) in list("Yes","No"))
if("Yes")
alert(usr,"Thanks!!")
usr.raditzmission = 1

if("No")
alert(usr,"Coward")
return
else
if(usr.killedraditz == 1)
alert(usr,"Thank you for completing the mission,You have unlocked the mission, training with kai!")
usr.completedraditz = 1
else
alert(usr,"You never killed raditz yet!")
return
else
if(usr.trainingwithkai == 0)
alert(usr,"I want you to go and train with kai!")
switch(input("Do you accept the mission 'Training with kai'?","Missions",text) in list("Yes","No"))
if("Yes")
alert(usr,"Thanks!")
usr.trainingwithkai = 1
if("No")
alert(usr,"Coward")
return
else
if(usr.trained == 0)
alert(usr,"You never trained with him yet!")
return
else
alert(usr,"Thanks for completing the mission!")

return


mob
proc
Death(mob/M)
if(!src.client)
if(src.hp <= 0)
if(istype(src,/mob/npc/raditz))
M.killedraditz = 1
In response to Agrey123
That's a horrible overuse of vars and hardcoded content.
In response to Kaioken
Well Kaioken, not hard but a little overuse of vars.
In response to Revolution Gohan
A little? Would have been better to have one variable keeping track of one quests. Better yet, a list of variables keeping track (especially for quests that you can repeat).
In response to GhostAnime
How do u make one variable for like 50 Missions xP
In response to Revolution Gohan
One option would be using a list.
In response to Mega fart cannon
sorry i forgot i shuld a list, il make you another better one if you want..
In response to Agrey123
if u want np ^^ :)
In response to Revolution Gohan
I dont know if its this what you need.

var/list/missions = list("Battle Raditz","Battle Saibamen")
In response to Gohan Games
Gohan Games wrote:
I dont know if its this what you need.

var/list/missions = list("Battle Raditz","Battle Saibamen")

That is what YOU need..

but I was just thinking about using Datums.. I am not saying you cant do it this way but another way would be Datums.

And yes the post above with code was really not preferable.

Lesson : Coders should satisfy their desires in a short and sweet manner.

This will help in making a game lag free.

well this could be a better way than introducing a Load of variables.
var/Mission_list=list("Enemy1","2"....) //define all missions
mob/NPC/Enemy
var/mission="Kill Raditz"
proc/Death(mob/killer)
if(killer.mission==src.mission)
killer<<"Yay you killed me!"
killer.mission_list.Add(Mission_list[killer.mission_list.len+1]
mob/Player
var/mission="Current Mission" //// go to the mission master get the mission
var/list/mission_list=list("Enemy1") // add the other missions later


This was just a rough sketch..

but would recommend you to read everything in
DM Guide
Reference
and the Skin Reference before asking anything in the forums.

Read First then ask because most of the Questions are directly or indirectly answered. Thanks to the BYOND Developers.Please value their work!