ID:122079
 
Keywords: newgame
Well as some of you may know I have recently returned to BYOND and am developing a new game, I have no name and very little info for this game other than it is an rpg, will be multiplayer and will be based loosely of the game play of the elder scrolls games.

The last part of the above is somewhat a lie, I have more information I'm just not sharing :).
My problem is that with BYOND's built in pixel movement I can't figure out how to make a projectile center at the mob that's shooting it.

Here's a screenshot(spoiler alert):

In the screenshot you see me play as the elf( 1 of three playable races, and yes he is a black-blue. In my world elves aren't all good and merry they are evil forest dwelling creatures MWHAHAHA!.) As you can see the fireball is to the side of the player casting it, the blue box represents where I want it, in the center of the player casting it.

If you can help and do so then thank you, if not the I hope you enjoyed the little spoiler. Also I have changed the font for those of you who dislike chiller(you have no idea how much effort that was).
YOU CALL THAT A SPOILER!?!?!?!
Seen as my aim was to release no information, yes I do. Now leave unhelpful person.
I've not used pixel movement much, but I believe you would use the pixel location of the player to offset the projectile.
shoot(mob/owner, blah, blah, etc)
loc = locate(owner)
pixel_x = owner.step_x
pixel_y = owner.step_y

This should work or at least be close, but I've not tested it.
I's step_x and step_y. Instead of the pixel_x and pixel_y. GAWD I ARE SO UNHEWPFULL!
Yeah you're right. Just realized that it would be at the bottom left of the bounding box. Fixed it.
KetchupKid wrote:
I've not used pixel movement much, but I believe you would use the pixel location of the player to offset the projectile.
> shoot(mob/owner, blah, blah, etc)
> loc = locate(owner)
> pixel_x = owner.step_x
> pixel_y = owner.step_y
>

This should work or at least be close, but I've not tested it.

Worked like a charm thanks :).

Kaigne's way didn't work lol.
No problem =).
Lige wrote:
GreatFisher wrote:
Worked like a charm thanks :).

Kaigne's way didn't work lol.

Really? Jail Em! doesn't use pixel_x and pixel_y to offset the projectile. Rather, as Kaigne pointed out, it uses step_x and step_y for each "attack" that isn't melee based.

Regardless, welcome back and good luck on your project. :-)

Thanks and They way ketchup said worked perfectly lol.
my way didn't work? lol bet you didn't even try it.
I did and it didn't work.
GreatFisher wrote:
I did and it didn't work.

obvious lie bai
Are step_x and step_y being done away with? No reference page in the online version. Reading references for step_x and pixel_x, step_x changes the actual pixel location of the atom and pixel_x changes the icon's pixel location. If the collision of your projectiles is pixel based then you may want to set step_x as well as pixel_x for the projectile. Good luck =)
KetchupKid wrote:
Are step_x and step_y being done away with? No reference page in the online version. Reading references for step_x and pixel_x, step_x changes the actual pixel location of the atom and pixel_x changes the icon's pixel location. If the collision of your projectiles is pixel based then you may want to set step_x as well as pixel_x for the projectile. Good luck =)

They might as well do away with it. There both almost the same thing, and fisher said the step stuff didnt work for him =/.
I think he meant he didn't see a change when he set the step_x of the projectile. It obviously contains the right info since the pixel_x is set to owner.step_x, but maybe step_x doesn't affect the icon? Which would be all he would notice without collision tests.
I wasn't lying when I tried kaigne's way nothing happened but I will try it again if you think I should.
Okay it worked, but now ~I have another problem I made a block for collision testing and it deletes the grass behind it on the map when I compile and run, you know why this is.

the code goes:
turf
box
icon = 'turfs.dmi'
icon_state = "box"
density = 1


I can't find anything causing it.
Nope that just changed what happens when I click. In the map editor the map is in it's correct form, with the transparent back of one turf showing the turf behind. As soon as I load the game it creates a black square where the grass should be behind the box.

edit: It doesn't do the same thing if I make it an object.