Mattsuharu

Veteran
Veteran
Joined
Apr 15, 2022
Messages
104
Reaction score
39
First Language
English
Primarily Uses
RMVXA
So, at this point, most must know that I use the card game script... So I was trying to do some very elaborated card effects in combination with yanfly lunatic damage script.

In the card game script there's a line with a def to invoke a card impact:
Ruby:
#-----------------------------------------------------------------------------
  # Card effects
  #-----------------------------------------------------------------------------
  def invoke_card_impact(effect_name)
    array = PC27::CG::CARD_EFFECT[effect_name]
    if array[0] == :draw
      card_effect_draw_cards(array[1], array[2], array[3])
    else
      $game_message.background = 1
      $game_message.position   = 1
      $game_message.add(PC27::CG::CARD_EFF_TEXT)
      wait_for_message
      prepare_select_window(:impact, array[0])
      @temp_effect_data = [] unless @temp_effect_data
      @temp_effect_data[0] = :impact
      process_select_cards(effect_name)
    end
  end

I tried to use this def in the lunatic damage to call a specific impact effect, but it returns me an error among the $Game_actor.
This is the damage call I created:

Ruby:
when /DRAW1/i
        self.invoke_card_impact("lightload")

Also tried with another def called: "process_select_cards(effect_name)", and also tried changing the "self" for "a."
but non of them seems to work. Both return an error related to the $Game_actor.
Is even possible to use these def in a lunatic damage formula?

Maybe this method is not possible to be used with a damage formula and I could create a different def to force a card impact in a damage formula?
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,365
Reaction score
1,202
First Language
English
Primarily Uses
RMVXA
Also tried with another def called: "process_select_cards(effect_name)", and also tried changing the "self" for "a."
but non of them seems to work. Both return an error related to the $Game_actor.
Please specify what the error is. Screenshot?
'a' is used in damage formulas, not code; unless you defined a variable as 'a'.

You lunatic code may be looking for the method in $game_actors
 

Mattsuharu

Veteran
Veteran
Joined
Apr 15, 2022
Messages
104
Reaction score
39
First Language
English
Primarily Uses
RMVXA
Please specify what the error is. Screenshot?
'a' is used in damage formulas, not code; unless you defined a variable as 'a'.

You lunatic code may be looking for the method in $game_actors
Lunatic Damage actually let's you code as a damage formula, so you can use a. and b. to refer to which one you want to affect in it when you create a custom damage. For some reason, instead of a., "self." also works.

This is the error:
1660041366959.png

I checked that the invoke_card_impact was related to the class scene_battle. So I took all the code of the invoke card and pasted it again in the game_actor class. For some reason, it looked like it could had work, the thing is that in that case, the error returned it was that it couldn't read the "set_handle" for the "prepare_select_window".

So I checked and the original "def set_handle" is in the main script, and is not related to the game_actor class, but with the window_selectable, which is logical.
 

Latest Threads

Latest Profile Posts

So, yeah. It's there.

Clarn Hold
(No storylines)
There was a tutorial on how to draw anime eyes. Just draw Among Us. So I tried.
Screenshot_107.jpg
DamageActor3_7.png added!
index.php

Making a "characters first appearance" drawing for my game. Now I just have to finish the sprite art animation for her grand entrance.​

Forum statistics

Threads
125,540
Messages
1,171,821
Members
164,614
Latest member
guymelul
Top