ID:150039
 
ok, I would like people to create Missions for others to help in. I would apreciate it if someone could help in this coding, what I need is How do they Create missions and then add the Missions to a list, Then how can others see this list and accept one of the missions on the list.
ill tell you how to use a list, but thats about it

use "var/list/L = new" for a new list
here is an example

mob/NPC/verb
talk()
set src in oview(1)
var/list/L = new
L += "Hello!"
L += "Who are you?"
L += "What are you doing here?"
var/answer = input("Choose one:") in L
switch(answer)
if("Hello!")
alert("Hello sir, How are you today?")
if("Who are you?")
alert("Why im a crazy freaky npc!")
if("What are you doing here?")
alert("Thats none of your damn bizness!")

FIREking
In response to FIREking
thanks, that did help but I am still having problems with my code, the Problem is I can't even see the missions when I want to search for them Even though They were Created. Here is my code, can anyone help.


verb
Search_For_Campains()
usr << "Searching"
sleep(10)
usr << "Searching Complete"
var/answer = input("Which Campain would you like to accept?") in L
switch(answer)
if("")
usr << "Yea"
proc
Create_Campain()
var/l
var/cC = "Combine"
l += "cC"
var/cname = input("What is the Name of This Campain?")
switch(cname)
if("")
l += "cname"
var/desc1 = input("What is the Description of the Campain?") as text
switch(desc1)
if("")
l += "desc1"
var/mneeded = input("How many MechWarriors are Needed for the Campain?") as num
switch(mneeded)
if("")
l += "mneeded"
var/mpay = input("How Much are you Willing to Pay for the Mission?") as num
switch(mpay)
if("")
l += "mpay"
var/correct = input("Is this Correct?") in list ("Yes","No")
switch(correct)
if("Yes")
L += l
usr << "done"
if("No")
return
var
Money = 1000000
tocon// when they go in water
tocon2
Combine
list/L

I am trying to make it so that they give their team name (combine) the mission description, mercs needed and the pay, and All the information gets added as 1 Choice and not 4. Because I am going to try and make it so there can more more missions than just one when you search because people will create them. All this might be a little confusing because I wrote fast and didn't pay much attention to writing grammer ect. Anyway please help.
In response to DragonHeart
oh and another thing, dang I am asking a lot of questions, anything if you have played DragonSnot you will know what I am Talkin about. I would like to make it so that certain ppl can add the map when the game is running by selecting certain icons in a "Edit" tab. I would like to have them just click on the icon and then click on the map where it should go.
In response to DragonHeart
I am the king of in game map editing. Its fiarly simple, create a tab that holds the atoms. Then you can add this custom code to your atoms

atom/Click()
if(usr.selection != null)
new usr.selection.type(locate(src.x, src.y, src.z))
mob
var/atom/selection = null

then, when the person selects the atom to draw with, you will set that person's selection variable to the atom

obj/Apple
Click()
usr.selection = src

of course, you will need to decide how you will set up the layout for selection, and you dont want ALL mobs able to do this, so you will have to have a filter there too. Those things are up to you.

FIREking
In response to FIREking
k, everthing works exept the part I had to do. I put this.

mob
Stat()
if(usr.tp == 1)
statpanel("Base Maker" , contents)
usr.contents += new /mob/Wall

I did this so only certain people( their tp has to equal 1) can edit certain things. That part works fine, but When I log in It generates the tab and the wall, But it just keeps generating the wall in my tab so after ten seconds there are about fifty walls in the tab.

P.S.
how come your name is not map editing king if can do that so well. : )
In response to DragonHeart
DragonHeart wrote:
k, everthing works exept the part I had to do. I put this.

mob
Stat()
if(usr.tp == 1)
statpanel("Base Maker" , contents)
usr.contents += new /mob/Wall

I did this so only certain people( their tp has to equal 1) can edit certain things. That part works fine, but When I log in It generates the tab and the wall, But it just keeps generating the wall in my tab so after ten seconds there are about fifty walls in the tab.

P.S.
how come your name is not map editing king if can do that so well. : )

you must understand what stat is
mob/State() is called every 10 ticks(im pretty sure). That means, it goes through your entire stat proc, and does what you put it in. Currently, i believe Stat() is the only repeating proc in the entire DM language. Look at the example:

var/x = 0
mob
Stat()
x += 1
world << x

put that code into a new project, and run it, you will see the following appear on your screen

1
2
3
4
5
..
etc.

this is because stat gets called multiple times. What you need to do is figure out how you are going to display the atoms that they can choose, and still have the atoms functionable. I cannot tell you how i did mine, because it envolves 3 of my own personal libraries, which are all rather lengthy. But the way i do it is very glitzy(meaning it looks cooler than what it actually does). I use onscreen menus and on screen buttons and things of that sort.

FIREking
p.s. try using mob variables or, make an object that holds all of the building objects

obj
HOLDER
contents = newlist(/obj/wall)
mob/proc
ShowSelections()
src.contents += new /obj/HOLDER
//this should only be called one time
mob/Stat()
statpanel("Building Stuff")
for(var/obj/HOLDER/A in src)
for(var/obj/O in A)
stat(A)
In response to FIREking
thank you so much for taking your time to help. I apreciate it a lot.