Scripts / Question about projectile

Author
Message
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 29th Jan 2019 19:50
I would to know the exact bullet impact coordinates, ie in a wall; I had noticed projectile LUA commands, and I was testing there with a basic script, I've added it to a wall, but they does nothing.



I tried also with g_projectileevent_entityhit with no to avail.
What I'm missing here?

Would be nice some sort of g_projectileevent_entityhit(e) so we can identify the entity hitted by.
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
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 7th Feb 2019 03:37

Honestly I don't know what these functions return, so that's for someone else to answer, but...

I agree to your question-- What projectile does this script "look at" // is the weapon assigned to the function somewhere?

(for testing) Eliminate your [ i f ] statement, (remark it out temporarily) just to make sure
that the if statement is not stopping your debugging line
Try this print out;
TextCenterOnXColor(50,55,3," x: "..g_projectileevent_x.." y: "..g_projectileevent_y.." z: "..g_projectileevent_z,255,255,255)

This goes only one loop though... but if it runs continuously, it might show the whole path?
Useful? Maybe, maybe not?
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 7th Feb 2019 03:50

The first thing I noticed is that these functions do not have capital letters ie 'g_ProjectileEvent_x'
and so- doesn't functions require caps? Are these actually active functions?
yes they are notated as you have used them in global.lua
But... there actually doesn't seem to be a function linked to them-- of course my understanding
of the whole global.lua methods is very sparse. Sorry.

More ideas;
What if you checked g_projectileevent_name = "" for assigning the projectile?

And-- what if you threw that debugging printer into an existing weapon script
Translation;
add TextCenterOnXColor(50,55,3," x: "..g_projectileevent_x.." y: "..g_projectileevent_y.." z: "..g_projectileevent_z,255,255,255)
to your weapon.lua script?? IDK?
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 7th Feb 2019 11:46
Hi 3com - your script will work for projectile weapons (like RPG, Magic Staff etc) but not for hit scan type (pistol. uzi).

Cheers.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 7th Feb 2019 19:12
I've added a new command to get the bullet hit position, it's on GitHub along with the extra particles commands to do the bullet holes.

Not sure when it will make it into the Beta though.
Been there, done that, got all the T-Shirts!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 7th Feb 2019 21:47
That's awesome. Can anyone guide us on how to use these functions?
Do you add to existing weapon.lua or to a dynamic entity in the level?
What are the requirements?

Thanks!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 7th Feb 2019 22:04
Hi guys
I had forgotten this thread, thanks for the answers.
I'll wait 4 best times.

Quote: "I've added a new command to get the bullet hit position,"

Great news.! ty A.M.
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
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 7th Feb 2019 23:43
One test at a time, I've added these TEXT* function calls to
a dynamic entity, (via default.lua)
the weapon.lua script,
the ammo.lua script,
and the gameplayercontrol.lua

I used this; TextCenterOnXColor(50,55,3," x: "..g_projectileevent_x.." y: "..g_projectileevent_y.." z: "..g_projectileevent_z,255,255,255)

Always the numbers are Zero- help!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 7th Feb 2019 23:49
BTW I tried the RPG, and the Ice Staff. Nogo............ ?!?
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 10th Feb 2019 22:46
Also needs to have:

projectileEventType = 1

added to the projectile.txt file (e.g Game Guru\Files\gamecore\projectiletypes\fantasy\fireballice\fireballice.txt). The 'magicbolt' projectile has this already included.

Cheers.
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 24th Feb 2019 22:48
Thanks cybernescence, I've added that to the text.
Now can't figure out where to add the script to call
g_projectileevent_x
g_projectileevent_y
g_projectileevent_z
? I tried it to the weapon script and a dynamic entity? Not working. Any help?
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 25th Feb 2019 21:31
3com's script will work if you call it bullet_xyz.lua (first post).

Attach it to any dynamic entity (and set always active to 1 via properties if you want it to work when not close to the entity the script is attached to).

Have attached the script - works OK.

Using your TextCenterOnXColor(50,55,3," x: "..g_projectileevent_x.." y: "..g_projectileevent_y.." z: "..g_projectileevent_z,255,255,255) instead of the prompt duration command, works too

Cheers.

Attachments

Login to view attachments
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 27th Feb 2019 02:16
Your very good luck cybernescence! I could have swore I had tried all ways before.

It works, maybe I hadn't set it to always active-- just thought I had,
or GG hadn't registered the changes to the saved projectile.txt
Anyhow works now! Thanks. What ya think we can do with this?!?!
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 27th Feb 2019 06:59
Lee’s thinking seems to have been that clouds of poisonous gas or magic effects could be initiated at the projectile’s end point perhaps with the new particle effects from Amen and GraPhix

What I think would be cool would be a portal gun or device so a spinning void of some sort would be created that stays for a few minutes and if the player reaches it in time can then go through it and get teleported elsewhere. A bit like the old ‘sliders’ tv series

Cheers.
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 28th Feb 2019 20:59
Aha!! You guys almost got it! How about a grappler?! You know, ala Fortnite?!
Well, I have a script for that that I will donate to the community, there are
pretty large issues that I don't think I will overcome, (mostly collision inside buildings)
but the basic one is working in a basic way (with said issues.)

I will put it in a new thread so more people might notice it. Hope of our experts can
perfect it!
PM

Login to post a reply

Server time is: 2024-12-22 14:52:22
Your offset time is: 2024-12-22 14:52:22