Scripts / Grappler! Watch out Fortnite! (wip)

Author
Message
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 28th Feb 2019 21:15 Edited at: 9th Mar 2019 20:10
Edit-- since this was buggy I removed the script.
Will try see if another scipt works later.

Attachments

Login to view attachments
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 28th Feb 2019 21:54
Obviously if you don't like the coordinates text showing, you can erase that,
or comment it out. It is left there intentionally for educational porpoises!

Also, to change the speed (until a new version), you will find in lines 74-76
the number that can change speed. It's the # of frames the player moves.
Also find in 119 a number that is approx 8-10 smaller (in attempt to prohibit
player from entering building.) Fiddle around with it, see what you
can come up with!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 28th Feb 2019 22:29 Edited at: 9th Mar 2019 20:11
Edit-- not quite to par. Will get it soon.

Attachments

Login to view attachments
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 13th Mar 2019 20:30
missed your script, i made one that can handle straight line grapples only, perhaps it can help you with yours?
(i don't know how to handle up / down rotation in GG unfortunately - wish it had more help on the advanced maths )
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
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 13th Mar 2019 22:04
Challenge accepted.

As a first step here is my take on your script, in this one I've replaced some calls with utillib calls, improved performance a tad but not changed the functionality.

Next I will add some 'Funky AmenMoses" math stuff.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 13th Mar 2019 22:32
I'm going to add the funky math bit by bit so you can see what is going on.

First up is adding an up/down component to the carry position.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Wolf
Forum Support
17
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 13th Mar 2019 22:34
Oh boy I like where this is going.
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 13th Mar 2019 22:50
Well, I got a version working great. But nobody looked interested.
LOL. I thought it would be a big hit- nope.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 13th Mar 2019 23:07
Hmm, the next step is going to require some quaternion magic and it's a wee bit late in the day for that so I'll tackle it tomorrow and try to explain what's going on step by step.

@GubbyBlips, feel free to post your scripts as well, can never have enough scripts.
Been there, done that, got all the T-Shirts!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 13th Mar 2019 23:14
Hey guys. Ya know- with all your help- which I truly appreciate,
I am still stuck on my swimming script.
Let me try to explain again. I move player on an entity--
(using "TransportToFreezePositionOnly"), then I allow
the player to turn their direction by actually rotating the entity--
a random item for temp testing with (RotateY[e]).
Anyhow the idea is that they can turn around, any way and any amount
they want, but at a certain point, if they turn the ((entity)) too much, the player
themselves ((ie CameraAngle)) turns with it. Matching the angles of the entity RotateY(e)
to the angles of the player ((CameraAngle) has seemed totally incompatible,
so I can't compare and compute angles... so I'm stuck!

Hey, thanks! And I'm trying out your Grappler now!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 13th Mar 2019 23:23
I see a Camera collection of scripts I think done by
BAG, in the store, which I would like to peek at. Not sure if it would help,
but might get them and see. I thought maybe the camera could "follow"
the entity, but I want some freedom left in direction of travel, before camera turns,
so it acts like a person swiveling their head (maybe 50-60 degrees),
before camera (ie player body) turns. In real life, a person can swim one direction,
and swivel their head, while still swimming the same direction... anyhow. --?!?
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 13th Mar 2019 23:50
Quote: "Well, I got a version working great. But nobody looked interested.
LOL. I thought it would be a big hit- nope.
"

i don't think the scripting forum is ever going to be a big hit here at GG, most people who use GG do so because it promised "no scripting required", if you want to share it's always welcome though, always fun to see different approaches.

this was more of a theory test and should be done differently but i didn't know how to move the player locally (i.e. like the MoveForward(e) command but for the player) so i went with a flat approach - in other engines i would usually just set the object to match the player position & rotation and then move the object/camera forward in the same frame and then raycast to it right away so we don't need to worry about angles and complex math but GG has a very strict order of execution which limits this sort of thing when you need to include physics... will check your additions tomorrow amen, i still don't really know how to use your libs in a practical example so it'll be interesting to see them included
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 14th Mar 2019 01:19
smallg--
My grappler uses a projectile weapon to determine the point of contact,
that's why (maybe someone seen it) that I kept prodding to get the
projectile impact coordinate! I think it was already there, I just had to learn
how to use them! So, hey I might put the script here, and then again,
I'm considering posting it to the store. Well, obviously using the projectile
method simplifies things to a great degree-- except of course we could really
use some talented modelers to make a bona fide, animated grappling gun!
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 14th Mar 2019 09:54
Ah that's a neat idea, I forgot that's even a thing nowadays, I should try messing around with that
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 14th Mar 2019 13:23
ok here's a version using the projectile system, can go up and down now so it's much better.
also as it's now a pickupable weapon i've added support for it to be swapped out for other weapons (and the new weapons won't trigger the grapple of course).

it's not perfect but it works well enough for some fun play testing
p.s. requires the projectiletype .txt file (found under something like C:\Steam\SteamApps\common\Game Guru\Files\gamecore\projectiletypes\fantasy\fireball ) to have projectileEventType = 1 in there somewhere (see attached file)
other than that just make the weapon always active = yes and attach the grapplinghook.lua 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
bluemeenie195
6
Years of Service
User Offline
Joined: 28th Oct 2018
Location:
Posted: 14th Mar 2019 14:42
That is awesome !!!
PM
granada
Forum Support
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 14th Mar 2019 18:06
Quote: "i don't think the scripting forum is ever going to be a big hit here at GG, most people who use GG do so because it promised "no scripting required", "

That’s true,me included .just goes to show what we’re missing,this is looking fantastic

Dave
Windows 10 Pro 64 bit
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 14th Mar 2019 19:38
@smallg, can you take a look at the changes I made to your original script. For any changes that you may be puzzled by can you ask on here why I did them and I'll explain the why. Cheers.

I've attached the latest progress, next up I'll add some quaternion magic and explain it in my next post.

Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 14th Mar 2019 20:14
Welcome to AM's school.
Nice one guys.
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
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 14th Mar 2019 20:41
Ok Teacher's back.

So two additions in this version.

1) A little bit of code you'll find in an awful lot of my scripts which makes the code FPS agnostic:


What this does is basically measure how long between frames and converts it to a fraction relative to a 'standard' frame time, I chose 20 ms as that is 50 FPS which is a pretty good value. Then this fraction can be used as a modifier in all movement related code to ensure that regardless of FPS movement distances will be the same.
The controlEnt bit just ensures that you only run the code once per frame.

2) Quaternion stuff (AKA scary voodoo):



Ok so not really that scary, just don't try to understand how it works (unless you regularly converse with imaginary 4th dimensional friends who can calculate the square root of -1 in their heads that is) just treat it like a magical solution to a difficult problem.
So what does it mean?
Euler angles are evil, manipulating them is just plain impossible so instead we convert them to a quaternion, basically just a magical thing that represents the angular component of the entity.
Once in this magical form we can do stuff like multiply quats together (actually it's nothing like any multiplying you may of come across, trust me I wrote the code!) which results in a new quat that now represents the angular component of the first quat rotated by the second one (the order is important!).

In this case we first convert the current euler angles of the entity to a quat, then we create a second quat representing a rotation around the Y axis (the entities Y axis, not the world axis), 'multiply' them together to get a quat representing the resulting 'real world' angular components, convert them back to Euler angles and Bobby's your gender neutral relative.

Note that GG does stuff in degrees whereas all normal 3D manipulation is done in radians, so make sure to convert to radians right at the start, do all your math and finally convert back to degrees before calling any GG positional functions.

Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 14th Mar 2019 22:09
Final version for tonight, tomorrow I'll show a third (fourth?) way of doing this, with real physics.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 15th Mar 2019 01:01 Edited at: 20th Mar 2019 21:28
smallg-- works just like mine! Cool!

Yours has more complex coding.
Mine is "Red-necked" together, as I'm not familiar
with that fancy self- created function calls in lua.

I gotta concede...

Attachments

Login to view attachments
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 15th Mar 2019 01:31
BTW you will see (whoever tries it), there is a call to show text
of the coordinates of the projectile hit point, and the path.

This can be removed at will, or you can use the grapple to find the
coordinates of any point (sorta) on the map...
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 15th Mar 2019 01:36
AmenMoses... !!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 15th Mar 2019 13:06
Final tweaks to smallg's original method.



I'm going to produce a new script later that uses real physics to detect the 'hit' and when throwing (i.e. using the PushObject command and physlib collision commands like in the pickuppables script).

I've noticed that the TransportToFreezePosition commands will quite happily transport the player to be inside other entities so I'm also going to write a function to check if that would be the case and prevent it.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 15th Mar 2019 16:53
Interesting thread. Thank you.
RIP
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

New:
Intel(R) Core(TM) i5-8400 CPU @ 2.81GHz, 12GB RAM, Nvidia gtx1050ti 4gb, Windows 10 Home 64bit, Screen resolution 1920 x 1080. System Passmark 3774




smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 15th Mar 2019 18:48 Edited at: 15th Mar 2019 18:50
ah so you're using a vector, that makes sense, i've used them a bit but wouldn't have a clue what the actual values are meant to be, i always get confused with them cos they have 4 "directions" but we only think in 3... it's weird stuff
though i see yours only takes 3 x 3 inputs, does it do the conversions behind the scenes? that's very neat
Quote: "local vx, vy, vz = U.Rotate3D( 0, 0, 1, pax, pay, paz )"

i like how simple it is to adjust the direction too, simply swap out the 0's for -1 / 1 for backwards or forwards on the x/y/z axis... i will have to get used to including these in my scripts

i'd definitely be interested in seeing a "real" physics version in GG, i had no idea we can detect actual physical collisions without raycasting? or do you just mean you will push the player with physics in real time rather than teleport him? there is already a ForcePlayer() command but i didn't understand what angle it was supposed to take.
i just added a few raycasts to detect if the player was going to hit anything and stopped/moved him back a bit if so.. it doesn't work 100% though, nope
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: 15th Mar 2019 19:58 Edited at: 15th Mar 2019 20:10
Here is the first stab at a real physics version, unfortunately anything identifying as a weapon has physics disabled within the engine (probably as they are carried so close to the player that if it didn't there would be a fight between the mesh and the player capsule) so to use some things with this version you would have to edit the fpe.

But it works fine with a crate.

@smallg, yes we do have a real physics detection capability, check out the script to see how it can be used.

Basically you register an object that you want collision info about and under the covers the Bullet collision data is collected into a list which can then be periodically checked and acted upon.

Terrain collisions are stored separately from object collisions btw so if for example you wanted to add sound to an object being pushed around you could play different sounds depending on collisions with terrain versus other objects, also the 'force' of the collision is available (basically it is a measure of how far the entity would have penetrated into the thing it hits had the Bullet engine not stopped it doing so, Bullet uses it to determine the forces in rebound situations) but you would have to experiment to work out what values you get from different impacts.

Feel free to ask questions about any parts of the script that you don't understand fully.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 15th Mar 2019 20:08 Edited at: 15th Mar 2019 20:11
As for the 'vectors' question, maybe you are thinking of velocity vectors. A simple 'direction only' vector is x,y for 2D and x,y,z for 3D, a velocity vector usually has an extra value for speed.

Vectors are good to learn because they are used a heck of a lot in lighting, GG's dynamic spotlights use a vector to point them for example.

The physics script version also uses a vector to launch the 'grapple' object, once launched the Bullet engine takes over.

I can't spin the grapple, like in the other version, with quaternions so I'll add that bit next to show how it can be done with 'real' physics. The 'return' code is the same as before though so it will still spin on return to the player.
Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 15th Mar 2019 21:31 Edited at: 15th Mar 2019 21:46
Final version of the physics method, think I've handled most of the issues now, think it is still possible to get stuck in entities but a lot less likely than before.

If you want to inflict spin on an object when you 'push' it the syntax is:

PushObject( objId, vx, vy, vz, rx, ry, rz )

vx, vy, vz is the vector defining the push direction and force, rx, ry, rz is another vector defining the offset from the centre of the object where the force is applied, so for example in the script attached I calculate this as slightly off centre on the x axis which causes the object to spin on the y axis.

Depending on the volume and 'weight' of the entity you use you may have to tweak the force values to get a decent 'throw' effect. The values currently seem to work ok with the standard GG milk crate.

Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
bluemeenie195
6
Years of Service
User Offline
Joined: 28th Oct 2018
Location:
Posted: 16th Mar 2019 00:52
Thanks AmenMoses, smallg, and GubbyBlips for the fantastic scripts. You guys really make the magic happen for the games.
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Mar 2019 15:19
Quote: "As for the 'vectors' question, maybe you are thinking of velocity vectors. A simple 'direction only' vector is x,y for 2D and x,y,z for 3D, a velocity vector usually has an extra value for speed."

could be, unity just uses vectors by default (which are always 4 values but perhaps some are always 0? i'm not sure) but it's not really an issue there as they have commands which do all the work for you so you never really need to worry about inputting actual values, rather compare 1 to another etc

that's much better to get the realistic arc on the throw, looks more natural
i'm still not sure how to rotate to a specific point in 3D though, is there a function in your libs for that? i understand how to move an entity with your Rotate3D() vector now but i only see examples of you setting the angles to match either the player or the entity's angles that already exist... but say for example i wanted to rotate the thrown object to always look in the angle it is arcing (both left / right and up / down, i.e. while it's moving forwards and up i would make it angle up and forwards but when falling it will angle forwards and down) or if i had a thrown object "home in" on a moving object... how would i do that?
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: 16th Mar 2019 15:54
A bit like how the helicopter rotates to point at the player you mean? If I recall it was a bit of a pain to achieve that but it was certainly doable.

Not with real physics though, when the Bullet engine is controlling the position if you try to use any position or rotation commands it basically goes haywire, that's why you have to do the CollisionOff/CollisionOn trick to get smooth movement.

Another place to look is at the gun turrets scripts, they had code to track the player which you could crib from.

Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 16th Mar 2019 17:51 Edited at: 16th Mar 2019 17:52
Like this you mean?

Just attach the script to a couple of entities, always active physics off, and they will turn to face each other.

Edited to add: I did this one as part of a tutorial ages ago, probably around the time I put the quatlib in GG.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Mar 2019 18:20
perfect yes.
i did check your stickied thread but couldn't see it in the list, was i being blind? this will be super helpful !
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: 16th Mar 2019 19:36
No, the helicopter stuff was mostly in Bod's modelling thread which is now closed but the script is dotted around the forums in various other threads, just search for 'helicopter'.

The Gun turrets thread is linked to in my sticky though.

Most of the really cool stuff is in the pickuppables script btw, that script turned into a real monster and I keep meaning to put a much improved version onto GitHub, I've moved all the cool stuff into a new library so the functions can be used for other things.
Been there, done that, got all the T-Shirts!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 16th Mar 2019 19:36
Nice work!
Speaking of turrets tracking things, can they track enemies?
--Maybe there's a thread somewhere for that?
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 16th Mar 2019 19:39
You would have to add some code to make them do that but it's not that difficult to do, the helicopter script has a 'friendly' mode where it will attack the enemy for you for example.
Been there, done that, got all the T-Shirts!
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 17th Mar 2019 18:42 Edited at: 17th Mar 2019 18:46
made your facing function into a separate slow rotation function for easier use


also do you know if it's possible to track an RPG projectile (i.e. get its co-ords) in real time or do we only have access to the final explosion position?
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: 17th Mar 2019 18:51
Not sure if it is possible to get the projectiles position, I'll have a look at the engine code.
If not it probably wouldn't be to hard to add it.

Been there, done that, got all the T-Shirts!
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 17th Mar 2019 23:54
Very nice. Thanks for posting. Great thread.
RIP
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

New:
Intel(R) Core(TM) i5-8400 CPU @ 2.81GHz, 12GB RAM, Nvidia gtx1050ti 4gb, Windows 10 Home 64bit, Screen resolution 1920 x 1080. System Passmark 3774




AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 18th Mar 2019 09:05 Edited at: 18th Mar 2019 10:16
One thing I'd like to point out is that most entities have their origins at the base and the function works out angle from origin to specified point, in most cases you would want the angle from the 'eye point' or 'weapon point', for example in the gun turrets scripts I had to incorporate a y offset so the gun tracks the players body rather than his feet.

btw, congrats on being the first person n the GG world (apart from me)) that I am aware of to use the SLERP function!
Been there, done that, got all the T-Shirts!
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 18th Mar 2019 19:37
Quote: "btw, congrats on being the first person n the GG world (apart from me)) that I am aware of to use the SLERP function! "

i was very pleased to see you included a slerp, it's a very handy function indeed when it comes to doing things smoothly

Quote: "Not sure if it is possible to get the projectiles position, I'll have a look at the engine code.
If not it probably wouldn't be to hard to add it.
"

if it could sneak into a future update that would be great, i'm working on harry's helicopter and he has some neat animations for dodging which would work great for avoiding missiles, currently i am just triggering them randomly if the player is aiming at the helicopter but as projectiles are a lot slower this doesn't really work as well for them
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: 18th Mar 2019 21:04


Slightly tweaked version of the function, see if you can see what I've changed, and maybe even why.

Been there, done that, got all the T-Shirts!
PM
granada
Forum Support
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 18th Mar 2019 22:29
Fantastic work guys,very impressive

Dave
Windows 10 Pro 64 bit
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 19th Mar 2019 23:37
Nice. Very nice. I say nice because it's way over my head.
To avoid embarrassment- let me say nice! haha

So I was just messing around, and it dawned on me suddenly DOH!
That the grappler script you guys constructed looks a lot like that which
would work for a boom-er-ang. Just thought I'd "throw" that idea out there!

It could use a little vertical rise going out, and fall as it comes back-- also how to detect
if it hits the enemy?! Boom for explosion, er for Argh! and ang for Dang! Boom-er-ang!
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 20th Mar 2019 18:35
Quote: "Fantastic work guys,very impressive "

yep thanks amenmoses/chris for all your work improving the scripting side of GG, it's much appreciated!

Quote: "That the grappler script you guys constructed looks a lot like that which
would work for a boom-er-ang. Just thought I'd "throw" that idea out there!"

certainly the physics version that amen posted does, i like the little arc it has like an actual thrown object.
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: 20th Mar 2019 21:36 Edited at: 20th Mar 2019 21:42
I try at least.

No questions about the changes I made?

One other thing that function needs is a little bit of FPS agnosticism, I've demonstrated that elsewhere so I'll leave it as homework for you to add it. What I would do is pass in the timeNow as a parameter because when multiople scripts are called in one frame by GG they all get called in the same thread so g_Time will be the same for all, so basically only the first one called needs to calculate the frame rate difference to apply, all the others simply apply the same calculated difference.

Edited to add:

I've been meaning to ask this for a while, are you interested in making a library with some of the cool stuff in your sticky thread in? If so I can help to create it and push it Lee's way via GitHub if you like, anything you've created that isn't already covered in the existing libraries ( i.e utillib & physlib )would be a candidate for inclusion and maybe you could then re-issue the more popular scripts to use the new library functions.
The reason I put stuff into libraries btw is that, when done correctly, it is way more efficient performance wise and scripts written using generic library functions tend to be easier to understand.
Been there, done that, got all the T-Shirts!
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st Mar 2019 09:52
I think you've already replaced all the functions I had been using with better versions already, I would be more likely to adapt yours to fit other needs but if I do add any to yours I will let you know
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 22nd Mar 2019 02:43
Add to library-- Sounds great (eh, am I talking for anyone but myself?!)

"the helicopter script has a 'friendly' mode where it will attack the enemy for you for example."
Okay. I gotta find that one! Thanks.
PM

Login to post a reply

Server time is: 2024-12-22 20:18:59
Your offset time is: 2024-12-22 20:18:59