RPG Connecting Rooms
so i've been using Jamie Cross's RPG Connecting Rooms tutorial on youtube/ his website which has been a great help. i am however stuck implementing a new table. i've made a second 'exit trigger 2' actor and a second 'pick my location 2' attribute group in the hero actor, both which point to the new table, however its like the coordinates i've set seem to not work and the actor could end up on a different scene and different set of coordinates, either or both can happen. the first groups of rooms ( 4 of them) on the first table work fine, its just this second table that seems to not work properly or as intended.
i've tried moving the coordinates that i have for the 5th group of rooms (from the second table) into new columns on the first table and adjusting the 'exit trigger 2' and 'pick my location 2' accordingly to point at them but that also seems to not work and causes the same issue.
so i'm kind of lost as to what to do and how to fix it, i think it might be a logic problem with having 2 'pick my location' groups in the hero actor, but i'm not sure how to implement it so they say for example: if using 'pick my location 1' use table 1, if using 'pick my location 2' use table 2, or some other way of doing that disabling one while using another etc. this is a problem i may well run into a few times while implementing even more tables also.
i hope i've explained this properly and any help would be great. thanks.
Comments
Hi @tuftyfella, it's been awhile since I posted that tutorial. I had to check it out to familiarize myself with it again, lol. Is there a reason why you are adding a second table? You can use the current table to add as many rooms to your dungeon as you need. It sounds like there must be some errors in the behaviors you've created.
The table is pretty straight forward, the first and second columns hold the X and Y locations of where the player will be placed and the third column is the scene/room you want to display. I'm guessing the errors are in your behaviors for reading the data from your new table.
I suggest instead of making additional tables you just add your data to the current table and the behaviors in the demo file should work fine.
Edit: keep in mind, each 'trigger' actor in the scenes have a custom actor attribute that is used to read data from the correct row of the table. The attribute is named Row and you need to double click each trigger actor and update this attribute so it reads from the correct row of the table.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
well, i got it working now. not sure what i did wrong the first time i tried making a second set of columns on a single table but its working as intended now, think i may have mixed up some numbers. Still have to create new exit trigger and pick my location group to deal with the new column numbers but that's not a problem.
thanks for the help Jamie, apologies for any time wasting, i'm kind of jumping in the deep end trying to create something a bit more complicated than i probably should, but hey, whats life without challenge.
No worries, no time wasted. I'm glad its working for you now! Enjoy the challenge and keep us posted on your progress.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
ok, so this problems raising its ugly head again, ive included pictures this time as im stumped as to whats causing it, as far as i can tell, everything points to the correct place, however, changing scenes results in moving to the wrong coordinates ive set in the table, coordinates that ive double checked and definitely are right. not sure at all what the problem is, any ideas anyone?.. im stumped. >.<
Is self.row being defined by a rule, single change attribute, or a value preset on the actor? Have you tried using display text on an actor that's on every scene to show the value of game.row after changing to ensure it's correct?
Although at a glance it looks right, could the indexes be set incorrectly?
Follow us: Twitter - Website
Oh, and if you have 3 change attribute groups for x/y with no rules defining when to trigger, they would all trigger on a scene change. So depending on what's last to trigger, that would be where it ends up.
It might be a good idea to define a col value in an attribute as well, and set that on the local scene change actor so you can use one single change x and y group.
Follow us: Twitter - Website
self.row is an integer value on each exit trigger actor, each one placed in the scene is given the row number on the table it corresponds to.
done the display text showing the game.row value and thats correct.
the indexes should definitely be set correctly.
Based on that I definitely think it's the issue in my second post or something similar. It has to be on the actual change x/y logic and not the table systems because the row/index is defined correctly. It just doesn't understand what column to use because it has 3 possible columns available, and it looks like they all can trigger unrestricted.
Follow us: Twitter - Website
yeh, i thought it might be the 3 change attribute groups that may be causing the problem as disabling any 2 and the 3rd works just fine.
so how does one define a column value in an attribute? presumably in the exit trigger actors i create a new integer 'column' just like row and i change the 3, 7, 11, to self.column?
create a game integer 'column' also, but then how do i feed that into the pick my location groups?
Exact same way as the row. make a Game.col and a Self.col and set the value based on where the change scene trigger is going to.
So for act 1-4 change the self.col to 1 and then change game.col to self.col just like with row.
And on the change behaviour group, instead of manually putting in the 1 and the 2 or any of the values, since we know it's always going to be game.col for x and then one col over for y you do:
Change self.x to tableCellValue(Act Room Data, Game.Row, Game.col)
Change self.y to tableCellValue(Act Room Data, Game.Row, Game.col+1)
Follow us: Twitter - Website
so heres what i did..
--- Made 'game.column' integer.
--- Made 'self.column' integer in exit trigger then changed the value in each one in each scene to that of the corresponding scene column in the table, so 1-4 = 3, 5-8 = 7, 9-12 = 11 as in the table above.
--- Added the 'change attribute' game.column to self.column in each exit trigger also.
--- Changed the 'change scene' in the exit trigger to tableCellValue( act room data, self.row , self.column ).
--- In the hero's pick my location groups i changed them to -> tableCellValue( act room data, game.row , game.column-2) for x, tableCellValue( act room data, game.row , game.column-1) for y, then realised theyre all the same so deleted 2 of them leaving just the one.
some minor changes to what you posted above AlchimiaStudios which certainly put me in the right direction and it now seems to be working perfectly, thanks a tonne for the help .
Glad to hear you got it sorted!
Follow us: Twitter - Website