Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
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
2 registered members (TipmyPip, izorro), 556 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
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