Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
0 registered members (), 631 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
particle effect on player on spacebar #281278
07/26/09 15:10
07/26/09 15:10
Joined: Nov 2008
Posts: 215
V
vertex Offline OP
Member
vertex  Offline OP
Member
V

Joined: Nov 2008
Posts: 215
I want to put a particle effect on my player at a certain vertex number while jumping (spacebar). It would be a short burst-- say 2 to 3 seconds of particles.

I have the partilce effect defined and can get it to show up on the model on the right vertex as a constant process; however, I'm having trouble with the on_space = temporary particle function.

Also, a particle effect mixed in with biped scripts is a challenge because other entities (ai NPC) use them. At one point in testing my player model and my npc characters all had the same particle effect.


Any help appreciated-- with the on_space particle function and or general guidance on its integration into the plybiped template.

(I think it would be easier if I simplified and isolated my player movement scripts first-- i.e. purge unused template script elements, but would like to stick with the templates if possible for now. )

Also, I suppose it would be easier to fake it in an animation-- but particles look much better. Code appreciated but general guidance is fine...

Re: particle effect on player on spacebar [Re: vertex] #281284
07/26/09 15:42
07/26/09 15:42
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
function jumpeffect()
{
var mytime;
if (mytime>0)return; //make sure we dont have multiple effects running
mytim=100;

while(mytime>0)
{
jumpeffect; ////replace this with name of your particle function
mytime-=10*time_step; //how long the effect lasts
wait(1);
}
}

you can call the above function at the beginning of your jump script, OUTSEIDE of the while loop if there is one, hope it works, i didnt spend alot of time, typed it here in the browser... but am sure others will correct me.,..

Re: particle effect on player on spacebar [Re: darkinferno] #281375
07/26/09 22:14
07/26/09 22:14
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
you just need something like this I guess:
Code:
if(key_space && player)
{
	vec_for_vertex(temp,player,VERTEX_NUMBER);
	effect(jump_effect,1,temp,nullvector);
}


It needs to be placed in some while-loop to check all the time, but it doesn't need to be in the player action, and it doesn't replace any other on_space functions which the templates might contain (I got no idea of how the templates work though)

Re: particle effect on player on spacebar [Re: Claus_N] #281525
07/27/09 16:07
07/27/09 16:07
Joined: Nov 2008
Posts: 215
V
vertex Offline OP
Member
vertex  Offline OP
Member
V

Joined: Nov 2008
Posts: 215
That didn't work within the templates, Claus_N-- didn't break anything-- but didn't work either. It was in a game loop. I suspect it's the "&& player" portion not jiving with the templates. Your code put me closer to getting the below that did work, so thank you very very much Claus_N. (Thank you as well, Darkinferno. Though I didn't use your code, I might put a timer. (Increadible FPS video-- good job.))

if(key_pressed(57) == on && MY._biped01_state == biped01_state_jump_const){


playerParticleAnzahlPartikel = 1;
vec_for_vertex(temp,my,440 );//I added this to the easy particle code
effect(playerParticlespezial,max(1,playerParticleAnzahlPartikel*time),temp,nullvector);
//wait(1);

playerParticleAnzahlPartikel = 1;
vec_for_vertex(temp,my,362 );//I added this to the easy particle code
effect(playerParticlespezial,max(1,playerParticleAnzahlPartikel*time),temp,nullvector);
// wait(1);

}


So that's it folks--

Last edited by vertex; 07/27/09 16:09. Reason: took out unused function in code

Moderated by  HeelX, rvL_eXile 

Gamestudio download | chip programmers | 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