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
Page 1 of 2 1 2
Any ideas for my ent_decal issue? #397272
03/17/12 08:48
03/17/12 08:48
Joined: Apr 2005
Posts: 795
U.S.A. Michigan
exile Offline OP
User
exile  Offline OP
User

Joined: Apr 2005
Posts: 795
U.S.A. Michigan
Hey there, so I have a grenade launcher I made in my project which works amazing so far and does exactly what I want it to do. The only problem I am having is trying to figure out how tp produce an explosion mark where the grenade hit something. I know how to use ent_decal and I have already made bullet holes before using c_trace. I have been trying to make this work but its just not looking so good. What i did was call a c_trace when the collision event is called, then place the explosion sprite at the hit location. But its just not working. Here is the code...

Code:
BMAP* exploMark = "burnMarkA.dds";
void asltLauncher_impact()
{
	if (event_type == EVENT_BLOCK)
	{
		c_trace(my.x,vec_rotate(vector(0,50,0),my.pan),IGNORE_ME|IGNORE_PASSABLE|IGNORE_CONTENT); 
		PARTICLE* p = ent_decal(you,exploMark,7+random(50)+50,random(360)); // place a random sized decal at the hit entity 
   	p.lifespan = 160;   // remove decal after 100 seconds
		ent_create(NULL,my.x,exploAsmoke_emitter);
		set(my,INVISIBLE);
	}
}



I keep getting an invalid call error. So does anyone know what I am doing wrong?

Re: Any ideas for my ent_decal issue? [Re: exile] #397277
03/17/12 09:50
03/17/12 09:50
Joined: Apr 2008
Posts: 245
GameScore Offline
Member
GameScore  Offline
Member

Joined: Apr 2008
Posts: 245
at your c_trace you should set SCAN_TEXTURE to create a decal

Re: Any ideas for my ent_decal issue? [Re: GameScore] #397280
03/17/12 10:03
03/17/12 10:03
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
You trace to a level block?
Then don`t use "ent_decal(you,..."
you is not set if the trace hits level geometry, use:
"ent_decal(NULL,..."

Re: Any ideas for my ent_decal issue? [Re: Widi] #397282
03/17/12 10:09
03/17/12 10:09
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Ah dont talk shit, you is NULL when it doesnt hit anything (Level geo)!
He needs SCAN_TEXTURE...

Last edited by Ch40zzC0d3r; 03/17/12 10:09.
Re: Any ideas for my ent_decal issue? [Re: Ch40zzC0d3r] #397285
03/17/12 10:28
03/17/12 10:28
Joined: Dec 2003
Posts: 988
Germany, Magdeburg
JoGa Offline
User
JoGa  Offline
User

Joined: Dec 2003
Posts: 988
Germany, Magdeburg
and use p.material = mat_model; if you use a terrain with mtl_terraintex.
otherwise you get a wrong image of the decal.

Re: Any ideas for my ent_decal issue? [Re: JoGa] #397287
03/17/12 11:11
03/17/12 11:11
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
The problem is that you use c_trace in an event which could trigger another event and possibly cause an infinite loop of event calls. Only functions that are not able to evoke events can be used here (therefore no c_move, c_trace, ...). Placing a "wait(1)" before the c_trace call fixes the problem (you should then probably set "my.event = NULL;" before the wait so the event does not get called again).


@Ch40zzC0d3r: It's nice that you try to help, but please watch your language, sentences like "Ah dont talk shit" are not really necessary.


"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: Any ideas for my ent_decal issue? [Re: Superku] #397288
03/17/12 11:20
03/17/12 11:20
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Yeah sorry but he dont know what he is saying...

Re: Any ideas for my ent_decal issue? [Re: Ch40zzC0d3r] #397290
03/17/12 11:24
03/17/12 11:24
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
And?

No reason to insult anyone, especially when is here way longer than you are.

#Warning

Re: Any ideas for my ent_decal issue? [Re: Rei_Ayanami] #397298
03/17/12 12:32
03/17/12 12:32
Joined: Apr 2005
Posts: 795
U.S.A. Michigan
exile Offline OP
User
exile  Offline OP
User

Joined: Apr 2005
Posts: 795
U.S.A. Michigan
Got it working guys, forgot all about SCAN_TEXTURE, as well as the wait(1); tongue

Thanks for all of your help. Expect a video of my progress very soon laugh

Re: Any ideas for my ent_decal issue? [Re: exile] #397300
03/17/12 12:54
03/17/12 12:54
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
@Ch40zzC0d3r: From the manual:
Quote:

ENTITY* Entity auf das das Decal angebracht werden soll oder NULL, um es auf die Leveloberfläche aufzubringen.

If you want to place the decal at the Level geometry, then use "NULL" for ent_decal`s entity pointer!
And next time please don`t de so harsh...

(hast du mal (wieder !) einen schlechten Tag erwischt?)



Last edited by Widi; 03/17/12 12:59.
Page 1 of 2 1 2

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