[ACE] Script Help?

BunnyNubNub

Veteran
Veteran
Joined
Sep 27, 2016
Messages
99
Reaction score
23
First Language
English
Primarily Uses
N/A
heyo!

Someone awhile back posted a pretty nice f2u script for making screen tints affect the player/events/followers, however, it seems like it's broken or I'm simply doing something wrong! I'm unfamiliar with scripting fully myself, so I'm hoping someone on here will be able to let me know if this is beyond help or is a simple fix;



this seems to be the main error message I'm getting out of this(ablight messy) script:

Code:
class Game_CharacterBase alias shaz_vp_init_private_members init_private_members def init_private_members shaz_vp_init_private_members @viewport = 1 end def set_viewport(value=1) @viewport = value if value.between?(1,3) end def viewport @viewport ? @viewport : 1 endendclass Spriteset_Map alias shaz_vp_update_characters update_characters def update_characters shaz_vp_update_characters @character_sprites.each {|sprite| sprite.viewport = [@viewport1, @viewport2, @viewport3][sprite.character.viewport - 1] } endend
It's suppose to act upon a script call event, an event id dictating where the screentint is(?) I believe, and what viewport(i.e player etc) to apply it to(?)

edit: here's also the script call meant to enable the script itself:
Code:
$game_map.event[2].set_viewport(1)
thanks for any help on this!
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,528
Reaction score
14,261
First Language
English
Primarily Uses
RMVXA

I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
90
Reaction score
32
First Language
Bulgarian
Primarily Uses
RMVXA
The script formatting is messed, guess that happened when they changed the site's forum system.
Seen other scripts messed like that too. I edited it so it works.
Code:
class Game_CharacterBase
  alias shaz_vp_init_private_members init_private_members
 
  def init_private_members
    shaz_vp_init_private_members
    @viewport = 1
  end
 
  def set_viewport(value=1)
    @viewport = value if value.between?(1,3)
  end
 
  def viewport
    @viewport ? @viewport : 1
  end
end

class Spriteset_Map
  alias shaz_vp_update_characters update_characters
 
  def update_characters
    shaz_vp_update_characters
    @character_sprites.each {|sprite| sprite.viewport = [@viewport1, @viewport2, @viewport3][sprite.character.viewport - 1] }
  end
 
end
What I saw it does is that a event character remains unafected by the screen's tint. But you must set that character to viewport 2 or viewport 3. Use one of those script calls:
$game_map.events[2].set_viewport(2)
$game_map.events[2].set_viewport(3)
Any other value would be as if you set it to 1 - the sptires visibility gonna be affected by the screen's tint.

Edit: fixed the script calls. Didn't looked carefully too when wrote here, sorry about it.
 
Last edited:

BunnyNubNub

Veteran
Veteran
Joined
Sep 27, 2016
Messages
99
Reaction score
23
First Language
English
Primarily Uses
N/A
all of that looks fantastic, thank you! I threw the script in and ran the game with that baby in no problem, however, as soon as I put an event down for the script call, this occurred:



I just copied the very first call into it, put it as parallel on the map in question so it'll run, but I'm 99% sure this isn't the script being funky but possibly my own mistake. :kaosigh:
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Please show your script call. Game_Interpreter line 1411 is the script call, and it's saying you've done something incorrect in the call.

You didn't do $game_map.event(...) instead of $game_map.event[...] did you?
 

BunnyNubNub

Veteran
Veteran
Joined
Sep 27, 2016
Messages
99
Reaction score
23
First Language
English
Primarily Uses
N/A

This is an exact copy&paste from above. I also tried changing the trigger and that didn't change anything, unfortunately.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
I don't think it's coming from that event. The error message is saying it's looking for a method called event for the game map, which means somewhere, you have a script call that does $game_map.event(). Do you have any others with script calls on that same map (or it could be a common event)?

Also, you want to do an Erase Event after that command - parallel processes repeat, and you don't need it changing the event to use viewport 2 on every frame.
 

BunnyNubNub

Veteran
Veteran
Joined
Sep 27, 2016
Messages
99
Reaction score
23
First Language
English
Primarily Uses
N/A
hm, odd. The only other script call I actively use is for character dynamic shadows, but it doesn't use the $game_map.event() call:


Could this still be the one causing the issue? I can probably live without the shadow script on this map in particular, though in others it may become more iffy if there's conflicts. These would be the only two scripts I use that utilize calls, so it's rather odd.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
You don't use "event", but instead go use "events" with s :p
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
You don't use "event", but instead go use "events" with s
oops - yep, that's right. $game_map.events[2].

wonder why it thought it was a method when it has [] instead of ()
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
wonder why it thought it was a method when it has [] instead of ()
attr_reader :events is indeed a method. Basically, anything after the dot is considered as a method.
The content is
Code:
def events
  return @events
end
So it's a method that returns a hash, so you could technically write this
Code:
$game_map.events()[id]
But the () part is unnecessary that you could omit it.
 

BunnyNubNub

Veteran
Veteran
Joined
Sep 27, 2016
Messages
99
Reaction score
23
First Language
English
Primarily Uses
N/A
As soon as you first replied with events, I tested out, and it seems to be working perfectly! thank you guys sm! :kaoblush:
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,467
Members
137,821
Latest member
Capterson
Top