mob/var |
/* |
Problem description:
Well the default pixel movement makes the beam act weird. like the beam goes about half a tile to the side of me. Any ideas how to fix it?
Code:
Problem description: Well the default pixel movement makes the beam act weird. like the beam goes about half a tile to the side of me. Any ideas how to fix it? | |||
#2 Feb 22 2012, 1:53 pm
|
|
if i use the "." it says that the A.dir is an undefined var anyways im looking into the step vars now.
| |
Ah, I see now. Try this:
I suggest you use this method, as the : operator does not check whether the variable is valid for the referenced object at compile time. The . operator does. This minimizes chance for run-time errors related to the code. If you reference a variable not associated with the object, you'll get an error at run-time when you attempt to use the function. Apologies for being off-topic. I was merely showing you what is a much more preferred solution. The : operator is perfectly fine, but you have to be careful. The . is the safest. | ||
#4 Feb 22 2012, 5:09 pm
|
||
If pixel movement is messing up your projectiles, and pixel movement is not wanted then remove it and its entirety.
If you were planning on setting up a normal projectile system without having to have that unnecessary clot of var/obj/blahblah then you could do it this way:
| ||
#5 Feb 22 2012, 5:22 pm
|
|
You have posted the same exact broken, terrible code in the past. Are you trying at all?
| |
You're specifying the tile location of the target variables, but not the exact pixel location. That just requires a few more simple references and variables, but that's why your beam is off center from the player. I suggest looking up the step_x and the step_y variables to help you out. Extremely simple fix, should be really quick. It'll just require adding a little more code, I see no need to change anything. (Except the : operators...)