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.
A question about VXA opacity... [Resolved]

0 Members and 1 Guest are viewing this topic.

********
Furry Philosopher
Rep:
Level 94
Rawr?
2013 Best RPG Maker User (Creativity)Gold - GIAW 11 (Hard)Randomizer - GIAW 11Secret Santa 2013 ParticipantFor frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Mapping)2012 Best RPG Maker User (Programming)Secret Santa 2012 ParticipantGold - GIAW 9Project of the Month winner for September 2008For taking a crack at the RMRK Wiki2011 Best RPG Maker User (Programming)2011 Best Veteran2011 Kindest Member2010 Best RPG Maker User (Story)2010 Best RPG Maker User (Technical)
One of the things I want to try to do with VXA is set up a strange feature that makes a ghost enemy become more opaque the closer event gets to the player, thus making it somewhat invisible from a distance. The math behind it is simple, just good old geometry's distance formula, so it's very easy to determine the distance between the player and the enemy in question. What is NOT easy is figuring out how to manually write in the enemy's new opacity via scripting. It can be done via eventing, but it would take a LOT of conditional branches to make the process look smooth, when a single "$game_map.events[n].opacity = " would work a whole lot simpler and smoother if such a thing existed.

So what I want to ask is simple: What's the bloody coding for an event's opacity? x_x
« Last Edit: March 29, 2012, 01:32:50 AM by Zylos »




*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
I would help you if I wasn't against you in GIAW :mad:
Spoiler for:
:V
Truth is, in Game_CharacterBase @opacity is set to an attr_reader, which means that it can't be overwritten from outside classes. A simple fix for this would be sticking this in the script editor:
Code: [Select]
class Game_CharacterBase
  attr_accessor :opacity
end
Then you could use $game_map.events[n].opacity = x
I think.
it's like a metaphor or something i don't know

********
Furry Philosopher
Rep:
Level 94
Rawr?
2013 Best RPG Maker User (Creativity)Gold - GIAW 11 (Hard)Randomizer - GIAW 11Secret Santa 2013 ParticipantFor frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Mapping)2012 Best RPG Maker User (Programming)Secret Santa 2012 ParticipantGold - GIAW 9Project of the Month winner for September 2008For taking a crack at the RMRK Wiki2011 Best RPG Maker User (Programming)2011 Best Veteran2011 Kindest Member2010 Best RPG Maker User (Story)2010 Best RPG Maker User (Technical)
A nice idea, but the variable already exists in $game_characterbase when I checked. Just can't seem to access it for some reason, even when I tried $game_player.opacity to mess with the player's transparency.




*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 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 Best RPG Maker User (Scripting)2010 Best Use Of Avatar And Signature Space
Yeah, that's what he's saying. The @opacity instance variable exists, but there is no opacity= method which would permit you to change it from outside the class. If you do:

Code: [Select]
class Game_CharacterBase
  attr_writer :opacity
end

then what you will do is create the opacity= method, permitting you to do that which you desire to do.

********
Furry Philosopher
Rep:
Level 94
Rawr?
2013 Best RPG Maker User (Creativity)Gold - GIAW 11 (Hard)Randomizer - GIAW 11Secret Santa 2013 ParticipantFor frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Mapping)2012 Best RPG Maker User (Programming)Secret Santa 2012 ParticipantGold - GIAW 9Project of the Month winner for September 2008For taking a crack at the RMRK Wiki2011 Best RPG Maker User (Programming)2011 Best Veteran2011 Kindest Member2010 Best RPG Maker User (Story)2010 Best RPG Maker User (Technical)
There we go, that works perfectly! Allowed me to put in a formula easily for growing more opaque the closer the event in question is to the player.




*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Did you even read my post? It's pretty much exactly the same thing. .-.
it's like a metaphor or something i don't know