2 registered members (Ayumi, 1 invisible),
584
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: still stuck with my phasers
[Re: Bot190]
#148435
08/17/07 21:13
08/17/07 21:13
|
Joined: Nov 2005
Posts: 1,007
jigalypuff
OP
Serious User
|
OP
Serious User
Joined: Nov 2005
Posts: 1,007
|
well here is what i currently have, the bea mworks but will not follow the enemy or the target sprite, and it passes through the enemy but still causes damage, the problem with this is any enemy near enough to the shot one will also get hit, and shields will be useless. all the code is the same as i have posted bar this. this is all the beam weapon code
var phaser_decreasing = 0; function init_player_startup() { while (player == null) { wait (1); } player.phaser = 74; while (1) { if(phaser_decreasing == off) { player.phaser += 0.4 * time_step; // increase power slowly player.phaser = min(74, player.phaser); // limit phaser power 74 } wait (1); } } function beam_weapons { while ((mouse_left == 1)) { if(player.phaser <= 0) { break; } phaser_decreasing = on; player.phaser -= 3*time_step; snd_play (beam_wav, 50, 0); vec_for_vertex(temp,player,3894); ent_create (fphaser_mdl, temp, c_phaser); wait(1); } phaser_decreasing = off; }
var phaser_speed;
function c_phaser { wait(1); c_setminmax(me); my.scale_x = enemy; my.scale_y = 0.2; my.scale_z = 0.2; my.passable = off; my.oriented = on; my.flare = on; my.bright = on; my.ambient = 100; my.pan = player.pan;//--->player.pan and tilt set to camera my.tilt = player.tilt; my.enable_entity = on; my.enable_block = on; my.enable_impact = on; my.polygon = on; phaser_speed.x = 50 * time; phaser_speed.y = 0; phaser_speed.z = 0; while (my != null) {if (my.roll > 150){my.passable = off;} my.roll += 25 * time; c_move(my,vector(phaser_speed*time,0,0),nullvector,ignore_you);/// my._frameCt += 1; if (my._frameCt >= 20) { break; } wait(1); } if (me != null) { ent_remove(me); } }
Why does everyone like dolphins?
Never trust a species which smiles all the time!
|
|
|
Re: still stuck with my phasers
[Re: jigalypuff]
#148436
08/17/07 21:27
08/17/07 21:27
|
Joined: May 2006
Posts: 398
Bot190
Senior Member
|
Senior Member
Joined: May 2006
Posts: 398
|
first off, do you have aim? second, the beam just goes right through the enemy forever right? also, how far are the enemys from the beam when they take damage... it would also help if i could either get the files for the game so i could see it and work on it, or if you posted a video so i could get an idea of whats wrong...
Wait, there isn't a "Make My Game Now" button?
|
|
|
Re: still stuck with my phasers
[Re: Bot190]
#148437
08/17/07 21:42
08/17/07 21:42
|
Joined: Nov 2005
Posts: 1,007
jigalypuff
OP
Serious User
|
OP
Serious User
Joined: Nov 2005
Posts: 1,007
|
there is a targeting sprite and function yes, i can`t figure on how to get it to tie in to the beam weapon though, i have some examples i have been trying. i have zipped up the test level and here is the link, good luck and thanks for helping me out. http://www.4shared.com/file/22274751/fbf5ac3b/test_level.htmlsorry, i forgot to say, it does not have to be a model, if it ca nbe achieved with particles that is just as good. thnks again
Last edited by jigalypuff; 08/17/07 22:38.
Why does everyone like dolphins?
Never trust a species which smiles all the time!
|
|
|
Re: still stuck with my phasers
[Re: jigalypuff]
#148438
08/20/07 15:41
08/20/07 15:41
|
Joined: Aug 2005
Posts: 1,558 HK
vlau
Serious User
|
Serious User
Joined: Aug 2005
Posts: 1,558
HK
|
I found this topic very interesting, so I spent a few hours on that.
You may try my phaserTarget demo, download it under my sig. One important thing is the phaser model, you need to position it well in MED in order to let it scale probably in game, I think you've already know it.
If you want to use your own phaser, you may follow my setting in MED :
MED->File->Preference->Video Out :
Check 2d Grid, Grid Lo = 1.00, Grid Hi = 4.
Load the phaser.mdl, on Topview, zoom in very very close and see how I position and scale the vertices at the worldposition centre and its size.
Hope this helps.
|
|
|
Re: still stuck with my phasers
[Re: vlau]
#148439
08/20/07 15:44
08/20/07 15:44
|
Joined: Nov 2005
Posts: 1,007
jigalypuff
OP
Serious User
|
OP
Serious User
Joined: Nov 2005
Posts: 1,007
|
woo freaky i was just writeing to ask if anyone had gotten anywere when gmail let it be known you had replied to the thread lol, you must have read my mind. i am dl`ing you demo now, thanks and i`ll let you know how it goes
Last edited by jigalypuff; 08/20/07 15:45.
Why does everyone like dolphins?
Never trust a species which smiles all the time!
|
|
|
Re: still stuck with my phasers
[Re: jigalypuff]
#148440
08/20/07 15:49
08/20/07 15:49
|
Joined: Aug 2005
Posts: 1,558 HK
vlau
Serious User
|
Serious User
Joined: Aug 2005
Posts: 1,558
HK
|
Ah, I've forgot to mention the following instruction in my level : "LMB = Fire phaser" Good luck!
|
|
|
Re: still stuck with my phasers
[Re: vlau]
#148441
08/20/07 17:34
08/20/07 17:34
|
Joined: Nov 2005
Posts: 1,007
jigalypuff
OP
Serious User
|
OP
Serious User
Joined: Nov 2005
Posts: 1,007
|
it does seem to work the way i need, it stops when it hits an enemy, getting it to work with my existing code is proveing problamatic lol, but i shall persevere.
Why does everyone like dolphins?
Never trust a species which smiles all the time!
|
|
|
Re: still stuck with my phasers
[Re: jigalypuff]
#148442
08/20/07 21:00
08/20/07 21:00
|
Joined: Nov 2005
Posts: 1,007
jigalypuff
OP
Serious User
|
OP
Serious User
Joined: Nov 2005
Posts: 1,007
|
well i`m stumped again, i just can`t seem to integrate this stoping thingy into my code, nor to follow the targeting sprite, anyone got any ideas at all on how i can work this? please.
Why does everyone like dolphins?
Never trust a species which smiles all the time!
|
|
|
Re: still stuck with my phasers
[Re: Bot190]
#148443
08/21/07 21:14
08/21/07 21:14
|
Joined: Jul 2002
Posts: 2,002 Europe
ShoreVietam
Expert
|
Expert
Joined: Jul 2002
Posts: 2,002
Europe
|
Without reading any of that stuff I can tell you in a few words, how it works. 1. Create your beam model with the length of 1 quant in MED (don't center it, it has to start at the cetner and has to go 1 quant into x direction). 2. use c_trace with my.polygon = on (or whatever this is called now) like this: RESULT = c_trace(vec_from.x, vec_to.x, ignore_something) vec_set(my.x, vec_from.x); vec_diff(temp.x,vec_to.x, vec_from.x); vec_to_angle(my.pan, temp.x); my.scale_x=RESULT; something like that, or take a look nito my Star Wars code: function FNCT_LaserBeam(fptr, tptr, AppVTX)
Last edited by ShoreVietam; 08/22/07 19:20.
|
|
|
|