Good news, bad news, and 'I hope you aren't going to fuck with tools' news.
Good news:
I got them kinda working
Bad news:
The tool finder freezes the game
'I hope you aren't going to fuck with tools' news:
here's how you currently add an event to the left mouse button:
object_event_add(ToolGunO,ev_step,0,'
event_inherited()
if(mouse_check_button_pressed(mb_left)){
firing = 1
var hit;
var x1,y1,xm,ym,len,xm2,ym2,len2;
var hitline;
len=2000;
len2=len;
x1=round(PlayerO.x+xoffset*image_yscale);
y1=round(PlayerO.y+yoffset);
x2=round(PlayerO.x+xoffset*image_yscale)+lengthdir_x(len,point_direction(x,y,mouse_x,mouse_y));
y2=round(PlayerO.y+yoffset)+lengthdir_y(len,point_direction(x,y,mouse_x,mouse_y));
while(len>1) {
xm=(x1+x2)/2;
ym=(y1+y2)/2;
hitline = false;
if(collision_line(x1,y1,xm,ym,CollisionMap,true,true)>=0) {
hitline = true;
color = c_aqua
} else if (collision_line(x1,y1,xm,ym,ObjectO,true,true)>=0) {
hitline = true;
color = c_white
}
if(hitline) {
x2=xm;
y2=ym;
} else {
x1=xm;
y1=ym;
}
len/=2;
}
with(ObjectO) {
if(collision_line(other.x,other.y,other.x2,other.y2,id,true,false)>=0){
instance_create(other.x2,other.y2,RingEffectO)
image_xscale *= -1
exit;
}
}
}
');