Code:
turf |
Problem description:
Im trying to make it so that when the player logs in they get to a screen where they would click the button and it would give them a new icon and start them at the predetermined location.
Not sure if this is even coded right, still on the book, but it says my if statement has no effect and i cant figure out what to do
Code:
Problem description: Im trying to make it so that when the player logs in they get to a screen where they would click the button and it would give them a new icon and start them at the predetermined location. | ||
#1 Aug 12 2012, 6:01 pm
|
|
usr.icon = 'firebasetan.dmi'
| |
#2 Aug 12 2012, 7:10 pm
|
||
It still says "If statement has no effect." I coded it a different way and i got no errors but when i clicked on the turf it didnt work. Heres the different way.
| ||
#3 Aug 12 2012, 7:13 pm
|
|
That's because the verb doesn't actually return a value. There's no point to having that if statement anyway, since you have no behavior contingent upon the verb succeeding, or no means to make it fail.
| |
#4 Aug 12 2012, 7:15 pm
|
|
So how should i have coded it?
| |
#5 Aug 13 2012, 1:36 am
|
||
This should work just fine. If it isn't working, you've done something else wrong. Make sure you've placed this turf, and your click isn't being obstructed. Put a debug message in there to make sure that the click isn't being interrupted. | ||
#6 Aug 13 2012, 9:31 am
|
||
Nope still not working the main problem is when i click it doesnt do anything idky
i have this maybe its the problem?
this was supose to bring them to the choose class screen where as i put a blank icon in the middle to give them a palce to go. | ||
#7 Aug 13 2012, 5:02 pm
|
|
src.icon = 'blank.dmi'
| |
This is entirely unhelpful. Given the scenario as to how he's using icon = 'blank.dmi' in Login(), src is already implied.
| |
#9 Aug 13 2012, 5:42 pm
|
|
Lol could there be a problem elsewhere, I mean theres not munch of a code. Its just that login and the other coding that brings them to the choose screen turf on the map. But for some reason clicking the turf does nothing. I also have multiple turfs of the same turf that can be clicked so for example i have like 4 waterstar turfs that are over the part of the choose screen so that any where over it a palyer clciks it would work, but i am hoping thats not the problem.
| |
#10 Aug 13 2012, 6:52 pm
|
||
| ||
Shwb1 wrote:
Don't use usr in procs. I'm not even sure what you were trying to accomplish with this snippet. | ||
Albro1 wrote:
Shwb1 wrote: In this case, actually, usr would work just fine, since it's a proc being called from an action that has a defined usr. It's just bad practice. | ||
#13 Aug 14 2012, 11:42 am
|
||
Actually when i use that code it still doesnt work and it gives me this error: empty type name (indentation error?). When i fix the indentation making it like this:
It still doesnt do anything when I click. | ||
Ter13 wrote:
That was almost right. If clicking isn't doing anything, chances are you need to set the layer and mouse opacity. Like this...
| |||
#15 Aug 14 2012, 2:44 pm
|
|
My god thank you it works now. Had to pause the whole coding but now i can continue thanks again. :D
| |
#16 Aug 14 2012, 2:48 pm
|
|
You're very welcome. I'm glad I could be of some help.
| |