Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (AndrewAMD, TipmyPip, NewbieZorro, Grant), 14,196 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
can you guys help me pls... #253100
02/22/09 19:50
02/22/09 19:50
Joined: Nov 2008
Posts: 29
Philippines
ZeroEight Offline OP
Newbie
ZeroEight  Offline OP
Newbie

Joined: Nov 2008
Posts: 29
Philippines
my character has a elemental sword and i want it whenever i press key_1 for example,the particle attached to it will change to fire like particle or when i press key_2 it will change to ice like particle.i got all the particle i needed(fire,ice,wind and earth),the problem is i need to hold the 1 on my keyboard to keep the fire particle running and when i release it the particle will disappear..

thanks in advance...

Re: can you guys help me pls... [Re: ZeroEight] #253101
02/22/09 20:03
02/22/09 20:03
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
One idea:
put the particle effect call, into a while loop (maybe the one of the character) and call the effect if the sword is in use.
Next: use a variable for the kind of particle effect the sword should emit. I will name it: sword_ParticleNr
Now for each different particle effect you'll have one number, in your example:
sword_ParticleNr = 0 if its none
sword_ParticleNr = 1 if its fire
sword_ParticleNr = 2 if its ice

Now when you want to call the effect put in an if-else branch to call the right function for the right state of the sword (fire, ice)

For your keys: write two functions and attach each of it to one key:
Code:
function sword_SetFireEffect()
{
  sword_ParticleNr = 1;
}

function sword_SetIceEffect()
{
  sword_ParticleNr = 2;
}


Re: can you guys help me pls... [Re: Xarthor] #253102
02/22/09 20:04
02/22/09 20:04
Joined: Nov 2008
Posts: 29
Philippines
ZeroEight Offline OP
Newbie
ZeroEight  Offline OP
Newbie

Joined: Nov 2008
Posts: 29
Philippines
thanks sir,i'll try that..

Re: can you guys help me pls... [Re: Xarthor] #253294
02/23/09 21:02
02/23/09 21:02
Joined: Nov 2008
Posts: 29
Philippines
ZeroEight Offline OP
Newbie
ZeroEight  Offline OP
Newbie

Joined: Nov 2008
Posts: 29
Philippines
hmmm,the problem now sir is the particle never stops.it can change the elements but when i press 1 to 4 all the elements stays on the sword..

Re: can you guys help me pls... [Re: Xarthor] #253296
02/23/09 21:11
02/23/09 21:11
Joined: Nov 2008
Posts: 29
Philippines
ZeroEight Offline OP
Newbie
ZeroEight  Offline OP
Newbie

Joined: Nov 2008
Posts: 29
Philippines
is there any code that can stop a current running function??

Re: can you guys help me pls... [Re: ZeroEight] #253297
02/23/09 21:16
02/23/09 21:16
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
of course but it is based upon your implementation. until you show use some parts of your code I cannot help you further but saying that the effect function of one effect should only be called when the elements var has the right number.

edit:
when posting code (in case you are going to), please use the [ code ] [ / code ] for better readability, thank you.

Re: can you guys help me pls... [Re: Xarthor] #253299
02/23/09 21:20
02/23/09 21:20
Joined: Nov 2008
Posts: 29
Philippines
ZeroEight Offline OP
Newbie
ZeroEight  Offline OP
Newbie

Joined: Nov 2008
Posts: 29
Philippines
here my code sir..
Code:
function change_elem()
{
	if(key_1==1)
	{
		my.elem_stat = fire;
		if(my.elem_stat == fire)
		{
		im_on_fire(); //function of fire particle
		}
	}
	if(key_2 ==1)
	{
		my.elem_stat = ice;
		if(my.elem_stat == ice)
		{
		im_on_ice();  //function of ice particle
		}
	}
	else
	set(my,INVISIBLE | PASSABLE);
}


Re: can you guys help me pls... [Re: ZeroEight] #253300
02/23/09 21:30
02/23/09 21:30
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
And how does the "im_on_fire()" function look like?

Also:
what is the set(my,INVISIBLE | PASSABLE); line supposed to do?
Who calls change_elem() ?


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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