ID:270998
Dec 4 2006, 3:53 pm
|
|
How do I make it where, you click a button in-game and it does a verb?
|
In response to FriesOfDoom
|
|
FriesOfDoom wrote:
King of Slimes wrote: Thanks. One last HUD question. How do I put the button on the map thats 100x100 but its always on 1,4,1? |
In response to King of Slimes
|
|
Actual HUDs are NOT meant to be placed on maps.
HUD - GhostAnime |
In response to GhostAnime
|
|
GhostAnime wrote:
Actual HUDs are NOT meant to be placed on maps. HUD - GhostAnime <Newbie alert> How do I define a proc? |
In response to King of Slimes
|
|
Er, what type of proc?:
mob/proc //a mob procedure - GhostAnime |
In response to GhostAnime
|
|
GhostAnime wrote:
Er, what type of proc?: mob/proc //a mob procedure - GhostAnime Your code thing says Say is a undefined proc. |
In response to King of Slimes
|
|
My code is an EXAMPLE, meaning it was not suppose to be copied nearly the exact same way... but I'll shed some light as why it did not use the mob/verb/Say() which you have:
It's datum is HUD not mob Say() is referring to src.Say()... however, if I made it usr.Say(), which usr is safe in Click()... - GhostAnime |
In response to GhostAnime
|
|
GhostAnime wrote:
My code is an EXAMPLE, meaning it was not suppose to be copied nearly the exact same way... but I'll shed some light as why it did not use the mob/verb/Say() which you have: Erm, it isnt putting the icon on the screen so I can click it >_> |
In response to King of Slimes
|
|
usr.client.screen += new /atom/movable/HUD
thats how I add it to the screen but usr might not be safe to use, but I can never figure out exactly how to not use usr |
In response to KirbyAllStar
|
|
http://bwicki.byond.com/ByondBwicki.dmb?WhatIsUsr
As you can see, usr is the last client who did something.. meaning it's safe to use in verb, Click() and DblClick() as it is prosecuted exactly when it was clicked, thus making usr = the appropriate client. However, if something is to be called indirectly/delayed or can be called by anything that is NOT a client (such as Bump()), it can lead to unwanted results. - GhostAnime |
In response to GhostAnime
|
|
Ah so if I have proc called Join() and it is called in login, so the player can pick a character it is safe to use usr?
|
In response to KirbyAllStar
|
|
just make a say() proc.
mob |
In response to Xx Dark Wizard xX
|
|
Just wondering what that has to do with my question?
|
In response to KirbyAllStar
|
|
KirbyAllStar wrote:
Ah so if I have proc called Join() and it is called in login, so the player can pick a character it is safe to use usr? Login() is one of those "neutral procs". In theory it's always safe to use usr in it, but it's best to use src: Login() may still be called by another part in the code and it would mean usr could be invalid or null. As a rule of thumb I'd advise to use src whenever possible, and thus extend this to use it in Login() as well. Your Join() proc is as you just said a proc. It would be best to use src or an argument whenever possible. |
In response to Xx Dark Wizard xX
|
|
That wouldn't work, as Say() is referring to the source's Say() verb/proc, not a mob's...
and as I said before, the source is NOT a mob, it's /HUD (and it's parent type if /atom/movable since I forced it to move to that family :( ) - GhostAnime |
In response to GhostAnime
|
|
GhostAnime wrote:
Actual HUDs are NOT meant to be placed on maps. HUD - GhostAnime I have a guestion about the...
worldSay //Say HUD
...part. Does this make it so that if the player types in "HUD" in the bar below it will activate the proc instead of having to click? |
In response to FriesOfDoom
|
|
That's an object... AN OBJECT!! >_>
Here's a basic translation of what I just said: atom/movable/HUD //Not quite, it's more like /HUD being an alias for atom/movable.. but meh And to answer your question, No... unless they typed in ".click worldSay" - GhostAnime |
Set the button as an object or turf, and in the object use the Click() or DblClick() command. It would be a good idea to make the verb instead into a proc, so you could just call that proc instead. This way you could make it so players could use the button and/or the command verb.