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.
Adding a Numerical function?

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 87
After working ALOT with numbers in scripts (naturally...) I'm getting tired of having to create my silly boolean for determining numbers as "Odd" or "Even" everytime I make a Window Selectable that I want to use an alternating placement structure.

E.G.
NORMAL:
1
2
3
4

ALTERNATING:
1 2
3 4

Anyhow, I find myself repeatedly using this method for menus and having to make a boolean for it. I already realize I can just add the boolean structure to Window_Selectable itself as a new argument for the class being "Alternating" or "Normal" sorting method. (I have done so before.)
However, I also find myself needing this in other situations besides sorting methods...And so, I am wondering:

How do I go about adding a "Odd" or "Even" determinating function to the Numerical class? Or in that case, adding a function to any pre-existent class in RMXP?
« Last Edit: December 30, 2008, 01:40:27 PM by da good king »

********
Hungry
Rep:
Level 96
Mawbeast
2013 Best ArtistParticipant - GIAW 11Secret Santa 2013 ParticipantFor the great victory in the Breakfast War.2012 Best Game Creator (Non-RM Programs)~Bronze - GIAW 9Project of the Month winner for December 2009Project of the Month winner for August 20082011 Best Game Creator (Non RM)Gold - GIAW Halloween
incoming peseudocode

Code: [Select]
if (value % 2) == 0
   blah blah blah even
else
   blah blah blah odd
end

FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

***
Rep:
Level 87
Hahaha well, I suppose I am still new to the shortcuts and ways of scripting. All the methods and such aren't quite in my brain yet. Well, thanks :).

Also, I had a veyr pressing question...If I need to make another topic for it don't hesitate to direct me to do so >.<. Anyhow, I want a Game Clock for my game that is real-time. i.e. If you're playing at 12:30 A.M. It's dark out, and so on. Of course, the game can't process when it isnt running, so this is impossible unless I sumhow access an outside program, like Window's own clock and calendar.

So, how do I access computer data such as Window's clock and use it as a variable or set of variables?

********
Hungry
Rep:
Level 96
Mawbeast
2013 Best ArtistParticipant - GIAW 11Secret Santa 2013 ParticipantFor the great victory in the Breakfast War.2012 Best Game Creator (Non-RM Programs)~Bronze - GIAW 9Project of the Month winner for December 2009Project of the Month winner for August 20082011 Best Game Creator (Non RM)Gold - GIAW Halloween
I think you'll find an answer on google, I'm not sure.
I'm 99.5% sure someone did that already.

FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Time.now


Remember, the RMXP Help File is your best friend. A serch for Time will bring you to everything you need to know about the Time class
« Last Edit: December 31, 2008, 04:01:00 AM by Modern Algebra »

***
Rep:
Level 87
I think Homer would say, "Doh!" Thanks algebra. ;)