Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Akow, 1 invisible), 1,499 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 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 | 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