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.
[XP] Force Action target Problems?

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 82
We learn by living...
I've found you can do some pretty cool stuff with Common Events in Battle, but the Targeting systems are kind of screwy, because it doesn't matter who triggers the common event, and you can't target actors or enemies for the effect.

For example, it will always be actor #1 (or whatever you originally pick), and either random enemy or enemy #1 (or whatever you pick).

I would like to set up a common event that when activated in battle by a particular actor, considers them the 'actor', and then options for target, either actors, or enemies, comes up. Is there a snippet or something to resolve this targeting issue?
« Last Edit: February 23, 2014, 04:10:32 PM by modern algebra »

***
Rep:
Level 82
We learn by living...
here's a workaround I developed recently, at least for the actors

Make four versions of this:
Code: [Select]
a =  $data_system.party_members[0]
b = $storc
if a == b
$game_variables[99] = 1
end

so you have

Code: [Select]
a =  $data_system.party_members[3]
b = $storc
if a == b
$game_variables[99] = 4
end

at the bottom of the list. (i.e. members[0-3] = variable 1-4).

Now $storc is just a global variable I put in the script editor. I put it here:

Code: [Select]
        if @item.common_event_id > 0
 $storc = @active_battler.id

but the important part is "$storc = @active_battler.id" wherever active battler is being set.


This still doesn't solve the targeting enemies problem and kind of sucks, but it works for what it does.

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Huh, that snippet looks a bit odd, such as using a global variable when you could be using a regular variable, and I can't seem to get it to work. Do you mind sharing the whole Scene_Item?

As for the target enemies issue, I can't see what's wrong with making "Last Target" your target. Is there something else you want to accomplish?

***
Rep:
Level 82
We learn by living...
Huh, that snippet looks a bit odd, such as using a global variable when you could be using a regular variable, and I can't seem to get it to work. Do you mind sharing the whole Scene_Item?

As for the target enemies issue, I can't see what's wrong with making "Last Target" your target. Is there something else you want to accomplish?

I was originally testing it for my "use weapon or shield" option I'm working on, but I later added it to some other areas, including regular items and skills. You have to use it during combat, and you need a different global variable for each of the three (well not really but it helps keep them sorted easier, because you only need 3 instances).

Here's an example of one used in a skill, you should be able to find these lines from their surrounding context. They occur between lines 1000 and 3500 in section III of my SDK.
in your script editor:

Quote from: script editor
        # If common event ID is valid
        if @skill.common_event_id > 0
          # Common event call reservation
          $storb = @active_battler.id
          $game_temp.common_event_id = @skill.common_event_id
          # Play use skill SE
---------------
      # If command event ID is valid
        if @skill.common_event_id > 0
          # Command event call reservation
          $storb = @active_battler.id
          $game_temp.common_event_id = @skill.common_event_id
          # Switch to map screen
---------------------
    # Set animation ID
    @animation1_id = @skill.animation1_id
    @animation2_id = @skill.animation2_id
    # Set command event ID
    $storb = @active_battler.id
    @common_event_id = @skill.common_event_id
    # Set target battlers
    set_target_battlers(@skill.scope)
    # Apply skill effect
 
Then in a common event activated by a skill (that's important, skill and item common events aren't processed the same) Try something like this (warning, big image):

Spoiler for:


and where it says 'extra attack p1...p4'

put this

Quote from: extra attack p1
Text: \tc \w[15]Extra Attack!
Force Action: Actor No. 1, Attack, Random, Execute Now

Quote from: extra attack p2
Text: \tc \w[15]Extra Attack!
Force Action: Actor No. 2, Attack, Random, Execute Now

Quote from: extra attack p3
Text: \tc \w[15]Extra Attack!
Force Action: Actor No. 3, Attack, Random, Execute Now

Quote from: extra attack p4
Text: \tc \w[15]Extra Attack!
Force Action: Actor No. 4, Attack, Random, Execute Now