Scripts / New IntersectAll() and raycasting.

Author
Message
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 14th May 2017 09:14
Does anyone have any hints on how to use this command. A quick video would be cool, does it need to be used with PlayerLooking(e,a,b) command.

Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 14th May 2017 09:54 Edited at: 14th May 2017 10:02
Here's an example from one of my latest experiments:



Rotate3D simply rotates the vector by the specific Euler angles, you can find it in any of my big scripts (helicopter.lua for example)

The above snippet is part of a larger script, I excecute the snippet every 10th of a second and it simply detects any active entity directly in front of the player. The rest of the script (still in development) will replace my pickuppable.lua script which allows the player to pick-up/carry/stack/drop moveable entities.
Been there, done that, got all the T-Shirts!
PM
Ratall
16
Years of Service
User Offline
Joined: 29th Jun 2008
Location: Not Here
Posted: 14th May 2017 10:53 Edited at: 14th May 2017 10:54
Tarkus1971 you shouldn't need to ask this stuff it should be in a manual.

One that list all the commands that are specific to gameguru and what they do plus maybe a few examples.
There now several 100 commands and more coming all the time.
How much time is being wasted having to use this try it and see approach?

Which would you rather do
A) decide what you want to do , look up the commands and get on with creating your master piece or
B) spend hours maybe day trying to find the correct commands and figuring out how to use them.

Whats the point of all these amaze commands if only a few people can figure out how to use them.

The option for a dedicated lua manual is on the voting board.

Remember the longer its left the more commands that will be out there and the longer it will take Lee to produce it.
and once its out Lee can just add to it as he adds new commands.
“Everything should be made as simple as possible, but not simpler.”
Albert Einstein
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 14th May 2017 12:12
Each command has a brief comment against it to tell you what it does, it doesn't take that long to work out how to use it, especially if you simply search the Lua scripts for the command to see how Lee uses it!

Been there, done that, got all the T-Shirts!
PM
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 14th May 2017 12:36
ok I'll take a good read this afternoon. Thanks.
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 14th May 2017 14:46
Its just the sane as any other ray cast I've seen in tgc products so if youve used 1 before then you will be fine otherwise....
You set 6 co-ords and 1 obj number to ignore (its optional and can simply put 0 here to include all entitys - but note this is the obj number and not the entity number *longer value found near the entity number in the status bar*)

IntersectAll(x1,y1,z1,x2,y2,z2,obj)

Where x1,y1,z1 are the start of the ray and x2,y2,z2 are the end - this is important to remember as the command will only return the first object hit.

Obj refers to an object number you would like to ignore - normally the object casting the ray so it won't hit itself as soon as it starts casting (note the first person camera doesn't have an object).

The command returns nil if no hit detected so make sure you account for this or your script will crash.

lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 14th May 2017 15:35
Basic LUA I can read and see what it's all about, but all these new commands, especially these new intersect commands just give me a headache, my brains just not wired for them.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 14th May 2017 15:50
An absolute minimum requirement for any 3d game engine is to understand 3d coordinates, angles and how to compute the relationships between 3d objects within the game world. I recommend getting hold of a book, a proper one, about the subject and read it through at least half a dozen times until you understand at least half of it.

When you have done this you will find that the way Lee has put GG together and the commands and syntax he has developed is indeed at the 'simple' end of the spectrum. I can't imagine even attempting the helicopter scripts in another engine, or at least being able to so quickly achieve the results that I did.

For some things I wish Lee didn't use the simple approach, for example It is really a pain having to convert angles from degrees to radians and back again but I appreciate that most people are more comfortable thinking in degrees even though mathematically radians are much more usable.

Been there, done that, got all the T-Shirts!
PM
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 14th May 2017 18:39 Edited at: 14th May 2017 18:41
Quote: "I recommend getting hold of a book, a proper one, about the subject and read it through at least half a dozen times until you understand at least half of it."


That wouldn't work for me unfortunately, I have learning difficulties, I can't learn by reading books, it just doesn't sink in, I have what is called convergence insufficiency disorder, basically my eyes can't focus on small words in a sentence (words like and it the or is, and so on) and sentences end up not making sense unless I really concentrate hard. Makes it very difficult to learn by reading. The only way I can learn properly is by having it shown to me step by step and mimicking until it sinks in, it's really frustrating because IQ rating is pretty high, and I know I should be able to learn things esily, but I can't, that along with minor OCPD and ADHD and my life sucks.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 14th May 2017 19:21 Edited at: 14th May 2017 19:21
just imagine it like a bullet, you fire it from it's start point (like the gun's location in the real world) at another point (where you are aiming)... this bullet isn't armour piercing so if it hits anything then it stops and that's the result it gives.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 15th May 2017 17:21 Edited at: 15th May 2017 18:00
yeah i kind of understand what it's supposed to do, i just don't understand how to put it together.

On the plus side, i mus be learning something, i found, debugged, and fixed an error on Bethesda/Zenimax' LUA scripting system in Elder Scrolls Online last night, seems like they set their LUA memory limit way too low and tons of addons are showing memory limit errors lol

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.

Login to post a reply

Server time is: 2024-12-23 05:35:03
Your offset time is: 2024-12-23 05:35:03