Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 552 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
About Particle pointer #475302
12/01/18 13:26
12/01/18 13:26
Joined: Feb 2003
Posts: 146
RP China
2
20BN Offline OP
Member
20BN  Offline OP
Member
2

Joined: Feb 2003
Posts: 146
RP China
Hi, all.
How to set point PARTICLE* p in other function?

Re: About Particle pointer [Re: 20BN] #475304
12/01/18 13:58
12/01/18 13:58
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
For what purpose?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: About Particle pointer [Re: Superku] #475324
12/02/18 09:05
12/02/18 09:05
Joined: Feb 2003
Posts: 146
RP China
2
20BN Offline OP
Member
20BN  Offline OP
Member
2

Joined: Feb 2003
Posts: 146
RP China
Originally Posted By: Superku
For what purpose?


Hi, @Superku .
I want change p.bmap in other function.

Re: About Particle pointer [Re: 20BN] #475325
12/02/18 09:10
12/02/18 09:10
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You *can* set a global particle pointer to some particle in its (event) function and use that when you manually set the pointer to NULL before particle removal (for example when lifespan gets low), but that's dangerous and can and probably will lead to crashes at some point.

I suggest you either use sprites/ models/ entities or if there's a bunch of those particles, then just use a global variable which the particle checks for:

Code:
var particleVariableBitmapType = 0;

void p_event(PARTICLE *p)
{
	if(particleVariableBitmapType == 1) p.bmap = smoke_bmp;
	else p.bmap = fire_bmp;
}

void p_fnc(PARTICLE *p)
{
	...
	p.event = p_event;
}

effect(p_fnc,...);



"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: About Particle pointer [Re: Superku] #475327
12/02/18 09:20
12/02/18 09:20
Joined: Feb 2003
Posts: 146
RP China
2
20BN Offline OP
Member
20BN  Offline OP
Member
2

Joined: Feb 2003
Posts: 146
RP China
@Superku
Thank you so much.
This is the best solution for me!


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

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