RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VXA] Trigonometry values

0 Members and 1 Guest are viewing this topic.

*
A-pow 2015
Rep:
Level 81
2014 Best RPG Maker User - GraphicsFor frequently finding and reporting spam and spam bots2013 Most Unsung MemberSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.How can I help you? :Da^2 + b^2 = c^2Secret Santa 2012 ParticipantSilver - GIAW 10Silver - GIAW 9Bronze - GIAW HalloweenGold - Game In A Week VII
This may be somewhat of a weird request, and I'm not even sure it really counts as a "script", but I've been trying to recreate this rm2k3 event system in vx ace for quite some time. Even after painstakingly recreating every event, I couldn't get it to work. After thinking about it some more, I realized that there's probably already a way to have rgss do the math instead, without having to worry about creating a huge lookup table in a common event.

After a bit of searching, I found this. (pg. 284, under math, module functions.)

I don't have much experience at all with RGSS3, or ruby in general, so I have no idea how I would utilize this. Would I use a script call, or would it need some sort of code snippet? Any guidance would be appreciated.

Basic description of what I want: I'd like to be able to calculate angles from numbers stored in variables, and then pass the angle into a different variable for eventing purposes.
« Last Edit: February 18, 2014, 06:57:21 AM by Acolyte »

*
*crack*
Rep:
Level 64
2012 Most Unsung Member2012 Best NewbieFor frequently finding and reporting spam and spam bots
Spoiler for:
Code: [Select]
class Game_Interpreter
  def calculate_angle
    ax = $game_variables[?]
    ay = $game_variables[?]
    bx = $game_variables[?]
    by = $game_variables[?]

    deltaX = bx - ax
    deltaY = by - ay

    angle = Math.atan2(deltaY, deltaX) * 180.0 / Math::PI
    $game_variables[?] = angle
  end
end

Place that in a new script slot and edit the $game_variables for the ones you want to use; then you can use
Code: [Select]
calculate_angle
in a script call which will place the result into the Game_Variable.



A brief explanation of scripting for you:
Anything inside of the Game_Interpreter class can be used directly through an event's script call.
Notice how the method is called calculate_angle, and you can now use calculate_angle in a script call.

That's pretty much the basics of that. If you want to modify it or add to it, video tutorials 2~4 should cover what you need in my playlist
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

*
A-pow 2015
Rep:
Level 81
2014 Best RPG Maker User - GraphicsFor frequently finding and reporting spam and spam bots2013 Most Unsung MemberSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.How can I help you? :Da^2 + b^2 = c^2Secret Santa 2012 ParticipantSilver - GIAW 10Silver - GIAW 9Bronze - GIAW HalloweenGold - Game In A Week VII
Awesome, thank you so much  :tpg:

*
The Hero of Rhyme
Rep:
Level 83
( ͡° ͜ʖ ͡°)
2014 Queen of RMRKProject of the Year 20142014 Best RPG Maker User - Story2011 Best Newbie2014 Kindest Member2014 Best RPG Maker User - Creativity2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best Yuyubabe Smiley2012 Best RPG Maker User (Creativity);o
All hail D&P3! ;_;
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]