ID:175600
 
This is possible yes? Mafia has this. When either side wins, the game automatically reboots. How is that accomplished in code?

-Dagolar
world.Reboot()
In response to Maz
I've never actually worked out with the control pad on byond before. How does it work exactly? I take it there's a procedure for assigning something to a direction or to that middle button. How is that done? This stuff must be like day one for some people.


-Dagolar
In response to Dagolar
The control pad (both the one on the screen and the number pad on the keyboard) simply calls the client verbs North(), East(), South(), and so on. You just define code inside these verbs.
In response to Hedgemistress
What about that little middle button? :}

-Dagolar
In response to Dagolar
client
Center()
code here
In response to Hedgemistress
Northeast()?
Southeast()?
Southwest and Northwest()? Too?

-Dagolar
In response to Dagolar
Dagolar wrote:
Northeast()?
Southeast()?
Southwest and Northwest()? Too?

-Dagolar

Hit F1 in DreamMaker and search on these terms and you'll find them.
In response to Airjoe
Can't figure out how to apply it properly. How do you make it so that if a player presses the center button, they perform a verb. I thought that was simple, and it probably is...but I can't get it to work.

-Dagolar

In response to Dagolar
Dagolar wrote:
Can't figure out how to apply it properly. How do you make it so that if a player presses the center button, they perform a verb. I thought that was simple, and it probably is...but I can't get it to work.

-Dagolar

client/Center()
{
mob.theverb(VerbParameter1, VerbParameter2)
}


Replace theverb and the parameters accordingly.
In response to Theodis
I think I'll understand this if I get a basic verb (and example) working. Why doesn't this work:

client
Center()
usr.say()


-Dagolar

In response to Dagolar
Dagolar wrote:
I think I'll understand this if I get a basic verb (and example) working. Why doesn't this work:

client
Center()
usr.say()


-Dagolar

Since Center is part of the client it's probably safe to use usr, but it's probably better to get in the habbit of avoiding usr. Each client has a mob var which is the mob connected to the client so use that instead.

And from what you posted that should work but you're not passing anything to say which might be your problem since I'm guessing say takes a message as a parameter. You could do something like

client/Center()
{
var/message = input(mob,"What would you like to say?","Say","") as Text
mob.say(message)
}
In response to Theodis
Or, even more compact:

mob
proc
Say(T as text)
world << "[src]: [T]"



client
Center(T = input("What message?") as text)
mob.Say(T)
In response to Theodis
Now I'm getting frustrated. I did that exact code and I got the following errors:

Verbs.dm:127:error: Bad input type: Text

I just don't know how to apply verbs to buttons, like the center button and the "northeast" button and that sort of thing. I've never tried before, and I'm having a heck of a time trying to find any examples of how to apply it.

-Dagolar
In response to Nadrew
I'm trying to make it so that if you are one space away from an NPC, and you press the center button, you talk to them. What is the easiest way to do that?

-Dagolar
In response to Nadrew
This is what I mean. I have this:

obj
Tomb
icon = 'Turf-Town-Broken.dmi'
icon_state = "TTombstone1"
density = 1
verb
Look()
set category = "Communication"
set src in oview(1)
usr<<"This is a tombstone."

then I have:

client
Center()
///???

How do I do it so that if the player hits the center button, it performs the Look() verb that is written into the tombstone obj? Or is there a better way to work this out?

-Dagolar

In response to Dagolar
Verbs.dm:127:error: Bad input type: Text

Sorry for the typo it should be text with a lowercase t.
In response to Theodis
ah...ha...it's okay. [;]
Thanks.

-Dagolar
In response to Dagolar
Dagolar wrote:
This is what I mean. I have this:

obj
Tomb
icon = 'Turf-Town-Broken.dmi'
icon_state = "TTombstone1"
density = 1
verb
Look()
set category = "Communication"
set src in oview(1)
usr<<"This is a tombstone."

How do I do it so that if the player hits the center button, it performs the Look() verb that is written into the tombstone obj? Or is there a better way to work this out?

client
{
Center()
{
var/turf/T
var/obj/Tomb/O
T = get_step(mob,mob.dir)
if(T)
for(O in T)
O.Look()
}
}


This get's the turf infront of the player. Then if there are any objects on T it will call thier Look() function.
In response to Theodis
Looks good, but I get two errors and a warning:

-O:undefined type: O
-O.Look:undefined type: O.Look


-O :warning: variable defined but not used


-Dagolar
Page: 1 2