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
3 registered members (MadJack, AndrewAMD, Quad), 540 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
SOLVED: ent_decal crash #448770
02/20/15 23:27
02/20/15 23:27
Joined: Jan 2005
Posts: 330
USA
M
MatAllum Offline OP
Senior Member
MatAllum  Offline OP
Senior Member
M

Joined: Jan 2005
Posts: 330
USA
Can anyone fathom why the following code works in a test level:
Code:
result = c_trace(camera.x, temp, IGNORE_YOU|IGNORE_PASSABLE|SCAN_TEXTURE|USE_POLYGON);
you = hit.entity;
if(result > 0)
{
	PARTICLE* p = ent_decal(you, bullethole, 10, random(360));
}



... and yet, when I put the code into practice, the game hard-crashes immediately upon bullet impact?

Code:
bullet_private_var = c_trace(gl_event_source,target_pos, IGNORE_ME|IGNORE_YOU|IGNORE_PASSABLE|IGNORE_PASSENTS|ACTIVATE_SHOOT|SCAN_TEXTURE);
you = hit.entity;
ENTITY* victim = you;
if(trace_hit)
{
	PARTICLE* p = ent_decal(you, "bulhole.tga", 10, 0);
	...



If anybody has ideas, I'd love to hear them.
Incidentally, if I put a bullet hole on an object with a shader, the bullet hole is just a black square with a line down one side. How would I fix that?

Re: ent_decal crash [Re: MatAllum] #448771
02/21/15 00:15
02/21/15 00:15
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 are giving a STRING(*) object instead of a bitmap to the function, which is why the game probably crashes.


"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: ent_decal crash [Re: Superku] #448772
02/21/15 00:52
02/21/15 00:52
Joined: Jan 2005
Posts: 330
USA
M
MatAllum Offline OP
Senior Member
MatAllum  Offline OP
Senior Member
M

Joined: Jan 2005
Posts: 330
USA
Oh my goooooooddd: 1. Wow, I can't believe I missed that. 2. You're a genius, thank you.

No more crash, although now it tells me "file not found" with just a paragraph symbol, and the black square on shader problem is still present.

Last edited by MatAllum; 02/21/15 00:58.
Re: ent_decal crash [Re: MatAllum] #448774
02/21/15 02:40
02/21/15 02:40
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 are welcome.
Try giving the particle/ decal a different material than the shader.
I don't know about the file not found error though.


"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: ent_decal crash [Re: Superku] #448782
02/21/15 13:46
02/21/15 13:46
Joined: Jan 2005
Posts: 330
USA
M
MatAllum Offline OP
Senior Member
MatAllum  Offline OP
Senior Member
M

Joined: Jan 2005
Posts: 330
USA
Okay, I'll see if that works. Sounds like a good idea though.

Re: ent_decal crash [Re: MatAllum] #448787
02/21/15 16:13
02/21/15 16:13
Joined: Jan 2005
Posts: 330
USA
M
MatAllum Offline OP
Senior Member
MatAllum  Offline OP
Senior Member
M

Joined: Jan 2005
Posts: 330
USA
WE HAVE GOT THIS!

All works perfectly.

Also, for others' reference, make sure you don't directly set the decal particle's flags variable.

You need to OR stuff onto it like this: p->flags |= TRANSLUCENT;
Rather than like this: p->flags = TRANSLUCENT;

Just spent half an hour wondering why my decals were duplicating themselves in the center of the map, and that was why.

Re: ent_decal crash [Re: MatAllum] #448800
02/21/15 18:08
02/21/15 18:08
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Don´t you use the "set" macro?


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: ent_decal crash [Re: alibaba] #448838
02/23/15 12:24
02/23/15 12:24
Joined: Jan 2005
Posts: 330
USA
M
MatAllum Offline OP
Senior Member
MatAllum  Offline OP
Senior Member
M

Joined: Jan 2005
Posts: 330
USA
Sometimes. Other times I forget or have one reason or another not to use it.


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