Status
Not open for further replies.

iNBee317

Villager
Member
Joined
Jun 10, 2014
Messages
15
Reaction score
0
First Language
English
Primarily Uses
I am trying to create a system in game similar to pathfinders skill checks (perception, acrobatics, climb). I am using PK'8s data suite to store the ranks players add to these skills and have the system add their corresponding parameter(atk,def,etc.), skill rank, and the result of a d20 dice roll.

As of right now I have been doing this the long way with a common event containing conditional branches that determine if the actor is in the party or not, then calculates their score and compares it to the DC of the event which flips a switch that tell the event (say a trap) whether the actor succeeded or failed.. This is a lot of redundant work. So I am trying to figure out the way to create a 'For' loop where it replaces a placeholder in my script with a number N where N is the actor value. each time the loop run N changes to the actor value for the actor next in my party. That way I don't have to copy, paste, and edit fields for each specific actor and end up with countless conditional branches. 

I could post my current event and common event though I don't think it will help much since I am going for a complete overhaul.
 

RyokuHasu

Developer
Veteran
Joined
Jun 23, 2012
Messages
274
Reaction score
38
First Language
English
Primarily Uses
here is a simple for loop for Ruby

Code:
for i in 1..5   puts "Value of local variable is #{i}"end
 
Last edited by a moderator:

iNBee317

Villager
Member
Joined
Jun 10, 2014
Messages
15
Reaction score
0
First Language
English
Primarily Uses
z=$game_variablesfor i in 0..z[37] x=$game_party.members[#{i}].id z[9]=$game_actors[x].mdf z[9]+= actor_self_variable(x,"acr") z[9]+=z[14]end

Anyone know what I am doing wrong here? It says unexpected tIDENTIFIER, expecting ']'
 
Last edited by a moderator:

iNBee317

Villager
Member
Joined
Jun 10, 2014
Messages
15
Reaction score
0
First Language
English
Primarily Uses
I did not resolve the 'for' loop issue though found another way to go about it. 
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,330
Reaction score
15,156
First Language
English
Primarily Uses
RMMV
iNBee317, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


Does it tell you which line is causing the issue?


Try putting some spaces in there - in most cases it'll make it more readable - but sometimes it solves errors.


Also, you don't need [#{i}] - just do
 

Mithran

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
404
Reaction score
217
First Language
English
Primarily Uses
Incidentally, the reason the above didn't work (assuming the position it was used in was correct) was that the unnecessary # commented out the rest of the line, including the right closing bracket, which is exactly what the error was saying.
 

iNBee317

Villager
Member
Joined
Jun 10, 2014
Messages
15
Reaction score
0
First Language
English
Primarily Uses
Thanks everyone this was very helpful!
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,330
Reaction score
15,156
First Language
English
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

Happy Friday, y'all! I just got home from work and am sitting down with a nice cider, and I'm ready to chill and enjoy myself. Not sure if I'm gonna dive into any of my game-related projects or not tonight.... we'll see how I feel after unwinding for a bit I guess!
Just found out that mint tea made from chocolate mint tastes a bit like hot cocoa with candy cane stirred in. As I'm allergic to chocolate this makes me very happy.
It's special day for me tomorrow so time to vanish for 24 hours lol.
So Deltarune Chapter 2 is supposed to release today... if it's out already, has anyone played it? And I can't because I have a stinking Mac and not a Windows PC.

Forum statistics

Threads
115,141
Messages
1,087,574
Members
149,660
Latest member
Scooder
Top