Hi. I was wondering if anyone knew how to make 'flight' on a game. I just cant seem to do it. I have this so far:
verb
flight()
set category = "Battle Commands"
icon_state = "flight.dmi"
layer = MOB_LAYER+1
could someone tell me what im doing wrong? Thanks. (i'm sure some of you oldbies know this one :)
-=Dracon=-
ID:150942
![]() Jun 29 2001, 1:34 pm
|
|
Ya, I am new :) Thanks
But can you tell me how to make it so you can fly over stuff? I really need to know. Thanks -=Dracon=- On 6/29/01 4:59 pm Spuzzum wrote: On 6/29/01 4:34 pm Dracon wrote: |
On 6/29/01 5:19 pm Dracon wrote:
Ya, I am new :) Thanks Well, to start with, you need to realize that there is no way to "fly over stuff." There is no flight in BYOND. There isn't, for that matter, any stuff to fly over. It's all just pictures on your screen, representing stuff. With that in mind, think about what it is you're actually trying to accomplish here: you want to make it so that certain players, who are marked as "flying", will be able to move into/past the same squares as other players and other dense objects, right? The simplest way to do this (but not always the most satisfactory one) is to set the flying character's density to 0. This will let them "fly over" (actually, co-exist in the same square) as anything else in the game. If you want to make it so that some things can be flown over and others can't, or so that two flying characters can't enter the same square as each other, that gets a little more complicatd, because you'll actually have to over ride the movement procedures with your own. |
Easy method:
Set their density to 0. That might cause problems later, though, like if you only want them to be able to fly over objects, and not dense turfs, or only over some turfs but not all. In that case, you'd have to change turf/Enter() and/or mob/Bump() to allow for that in certain cases. -AbyssDragon |
On 6/29/01 5:19 pm Dracon wrote:
Ya, I am new :) Thanksnot sure but try this for every wall you want to have your person be able to fly over add this after it but make sure to add tabs where I put a bunch of spaces: if(usr.fly = 1) src.density = 0 (if this or src.opacity doesn't work remove the src and the period) src.opacity = 0 (only add this if you want it so you can't se past it) else src.density = 1 (same thing above) src.opacity = 1 (same thing above) and change your code to this: verb flight() set category = "Battle Commands" icon_state = "flight.dmi" layer = MOB_LAYER+1 usr.fly = 1 mob var/fly = 0 tell me if it doesn't work and post the code you made it into. |
for every wall you want to have your person be able to fly over add this after it but make sure to add tabs where I put a bunch of spaces: Goodness, no, don't do that! That permanently changes the wall to be forever non-opaque after someone flys over it, and it only becomes opaque when someone bumps into it. (Actually, that code would give an error, because it's not inside a proc.) It's much more efficient to override turf/Enter() to return 1 or 0. turf/nowalkinghere/Enter() if(usr.fly) return 1 else return 0 If usr.fly is set to 1, they can enter the 'nowalkinghere' turf. Otherwise, they can't. Remember to set usr.fly to 0 when they stop flying, though. |
Hopefully, that's subclassed under /mob, or that won't do anything anyway.
You're setting the icon_state, not the icon. Icon states are contained inside of the icon itself. You'd want to set the icon to 'flight.dmi', not the icon_state to "flight.dmi". (Note that icons are set inside apostrophes, not quotes, as well.)
Also, the only thing that your flight would do currently is just make it so their (new) icon is above other peoples'. It wouldn't let them fly over stuff. That's a little more complex, though.
And, since I don't recognise you, I'll say "Welcome!" =)