Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 11 posts ] 
    bum_199
  Sun May 03, 2015 7:21 pm
Member

i don't know if this is the right section to post this if its not i apologize. I also feel like an idiot posting basically the last 3 topics here and am sorry. I'm using tomoakys tactical battle system and it has me tell it what actors to use for battles via events. I specify actors with a script call like this :$game_system.srpg_member = [0, 1, 2, 3]. I'm wondering if there's a way to have it check what actors are in my party and place them. Any help would be appreciated.


Top Top
Profile      
 

    Amy
  Sun May 03, 2015 7:27 pm
User avatar
Staff

Big Dumb Guy
I'm a little rusty with RPG Maker, but it would be something like this:

if $game_party.actors.include?($game_actors[1])

$game_party.actors should be an array, so include? can be used to see if the array contains a certain thing. I'm assuming these things are $game_actors. I may be wrong.

You'd use this in a conditional branch, using the "script" condition. So it would be something like:

conditional branch
script


$game_party.actors.include?($game_actors[1]) == 1


Where it will equal 1 if true, 0 if false. (You don't need the "== 1" but I've put it there for readability.)

Hopefully somebody else can elaborate if that's right or not, as I don't have RM in front of me.


Top Top
Profile      
 

    bum_199
  Sun May 03, 2015 7:39 pm
Member

sorry if i dont follow the only reason i even knew that line of script was cause the tbs demo used it. I'm guessing what you said checks for one actor. what im hoping to get it it to do is just place whatever actors are in my party. this way though it seems to require the actors specified and that number of actors. sorry for not being clearer


Top Top
Profile      
 

    Amy
  Sun May 03, 2015 8:29 pm
User avatar
Staff

Big Dumb Guy
Ah, I get you.

I think that would have to be done in a script, as you'd have to work out how many members are in the party, too.

Something like this. Create a new script in the script editor.

Expand to see the code.


Then call battle_members instead of $game_system.srpg_member = [0, 1, 2, 3].

There's a chance I've got the actor_id bit wrong (the longest line), it might just be .id not .actor_id.

I think that should work.


Top Top
Profile      
 

    bum_199
  Sun May 03, 2015 10:14 pm
Member

Will do when i get home. I'll let you know if there's any problems. Thanks so much. Gonna see if i can see avengers 2 in the mean time.
EDIT:
i pasted the script and in the event called battle_members as you said. it gave this error.

Namerror occurred while running script.
undefined local variable or method 'battle_members' for #<Gamezz_Interpreter:0x298b550>


Top Top
Profile      
 

    Amy
  Tue May 05, 2015 8:42 pm
User avatar
Staff

Big Dumb Guy
Ah, sorry. If it's VX Ace it will be:

Expand to see the code.


They renamed Interpreter to Game_Interpreter.

I have RM in front of me so I'll check the rest now.


Top Top
Profile      
 

    bum_199
  Tue May 05, 2015 9:30 pm
Member

I'm not using vx ace just vx. i did try that though and got this error at line 11 of what you posted.

script ' ' line 11:no method error occurred.
undefined 'method actors' for #<game_party:0x29aace0>


Top Top
Profile      
 

    Amy
  Tue May 05, 2015 9:47 pm
User avatar
Staff

Big Dumb Guy
Right, think I'm there now.

Expand to see the code.


Have tested properly this time. Assuming the line you're using is correct, this will work.


Top Top
Profile      
 

    bum_199
  Tue May 05, 2015 10:32 pm
Member

no errors from what you coded anymore but getting this error unfortunately in the tbs script. his translated demo can be found below after clicking on srpg2. very sorry about this.

script 'game_srpgevent' line 97 no method error occurred
undefined method 'set_tile_effect' for nil:nilclass

https://momorpg2012.wordpress.com/download/

edit: sorry had the wrong link up for a bit the one above is correct


Top Top
Profile      
 

    Heretic86
  Sat May 09, 2015 1:26 am
Member

Party Mascot
Use THREE dots instead of TWO:

for i in 0..$game_party.actors.size - 1 (two dots in the i in 0..range)

That will increment i to 5 even if the actors.size is 4, which is why -1 is needed. The ruby guys already saw this and use an additional period in the range specification.

for i in 0...$game_party.actors.size (three dots in the i in 0...range)
end

Also a brief note, $game_actors works a bit different. $game_actors[0] is always nil, so your first Actor starts at $game_actors[1]. At least in XP, not sure about VX series. That can cause some crashes where it says "no method error for nil class". Its also most likely what caused your error above. Amy gets slack due to her rust, but was very very close.

_________________
My Collection of Art and 100% Compatible Scripts


Top Top
Profile      
 

    Amy
  Sat May 09, 2015 3:39 pm
User avatar
Staff

Big Dumb Guy
Thank you. I'm thoroughly embarrassed now :robot:

Let's try again.

Expand to see the code.


1..$game_party.actors.size because it's incrementing from 1 to 4 now instead of 0 to 3.


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 


Who is online

Users browsing this forum: No users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group