Gamestudio Links
Zorro Links
Newest Posts
Bug in train mode, or it seem to me
by jcl. 09/22/26 14:47
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 09/22/26 12:21
Capital slider is not saving in Z12
by Petra. 09/22/26 06:49
Parent/child object
by VoroneTZ. 09/22/26 05:52
Zorro tutorial ideas?
by AndrewAMD. 09/21/26 14:50
Trades during a running bar
by Martin_HH. 09/21/26 12:03
Avoiding pop-up training parameter results
by Martin_HH. 09/16/26 21:31
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 1,567 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
lopezsergio07, mistery, lokkalyansamiti, rahulbuilds, speedx
19237 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
laser targeting #136365
06/13/07 22:37
06/13/07 22:37
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline OP
User
tompo  Offline OP
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
A little contribution how to make a laser (light) targeting not using a model but bmap, which looks better I think and it's more easy to do
You can add a alpha schannel or etc

If you want to see it in action look at my "space war" project in "showcase I" section LINK
all of the others ships are using this code but only player doesn't... yet
And of'course You may change vecotr to vec_for_vertex for better looking

Code:
 
var my_target[3];
function laser_targeting
{
my.passable = on; my.oriented = on; my.facing = off;
my.flare = on; my.bright = on;
while(you)
{
proc_late();
c_setminmax(me);
vec_set(my.x, you.x);
vec_lerp(my.x,you.x,my_target.x,0.5);
vec_set(temp, you.x);
vec_sub(temp, my.x);
vec_to_angle(my.pan,temp);
my.tilt += 90;
my.scale_y = vec_dist(you.x,my_target.x) / 5; //5 is the height of the bmap
wait(1);
}
}

action gun_action
{
ent_create("your.tga",my.x,laser_targeting); //small one like 5x5
while(me)
{
vec_set(my_target, nullvector);
my_target.x = 500; //lighting range
vec_rotate(my_target, my.pan);
vec_add(my_target, my.x);
wait(1);
}
}



Last edited by tompo; 06/14/07 09:35.
Re: laser targeting [Re: tompo] #136366
06/14/07 04:24
06/14/07 04:24
Joined: May 2005
Posts: 819
U.S.
Why_Do_I_Die Offline
Warned
Why_Do_I_Die  Offline
Warned

Joined: May 2005
Posts: 819
U.S.
Looks like a very good contribution , might come in handy for my current project.


Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1