Scripts / portal gun

Author
Message
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th Mar 2019 19:30 Edited at: 28th Mar 2019 13:53

place a weapon that fires a projectile with the setting "projectileEventType = 1" (i.e. files/gamecore/projectiletypes/fantasy/fireball/fireball.txt)
give it portal_gun.lua
place 2 decals to use as your portals near the gun, give them portal.lua (the script will automatically assign & hide these)
assign sound0 a looping sound when player is nearby
assign sound1 a sound that is played when teleporting the player

edit - 28/03/2019; adjusted rotation to better match the hit surface (thanks to amenmoses again )
fixed the entity number error
*please redownload portal_gun.lua*
feel free to edit and improve as you wish
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: 25th Mar 2019 20:04 Edited at: 25th Mar 2019 20:06
If you change this to use a particle generator then you can rotate the 'decal' to be flush with the object.

All the code to do this is in the attached script.


btw: I haven't tested it yet but it should be possible to have a single image as a 'particle sprite sheet', i.e. 1x1 is a valid size for a sprite sheet.
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: 26th Mar 2019 21:27
Wow ! Another great one.
Thank you.
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 26th Mar 2019 21:49
Awesome.
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




GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 26th Mar 2019 23:54
Yes!
PM
Avenging Eagle
19
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 27th Mar 2019 08:27
Fantastic work!

AE
bluemeenie195
6
Years of Service
User Offline
Joined: 28th Oct 2018
Location:
Posted: 27th Mar 2019 16:45
Hi smallg,
I got this error trying your script.

Attachments

Login to view attachments
PM
devlin
10
Years of Service
User Offline
Joined: 12th Feb 2014
Location:
Posted: 27th Mar 2019 16:58
thank you.
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 27th Mar 2019 19:07
thanks guys, this was just thrown together for fun but glad you like it

@blue, are you using the public preview? not at my PC but i'll check tomorrow what the error means.
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: 27th Mar 2019 19:27 Edited at: 27th Mar 2019 19:29
for a = 1,2 do

….

elseif GetTimer( a ) > 50 then
....

That's only going to work if you have entity Ids 1 & 2 !!


Edited to add: change it so the portal script passes the entity Id to the other script.

Been there, done that, got all the T-Shirts!
PM
bluemeenie195
6
Years of Service
User Offline
Joined: 28th Oct 2018
Location:
Posted: 27th Mar 2019 20:15
Yes, I am on the March fixer update.
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 27th Mar 2019 20:23 Edited at: 27th Mar 2019 20:24
ah that's probably it, i just need to change it to GetTimer(portal[a]) then
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: 28th Mar 2019 13:53
fixed the script and added amen's rotation code so the portals now lie flat against walls etc
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Login to post a reply

Server time is: 2024-12-22 14:45:53
Your offset time is: 2024-12-22 14:45:53