Ok, I am trying to make it so the icon for the player mob is shown to the player only, not to other players (like for sneaking) and when a specific variable is set the player is shown to the other players. I see only one way of doing this, by screen images, but I do not know how to make the icon move when the player is moving
Is there a better/easier way of doing this?
Example
XXXXXXXXXXXX
XXXXXXXXXXXX
XXXXXPXXXXXX
XXXXXXXXXXXX
XXXXXXXXXX0X
X = random turfs ect
P = Player
0 = player, but not visible to this player, only to theirself
ID:159809
![]() Jan 10 2009, 5:22 am
|
|
![]() Jan 10 2009, 5:44 am
|
|
What you want are the invisibility and the see_invisible variables.
|
Andre-g1 wrote:
What you want are the invisibility and the see_invisible variables. Actually, since he wants every player to be able to see herself, he might go for a mixture of invisibility and the sighs bitflags(SEE_SELF) to achieve the described desired effect. KingCold999 wrote: Ok, I am trying to make it so the icon for the player mob is shown to the player only, not to other players |
Thanks, I got the invisibility working. But how do I make it so these to players can move into the same space (without density=0 because that disrupts another proc.)
|
Temporarily turn density to 0 and then turn it back ? Or check for a mob on the tile you're trying to move, if it exists, set their loc directly.
|
Modify Enter() to allow a player to enter even if someone is there. You will need to do a little work to get this working properly, but it's the only way to properly achieve what you want to do.
|
u could try something like this, idk if it works, i just coded it quick:
mob just set the variable isinvisible to 1 when the player becomes invisible like that |
First of all, invisibility is built in, rendering your isinvisible var useless (you didn't even use it, though!). Second of all, that is pretty much as non robust as you can get. What if he's still supposed to drown when he enters water even when he's invisible? He should do what I said, which is override turf/Enter() to allow him into the turf even if a mob is there.
Don't help people if you don't know much about DM yet. |
i know lots about dm....thats the way i would do it....well...i would edit the code alot to get it so it would work for certain things....but i guess ur right in this case enter would work better
|
Yeah, for these kinds of things IIRC you pretty much have to manually replicate the default Enter() in your code*, at least partially, and that is when taking some shortcuts. Maybe DM should really have an additional hook to do this that determines if a given atom blocks another from movement, as in atom/movable/IsBlockedBy(atom/obstacle) by returning 1 or 0. Then doing something like this would be a simple matter, without needing to softcode default movement processes.
*: Though, using the softcoded Move() proc posted by Lummox [link] as reference or even a base makes it a much shorter work. It should be regardless noted to the OP that the concept of hiding players' existence from others or separating their existences (like having multiple 1on1 fights in the same arena, only the people are invisible to eachother and can't interact) is a wide concept hard to pull off completely in DM, and probably impossible in certain situations. You'd need to have this concept dominate your game's code by checking for it with all possible player interaction, such as area-effect stuff like explosions not affecting "separated" players, etc. Though, for something kept merely to sneaking, this wouldn't bother you much at all, so I'm just rambling. =P Just keep in mind having code like this: mob/verb/Look() ... will alert players to other nearby players, even if they're not supposed to notice them, like being invisible, so it could render sneaking useless. Though for such a simple thing using view() instead will fix the issue. |