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.
[VX][SOLVED]Proper Script Call for Enemy Appear and Enemy Transform

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 56
RMRK Junior
I tried using the search function. As far as I know, no threads list script calls. Please correct me if I am wrong. Nothing in the "Read First" threads looked like what I was looking for. I also attempted to find it through $game_interpreter, but nothing I tried has worked. I need to be able to do it through script call as I can have more than 8 enemies/summoned allies on the screen at once and I need a way to access them (as you know the event for transform and appear only allow parameters up to 8.).

I tried several things, and I feel like I'm close, but it's a no-go so far. Any help would be appreciated, thank you.
« Last Edit: June 26, 2013, 10:58:47 PM by dudeguy119 »

I support:



*
Rep:
Level 82
As a quick hint kind of thing:

With regards to Game_Interpreter:

Code: [Select]
      when 335  # Enemy Appear
        return command_335
      when 336  # Enemy Transform
        return command_336

If you look at those two commands, you can see what happens when the command is called when you trigger it with events.

Code: [Select]
  #--------------------------------------------------------------------------
  # * Enemy Appear
  #--------------------------------------------------------------------------
  def command_335
    enemy = $game_troop.members[@params[0]]
    if enemy != nil and enemy.hidden
      enemy.hidden = false
      $game_troop.make_unique_names
    end
    return true
  end
  #--------------------------------------------------------------------------
  # * Enemy Transform
  #--------------------------------------------------------------------------
  def command_336
    enemy = $game_troop.members[@params[0]]
    if enemy != nil
      enemy.transform(@params[1])
      $game_troop.make_unique_names
    end
    return true
  end

There's a few ways you can approach this to solve the problem. The limitation of the event command is that you are restricted to a drop down list that only goes up to 8, but you need a larger number. One way, then, would be to make a method that accesses the appropriate $game_troops.members value (assuming that whatever is letting you have more than 8 enemies still makes use of this property).

I'll let you continue to find a solution of your own. If you still can't find one, I'll help you out some more.
(Why do I always feel like it's the end of the world and I'm the last man standing?)

**
Rep:
Level 56
RMRK Junior
Okay. Thank you. I can work with this. And, yes, the game does assign troop values to the additional enemies starting with 8 and goes in order, so I can predict which values the additional troops are. I'm going to try some things tomorrow and I'll reply with my results soon. Again, thank you for your quick response and for helping me in a way that helps me learn/doesn't treat me like I can't learn. Much appreciation.

I support:



**
Rep:
Level 56
RMRK Junior
This can be closed. Thanks again, LoganF!

I support: