Scripts / GG detect collision with axe . is this possible.

Author
Message
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 12th Jan 2022 20:47
OK like the Header says, i want to know, ( and maybe this is a Question best suited for Amenmoses. ) if the player has an axe in his hand and just hit in the air there is no collision correct.? Ok so if you hit and drum with the same axe then GG knows there is collision because you see the steel sparks when you hit the drum, so now we go one step further if you hit ( chop) a piece of wood or lets say a tree then the GG engine also know there was an collision because you then see wood splinters, That means that the Engine knows what kind of material you are hitting because of the wood or steel sparks. .. Ok by keeping that in mind is it then not possible to have a wood chopping script that determents weather the player are chopping a tree / wood with out putting a script on every single tree in the game.??

If this is possible then it would make it so much easier to have a survival game were one has to chop trees without having to put a script on every single tree in your game that you would like to be chopped.
Current W.I.P
TheValley

Windows 10 Pro 64-bit
Intel(R) Core(TM) i5-4590S CPU @ 3.00GHz
RAM 16GB
NVIDIA GeForce RTX 3060 12GB GDDR6
DirectX Version: DirectX 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 12th Jan 2022 21:19
Ok so if you 'chop' a static entity then the engine will create the effect of the 'chop' depending on the 'material' of that entity.

But there is no engine behaviour built in to do anything else, the only way of getting any extra functionality is to make that entity dynamic and attach a script.

Been there, done that, got all the T-Shirts!
PM
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 12th Jan 2022 21:28 Edited at: 12th Jan 2022 21:29
Quote: "Ok so if you 'chop' a static entity then the engine will create the effect of the 'chop' depending on the 'material' of that entity."

But if the engine knows what kind of material is being hit , is there then not a way then to attach a script to an always active entity that can monitor the collision type and then transport it to a workable value.?
Current W.I.P
TheValley

Windows 10 Pro 64-bit
Intel(R) Core(TM) i5-4590S CPU @ 3.00GHz
RAM 16GB
NVIDIA GeForce RTX 3060 12GB GDDR6
DirectX Version: DirectX 11
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 13th Jan 2022 04:50
# F O R T N I T E . . . w/ Epic + Unreal

True, hundreds of trees each with a script can kill fps. But I'm guessing there's just not a Global.lua script function to call that value of current hit material? That is certainly in the engine somewhere, but might require a request @ Github for Lee to supply access to the data.

Seems putting a script on an object that registers the health of it might be your closest access right now- and besides you must destroy the object being hit eventually- right- or you could get 245 semi-truck loads of lumber out of one small tree. Even better than Fortnite!

I did this [LONG time ago] to mimic destroy obstacles (fall trees for example). So easy enough. Maybe you could also blow up stacks of lumber with dynamite for extra points? So standing near a tree (PlayerDistance) and health drops (GetEntityHealth) Try it first and see how it goes.
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 13th Jan 2022 08:51
if the axe is an actual weapon used by the player you want the GetBullethit() function
i.e. local bx, by, bz, m, t = GetBulletHit()
bx,by,bz = the location
m = the material
t = not sure
m will return a number which relates to the index of the material, not all objects will be set correctly but you can prompt it out to see the results as you hit stuff.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 13th Jan 2022 12:08
Yes GetBulletHit() will tell you the location of a hit and any material that has been defined, my bullet holes script uses it, but that doesn't really help as you would still need to figure out what entity is being hit somehow.

i.e. just because the material is 'wood' doesn't mean you have hit a tree!

I suppose you could ray cast around at the hit point and figure out which object is likely being hit and then look to see if that object relates to an entity in g_Entity list then get the name of the entity and process that to see if it might be a tree (although there is no defined standard for naming so it might be "Red Oak" for example).

As long as you plan everything out in advance you could do it that way.
Been there, done that, got all the T-Shirts!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 13th Jan 2022 18:48
@PCS--
Are you kidding!? RTX 3060 12GB GDDR6?! Just noticed- cool.

I just wrote an script w/ player distance and Entity health checks.
Works a treat. One single script on a clean, blue barrel, (rudimentary - no tree falling yet.)

80 trees (for do loop- which usually never significantly effects fps up to 100+)
You could probably have 3060 on your system!

so no frames dropped -- must consider that I am using boxes to test it with,
on an otherwise empty map. Also currently no material detection... possible to add.
Entities must be dynamic which I would imagine would be the case on any
way you try it. ( to get [e]-data )

Well, I will try putting trees down to test on another map. Let's go ye ol GG!

BTW, I see no reason why trees cannot be recycled. Maybe you would only need ~50?
PM
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 13th Jan 2022 19:45 Edited at: 13th Jan 2022 19:48
Quote: "@PCS--
Are you kidding!? RTX 3060 12GB GDDR6?! Just noticed- cool."

yes i got the RTX 3060 for my birthday, so now I'm full on testing Max. hehehe

This card makes a huge difference on a lot of games.
I have been saving for this a long time.
Current W.I.P
TheValley

Windows 10 Pro 64-bit
Intel(R) Core(TM) i5-4590S CPU @ 3.00GHz
RAM 16GB
NVIDIA GeForce RTX 3060 12GB GDDR6
DirectX Version: DirectX 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 13th Jan 2022 20:33
Quote: "i.e. local bx, by, bz, m, t = GetBulletHit()
bx,by,bz = the location
m = the material
t = not sure"


t = third person character entity Id (not sure why I added that tbh, so long ago I can't remember)
Been there, done that, got all the T-Shirts!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 14th Jan 2022 18:22 Edited at: 19th Jun 2022 23:20
Wonder...
Thoughts?
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 14th Jan 2022 22:42
if you mean a weapon that uses the GG system you need to create a gunspec file for it and set it up like the other weapons
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 18th Jan 2022 12:26
Quote: "t = third person character entity Id (not sure why I added that tbh, so long ago I can't remember)"

I always wonder that, ty Amen for the info.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM

Login to post a reply

Server time is: 2024-12-22 01:31:26
Your offset time is: 2024-12-22 01:31:26