This forum is locked and will eventually go offline. If you have feedback to share you can find us in our Discord channel "MythoLogic Interactive" https://discord.gg/nECKnbT7gk

Forum rules

Math Functions

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

Math Functions

Post by ClockworkDice » Sun Jul 23, 2017 9:02 pm

I want to use trigonometry functions in my scripts, is there any way to do that? Thanks.
0 x

User avatar
Evilsack
Superfighter
Superfighter
Posts: 284
Joined: Sat Mar 26, 2016 6:07 pm
Title: you make me sick.
SFD Account: Evilsack
Started SFD: Pre-Alpha 1.2.1
Location: Space.
Gender:
Age: 26

Post by Evilsack » Sun Jul 23, 2017 11:19 pm

I smell some sort of aimbot being conjured up.
0 x
-Evilsack
Image

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

Post by ClockworkDice » Mon Jul 24, 2017 1:01 am

I didn't even think of that, but that could totally work. I'm actually trying to script a helicopter and need to use the angle of the helicopter to determine what force to apply to it. For example, if the helicopter is tilted slightly to the right it would fly to the right with slightly less force going upwards.

I've currently got hoverboard type vehicles working but I want to have it act like a real helicopter.
0 x

User avatar
TheOriginalCj
Moderator
Moderator
Posts: 177
Joined: Tue Mar 15, 2016 10:28 pm
Title: Lifetime Sentence to SF Wiki
SFD Alias: RedneckJed
Started SFD: PreAlpha 1.1.0
Location: USA
Gender:
Contact:

Post by TheOriginalCj » Mon Jul 24, 2017 8:23 am

This is mostly just creative thinking in C#. If the object is going to stay at a constant Y, this is much easier to script for. If not, then this isn't something I can solve so easily. Or perhaps I'm misinterpreting something here.

Do you already have an idea of what you want to do, but you're not sure if SFD has functions you need? Or do you need some insight as to how to solve this? Either way, we're here to help.
0 x
Superfighters Wiki Founder
The Superfighters Wiki
Join the Wiki!
Danger Ross wrote: What are you doing here wiki-slave?! GET BACK TO WORK!

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

Post by ClockworkDice » Mon Jul 24, 2017 6:25 pm

I already know how I would implement the code, I just need to know if SFD has sine cosine and tan functions that I can use. If they don't I won't be able to accurately calculate the x and y Velocities using the angle.
 ! Message from: TheOriginalCj (Merged Double Post)
Oh hey, I figured it out. Math.Cos(), Math.Sin(), and Math.Tan() are the functions.
Didn't know that as I'm new to C#.

EDIT: It worked, should I close this thread or leave it open in case anyone else has the same question?
0 x

User avatar
TheOriginalCj
Moderator
Moderator
Posts: 177
Joined: Tue Mar 15, 2016 10:28 pm
Title: Lifetime Sentence to SF Wiki
SFD Alias: RedneckJed
Started SFD: PreAlpha 1.1.0
Location: USA
Gender:
Contact:

Post by TheOriginalCj » Tue Jul 25, 2017 7:13 am

Nope. Usually when something is resolved we lock it. So... Locked...
0 x
Superfighters Wiki Founder
The Superfighters Wiki
Join the Wiki!
Danger Ross wrote: What are you doing here wiki-slave?! GET BACK TO WORK!

Locked