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), 559 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
ent_decal and manually setting hit struct #470673
01/29/18 18:08
01/29/18 18:08
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Howdy,

With ent_decal I want to place decals without doing a c_trace before it. According to the manual you can manually set the hit.x(yz), hit.nx(yz) and hit.model = NULL and it should work. For me it doesn't though (I don't seem them anywhere), I guess I am setting hit.nx wrongly but I am not sure. (Also if I do it with a c_trace it does work so I am setting some of the hit struct wrongly.)

Code:
hit.model = NULL;
		debug_var1 = hit.x; //correct coordinates
		debug_var2 = hit.y;
		debug_var3 = hit.z;
		vec_set(hit.nx, hit.x);
		vec_normalize(hit.nx, 1);
		PARTICLE* p = ent_decal(ent, _bmap, _size, _rot); 
		p.lifespan = _time;



Ty for taking the time!

Re: ent_decal and manually setting hit struct [Re: Reconnoiter] #470715
02/01/18 10:46
02/01/18 10:46
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Anyone got an example where it works for them?

Re: ent_decal and manually setting hit struct [Re: Reconnoiter] #470721
02/01/18 16:43
02/01/18 16:43
Joined: Oct 2008
Posts: 681
Germany
Ayumi Offline
User
Ayumi  Offline
User

Joined: Oct 2008
Posts: 681
Germany


Code:
action SetDecal()
{
	hit.model = NULL;
	vec_set(hit.x, vector(-7059, 3087,595));
	vec_set(hit.nx, vector(-0,-1,0));

	BMAP* bmp = bmap_create("HoleGuns.dds");
	PARTICLE* p = ent_decal(me, bmp, 0, hit.nx); 
	p.lifespan = 10000;
	
}


Re: ent_decal and manually setting hit struct [Re: Ayumi] #470766
02/05/18 20:40
02/05/18 20:40
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Hi Ayumi, thanks for the example. I found out that my problem was that I didn't properly set hit.x. Eg with some models setting hit.x(yz) to my.x(yz) doesn't show the bmap but for some models it does, probably because there isn't a vertice at that exact position or such). And than I tried the hit.x(yz) from a c_trace with USE_BOX which never worked for me (maybe cause the hit.x pos is to far away from the hit.entity/model). I think I will try the pos of the nearest vertex to the hit.x for a proper hit.x.


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