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
3 registered members (AndrewAMD, Ayumi, NewbieZorro), 14,141 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
check material in an event #104957
01/02/07 21:47
01/02/07 21:47
Joined: Dec 2005
Posts: 252
MyOwnKingdom
nipx Offline OP
Member
nipx  Offline OP
Member

Joined: Dec 2005
Posts: 252
MyOwnKingdom
Im currently working on a FPS code. A bullet moves and it hits probably a block
So it starts the event function and if(event_type==event_block).

When the bullet hits a wodden surface it will remove. But if it hits a metal surface it should bounce off.
I though I could handle that with different materials but I dont know how to check in an event function the material of a block.


hope you can help me.



thx nipx

Re: check material in an event [Re: nipx] #104958
01/02/07 22:39
01/02/07 22:39
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
Probably there is another easy or correct way to do it, but if you use c_trace you can use scan_texture and retrieve the tex_name string of the object texture and then check that information to remove or bounce the bullet.
Just an idea.

Re: check material in an event [Re: demiGod] #104959
01/03/07 07:57
01/03/07 07:57
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
you can check this with
if(!= 0)
that means if nothing is hit at least
I use this in my code to check if nothing has been detected


Visit:
schwenkschuster-design.de
Re: check material in an event [Re: aztec] #104960
01/03/07 16:36
01/03/07 16:36
Joined: Dec 2005
Posts: 252
MyOwnKingdom
nipx Offline OP
Member
nipx  Offline OP
Member

Joined: Dec 2005
Posts: 252
MyOwnKingdom
I though about a trace but if I use many different metal textures this could become a quite long if(..) and tracing whenever a bullet hits a block will slow down the game


aztec, what do you mean with if(!=0)? in a trace?



nipx

Re: check material in an event [Re: nipx] #104961
01/03/07 17:03
01/03/07 17:03
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
Another way possibly could be:

- if you use models, you can assign a skill to each type of object like my._typeID = 1 for wood textured objects, and my._typeID = 2 for metal textured objects. Then just use that information in the event - if(event_type == event_entity)&&(you._typeID == 1), remove the bullet, if you._typeID == 2) just bounce.
Its another idea


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