Scripts / help with horizontal collision

Author
Message
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 29th Jun 2023 17:54 Edited at: 29th Jun 2023 18:13
I got a script from a post that was started by 'gubbyBlips', Smallg, and Amen Moses about a grappling gun. I just took that and added to it for my needs. I've made it into a UT99 translocater and it works just like it.
1-LMB throws it
2-RMB travels to it
3-Scrollwheel hides it and shows it. I did this so that you can hold 2 items with only one being usable and only the visible one functions.
4-'E' hides it and picks up another so that only one is visible at a time therefore only one works
5-'R' drops the hidden object then shows it on the ground. It can be pick-up again

here is the script

I use either a 'proximty mine or a landmine for this as it's a disc like the transloc.

The problem lies in the 'goto' part of it. Being from a 'grapplinghook' script it wants to pull you to it as soon as it hits something which is fine for the hook. I can evade this by inserting 'g_MouseClick==2' before or after the 'setfreezeposition'. This way it won't pull you until you press RMB. What's happening though is that it sticks to everything, walls, terrain, upside down platforms, etc.... I want it to only 'stick' to the terrain or the 'topside' of a flat object. All else it should fall from or bounce off of. This works fine for UT99 but that old Unrealscript is difficult to read to find out where that's being conveyed, or how. If someone could tell me how to do this it would be greatly appreciated.


here is the downloadable script

Attachments

Login to view attachments
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 30th Jun 2023 10:35 Edited at: 30th Jun 2023 10:35
it's only checking for any collision yes, for your requirements i would say you want to do a normal check to see if the normal direction hit is pointing upwards (use a Dot comparing the normal and upwards)
the normal direction can be returned via a raycast
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 30th Jun 2023 15:19 Edited at: 30th Jun 2023 17:53
Thanks, I'll look into this. This is an option I've yet to try.

edit;
This definitely seems like the way to go. Now I just need to learn how.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 30th Jun 2023 22:00
not perfect but should be a start to get you in the right direction
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 1st Jul 2023 01:02 Edited at: 1st Jul 2023 01:03
Thanks. asis it seems to only 'stick' to flat, upward facing objects which is great. However I'm not sure if it redefined what the 'hit' state was or what but the RMB was only used to goto the 'hit' state but when I clicked it and it was set like you had it nothing happened, and if I clicked RMB while it was 'firing' then the xloc just flew out of control.


I remarked the tthit values here and the RMB now works once the xloc hits the flat surface and I can goto it and it still bounces off of the correct surfaces but if I RMB while 'firing' it's still all whacked out
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 1st Jul 2023 11:23
not sure, i didn't change anything to do with the RMB, i don't even have a RMB i can use in max on my laptop (GG doesn't recognize it as an input) so didn't test it tbh
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 1st Jul 2023 15:20
NP, I'll track that down. And thank you sooo much for the 'point' in the right direction. I never would've gotten that far without it..
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 1st Jul 2023 20:22
i see, the issue looks like the findClearPos() function is intended to place you on the terrain near where your locator landed, this is likely failing if you are throwing the object on top of an entity as the raycast will hit the entity instead of the terrain
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 1st Jul 2023 20:47
The 'idea' behind it that once LMB throws it you should be able to transport to it while in 'firing' or 'hit' states. That's probably why it won't go to it from 'firing' because the RayCast detects no collision while in the air. hmmmm
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 1st Jul 2023 20:50
i see, well i only worked under the assumption it should be landed before you can teleport to it - this version works ok for that.

why is the indentation so whack in this script?
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 1st Jul 2023 22:54
The indentation would be me. It was easier for me to read and keep areas separated that I was working on otherwise I'd start it up in the morning and stare at it wondering what I was working on.
PM
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 2nd Jul 2023 15:06 Edited at: 2nd Jul 2023 16:42
It looks as if it goes to the 'return' state when 'firing' when it should go to 'hit' with the RMB. Strange because it's set to got to 'hit' when RMB pressed between setfreeze..... and transportto..... Where is the area that 'tells' it where to go and when?

It should work like this; If I want to get to a platform high in the sky then I would LMB/fire up towards the platform and then RMB/goto-'hit' and then LMB again while still in the air to go even higher and climb towards the platform. Or I could travel someplace by throwing it then going to it before it hits the terrain and travel faster.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 2nd Jul 2023 23:29
sure, just need to fix the tl.validloc logic a bit to allow it to also count early travel
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 3rd Jul 2023 19:40
Oh Wow! It works just as hoped

Thank you very much for the help on this and for supplying the original version of this to build from.
PM
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 4th Jul 2023 15:51 Edited at: 4th Jul 2023 17:01
I've tested all morning and I think I'm finally ready to put this part down and work on a projectile weapons!
PM

Login to post a reply

Server time is: 2024-11-10 03:13:20
Your offset time is: 2024-11-10 03:13:20