Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

Couple Questions About Random Ideas I Had

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Post Reply
ClockworkDice
Fighter
Fighter
Posts: 27
Joined: Wed Nov 02, 2016 12:59 am
Started SFD: Sometime in Pre-Alpha
Gender:

Couple Questions About Random Ideas I Had

Post by ClockworkDice » Wed Jul 04, 2018 7:11 pm

Hey, so, I'm making this topic as kind of a dump for a bunch of small questions I've had about scripting and what could be possible. If having several questions in one post is discouraged I'll happily move each question into it's own thread, but most of these would probably have very short answers so I hope it's fine.
So, first up: Is it possible to determine what object a bullet collided with? Let's say I want to make a script where bullets delete anything they touch (just as an example). Would I be able to have the bullet return the object that it collided with before destruction in order to allow me to destroy that object? This would be useful for a lot of things, such as "raycasting" using bullets for Line Of Sight or making projectiles affect different objects in different ways (like bullets launching physics objects way into the air or something).

Second: Can I use the laser sight laser in a script? As in, can I create a laser sight object independently of any player and use it for visuals or other things? Depending on what is possible, it would be a great tool for raycasting in scripts, Line Of Sight, determining how high a player is above the ground (for like, hoverboards or something), etc. If anyone knows what information I can get from the laser sight in the scripting api I would be very appreciative.

Third: Is it possible to detect keyboard input directly in a script? I don't think it is, but it would be really nice to be able to create dedicated controls for scripts, instead of having to make players walk+block and stuff for special effects. The current amount of player controlled booleans makes it difficult to set up multiple dedicated things players can do, and requires awkward workarounds.

Fourth: Is there some boolean like IsColliding for detecting if a physics object is colliding with a solid object? This would be useful for preventing glitches like teleporting into walls or spawning objects inside of each other.

Fifth: Is it possible to create custom weapons? Or at least edit stats of existing weapons. I think that custom weapon scripts could have a lot of potential but I haven't seen any way to do this yet.

EDIT: New Question (#6): Is it possible to change where in the game update loop the script is executed? This sounds like a long shot, but it might be able to help with bugs in scripts, specifically when dealing with physics. I seriously doubt that this is possible, but if it is that could be very interesting

Thanks for any responses, and sorry if this was a bit of a wall of text
1 x

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1071
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 28

Post by Gurt » Fri Jul 06, 2018 9:18 pm

The short answer for all your questions is: No, it's not possible. It's outside the scope of the ScriptAPI right now.
0 x
Gurt

ClockworkDice
Fighter
Fighter
Posts: 27
Joined: Wed Nov 02, 2016 12:59 am
Started SFD: Sometime in Pre-Alpha
Gender:

Post by ClockworkDice » Sat Jul 07, 2018 3:59 am

Aw, oh well. Thanks for letting me know. Saved me a lot of time digging through API documentation.
Perhaps in the future some of these ideas might be possible?
0 x

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest