5 registered members (clonman, TipmyPip, Niels, dBc, 1 invisible),
18,961
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Mortar cannon demo
#320353
04/21/10 07:27
04/21/10 07:27
|
Joined: Apr 2006
Posts: 624 DEEP 13
badapple
OP
User
|
OP
User
Joined: Apr 2006
Posts: 624
DEEP 13
|
iI have'nt made a new demo in a while , so here you go. its one way to make a mortar cannon or catapolt with a targeting system and a neat little radar as well(not perfect but functional and cool anyway) this was made with lite c free , but published so you can check it out if you dont have lite c. the enemies dont attack , they just head towards you and let you obliterate them. but hey at least there's something to shoot at. these codes are free to use no credit is needed.enjoy mortar cannon demo
|
|
|
Re: Mortar cannon demo
[Re: badapple]
#320355
04/21/10 07:53
04/21/10 07:53
|
Joined: Jun 2008
Posts: 428
Rasch
Senior Member
|
Senior Member
Joined: Jun 2008
Posts: 428
|
|
|
|
Re: Mortar cannon demo
[Re: Quad]
#320365
04/21/10 09:22
04/21/10 09:22
|
Joined: Apr 2006
Posts: 624 DEEP 13
badapple
OP
User
|
OP
User
Joined: Apr 2006
Posts: 624
DEEP 13
|
you are right Quadraxas , i geuss because i didnt asingn the target an action or function of its own i forgot to set its flags thanks for the bug report. a new demo has been uploaded with the corrections 
|
|
|
Re: Mortar cannon demo
[Re: badapple]
#320768
04/24/10 12:59
04/24/10 12:59
|
Joined: Nov 2008
Posts: 196 the wrong place
Muhsin
Member
|
Member
Joined: Nov 2008
Posts: 196
the wrong place
|
Hi!
I try to use you explosion code in my project, but when i shoot and the bullet hits something i get this error: "Dangerous intruction in event big_explosion".
( I copied the smoke, big_explosion, big_burn, and shell_event fuctions directly from you code)
what do I do wrong? how can i solve the problem?
thanks!
- Muhsin Kaymak
Last edited by Muhsin; 04/24/10 13:04.
Come and play my new browsergame - Valley Of Wolves: http://www.mafiacreator.com/ValleyOfWolvesHurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it! And be the most feared MafiaBoss in the World!!
|
|
|
Re: Mortar cannon demo
[Re: Landixus]
#320834
04/25/10 09:57
04/25/10 09:57
|
Joined: Nov 2008
Posts: 196 the wrong place
Muhsin
Member
|
Member
Joined: Nov 2008
Posts: 196
the wrong place
|
here is the code i took from you and my rocket code:
------------------------------------------ function fade_smoke(PARTICLE *p)//fade the smoke { p.alpha -= .2 * time_step; p.size+= .4 * time_step; if (p.alpha < 0) p.lifespan = 0; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////// function smoke(PARTICLE *p)//smoke partical effect { p->vel_x = ( .1 )-random(.2) ; p->vel_y = ( .1 )-random(.2) ; p->vel_z = random( .1 ); p.alpha = 10 + random(10); p.bmap = smoke_tga; p.size = 10+random(2); p.flags |= ( MOVE); p.event = fade_smoke; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////// function big_explosion()//explosion from the mortar shell { my.roll=random(360); //make it look a little different each time my.scale_x=1.2;my.scale_y=my.scale_x;my.scale_z=my.scale_x; //scale it up a bit c_trace(my.x,vector(my.x,my.y,my.z-1000),IGNORE_ME|IGNORE_SPRITES|IGNORE_MODELS); my.z = hit.z +2;//place just above ground VECTOR temp; //a temporary vector set(my,PASSABLE | BRIGHT | TRANSLUCENT | UNLIT);//attributes my.alpha=100;//fully visible vec_set(temp,camera.x);vec_sub(temp,my.x);vec_to_angle(my.pan,temp); //look at the cam while(my.frame<20)//play all its frames { my.alpha -= 1 * time_step; my.frame+=1*time_step; wait(1); } my.frame=0; wait(1); ent_remove(my); //bye bye } ///////////////////////////////////////////////////////////////////////////////////////////////////////////// function big_burn() //burn from the mortar shell { my.scale_x=4;my.scale_y=my.scale_x;my.scale_z=my.scale_x; c_trace(my.x,vector(my.x,my.y,my.z-1000),IGNORE_ME|IGNORE_SPRITES|IGNORE_MODELS); my.z = hit.z +1; VECTOR temp; set(my,PASSABLE | TRANSLUCENT); my.alpha=100; my.pan=random(360); while(my.alpha>0) //fade it out slowly { my.tilt=-90; my.alpha-=.4*time_step; wait(1); } wait(1); ent_remove(my);//bye bye burn }
function rocket_event()//event triggered when shell makes contact { my.event=NULL;//stop future instances of this function //vec_set(my.x,my_target.x); //snd_play(exploend_wav,100,NULL); ent_create("explo+20.tga",my.x,big_explosion);//this explosion is upright and faces cam you=ent_create("explo+20.tga",my.x,big_explosion);you.tilt=-90;//same explosion tilted and placed on the ground ent_create("burn.tga",my.x,big_burn);//burn tilted and placed on the ground c_scan(my.x,my.pan,vector(360,180,400),SCAN_ENTS | SCAN_LIMIT); wait(1); ent_remove(my);//bye bye shell } /////////////////////////////////////////////////////////////////////////////////////////////////////////////
action player_rocket() { var fall_speed = 0.9; VECTOR procket_speed; wait (1); my.skill40 = 1; my.pan = you.pan; my.tilt = you.tilt; my.emask |= ENABLE_BLOCK | ENABLE_ENTITY; my.event = rocket_event; my.skill5 = 0;
procket_speed.x = 100 * time_step; procket_speed.y = 0 * time_step; procket_speed.z = 0 * time_step; //procket_speed = * time_step; while (my != NULL) { c_setminmax(me); my.skill5 += time_step;
if (my.skill5 > 20) { procket_speed.z -= fall_speed * time_step; } move_mode = IGNORE_YOU + IGNORE_PASSABLE; ent_move (procket_speed.x, nullvector);
wait (1); } } ------------------------------------------
thanks!
- Muhsin Kaymak
Come and play my new browsergame - Valley Of Wolves: http://www.mafiacreator.com/ValleyOfWolvesHurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it! And be the most feared MafiaBoss in the World!!
|
|
|
|