View Full Version: implementing a simple journal

lassie >>Technical support >>implementing a simple journal


<< Prev | Next >>

theauxia- 10-08-2008
implementing a simple journal
greetings from greece in the last days i am digging the LASSIE AS engine and i am trying to figure out what i can do. so i have a couple of questions... before i post my questions i have to say "THANK YOU!!!" for sharing this beauty... i am using Lassie AS win v081b4 with flash8 i am trying to implement a "journal" wich consists of a book icon somewhere on the interface, and when you click at it the screen turns into a navigable journal with hyperlinks targeting other pages of the journal. the ideal case would be to have some mechanism to track wich pages of the journal are active, depending on the story state. my first though is to make a new room with a journal.swf the problems i am facing with this solution is the following: 1)in the TIMe changeRoom how can i set the room argument equal with the previous room? (for the exit journal button) 2)in journal.swf i have set buttons to navigate inside the journal but they don't seem to work in game. hier is the code with the variations i have tried: on(press) { //_root.room.bg_mc.journal_mc.nextFrame(); //this.nextFrame(); //_root.journal_mc.nextFrame(); } the journal.swf includes the movie clip journal_mc wich includes the journal pages 3)the book icon is a sprite but i dont want the character to move towards the sprite's blue point. is there a way to achieve this? is there a smarter way to implement a journal? thanx n happy to join this community

NigeC- 10-09-2008

hi and welcome to the forum :D if you have a button inside the journal.swf you just need to: on (press) { _root.TIMe.changeRoom('prevroom', 'startpoint', 4, null, null); _root.runActions(); } //you need to remove the # symbol from the original TIMes if you use it //in a Flash movie, also add ; if you wanted the journal to go to a perticular page as you re look at it, assuming the pages use a timeline, you could label each page, then in journal "room" in Lassie, you set the journal.swf as a sprite not a background and have it ambient (probably answering Q 2 here) then set the frame labels as phases. you can do some useful juggling between Lassie and a SWF's

theauxia- 10-09-2008

thanks a lot nigeC

NigeC- 10-09-2008

When i finish my game i'll release the source (assuming it isn't to big :shock: ) it has a lot of interactions between Lassie and flash :)

theauxia- 10-09-2008

in this TIMe _root.TIMe.changeRoom('prevroom', 'startpoint', 4, null, null); the'prevroom' argument is something like a memory slot? anyway, it doesnt seem to work if instead of prevroom i type a room id the button works fine do you have any clue why prevroom doesnt function? the startpoint argument, is the startpoint of the previous room or just a startpoint id?

NigeC- 10-10-2008

oops sorry :oops: just replace them with your own room and startpoint id's one thing worth mentioning; use the full name id's rather than "this" if you use TIMes in a Flash movie,... sometimes "this" gets skipped or it can cause the room to hang if you have a few sprites

theauxia- 10-10-2008

is it possible to have a variable as a memory slot. when i saw the prevroom argument i was very happy because this is exactly what i want to do. do you know any way to do this?

NigeC- 10-10-2008

You could have variables set within menu.swf as that swf is a layer within the player, as is inventory, I've never done it but in theory it should work Greg wrote a section in the manual about custom TIMes and theres also the workflow of the system that might be useful :) Its a shame he up to his arm pits in the american elections, he probably be able to shed some more light.. every thing i've done is trial and error.. mostly error lol

theauxia- 10-12-2008

hello again as i red the TIMe documentation i found that the best way to remember the previous room is to use the setVariable() and the _ifVariableSkip() TIMes. But for some reason i cant explain, they dont work. So i had to make a custom solution, and here it is: #include "_data.as" var memorySlot=0; _root.TIMe.journalExit = function() { if(memorySlot==1) { _root.TIMe.changeRoom('room1','journal_start',4,null,null); } else if(memorySlot==2) { _root.TIMe.changeRoom('room2','journal_start',4,null,null); } else if(memorySlot==3) { _root.TIMe.changeRoom('room3','journal_start',4,null,null); } } _root.TIMe.roomMem = function(x) { memorySlot = x; } now in every enterRoomTIMes add roomMem(1) changing the number at each room and at the exit sprite on the journal room add roomExit()

theauxia- 10-12-2008

oops in the last code i wrote, i wanted to say journalExit() now i am trying to find a way, every time the character clicks on the journal sprite, he does not have to move towards the sprites blue point any ideas?

NigeC- 10-12-2008

the easier way would be create a flash button of whatever the sprite is and set it ambient you can make lassie bring up a custom cursor; create a cursor in inventory to match lassie's "rollover" this way it'll respond to the otherwise invisible sprite so on the button have: on (rollOver) { _root.TIMe.setItemCursor('right'); } on (press) {gotoAndPlay(10); } on (rollOut) {_root.TIMe.setItemCursor('_none'); } thats a code i did to have a room with different backgrounds, on rollover it changed the cursor to a pointy finger, changed the frame to 10 on press then cleared the item curor on rollout Great code hint, thanks :D setVariable() and the _ifVariableSkip has problems, i'm no flash expert but I always seem to find a fix for most things juggling between Lassie and Flash :)

theauxia- 10-13-2008

thanks nigeC i saw your work on the myst like lassie and i have to say that it is impressive, but i think you know that.

Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.