Hentai: Peach's Untold Tale 3.48 (Nov 2/18) - HIATUS

The place to post Flash-based creative projects.
Forum rules
This forum is for posting and collaborating upon third party Flash work. Please do not post request-threads, and avoid posting artwork that is not your own unless it is being used as a reference.

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby Ivan-Aedler » Sun Oct 11, 2015 10:55 pm

OwnerOfSuccuby Wrote:No i am talking that i program on flash so strange - that nobody can understand me :D :lol:

Oh! Ok! :o :mrgreen: Lets try :D

OwnerOfSuccuby Wrote:Start to watch your code. What is interesting for me - you use MovieClip(root) i use (root as MovieClip).*(some object on root or function)

They do the same ;) As well as MovieClip(this.root).

OwnerOfSuccuby Wrote:As i understand you load all your functions on first frame and then call it.

Yes. It's the AS2 way. I was FAR WORSE in the beginning (<=2011) , with hundreds of on-object code (that is, in the right click of many movieclips). Then I removed all of them.
I cleaned up the code so far in a way I practically remade the game (in AS2)!
Then I am remaking it once again! (in AS3). I have progressed, but there are times my brains get stuck in a incredible way never felt before! :o :lol:

OwnerOfSuccuby Wrote:If i understand right you check each time on enter frame some variables when character already exist ? Like it was on LoK version 2 game ?

Yeah!!! ;) And it works perfectly in AS2. I prefer to do this way because its just a 'if' that checks if a player variable changed its name. If Peach changed clothes, her hair will understand and change. Her arms will undersnd and change.
I prefer that way because, if not, I would have to name all bodypars in ALL 280scenes + 50 poses! Like peach_arm, peach_leg_left, peach_leg_right, in all instances! So the code can update those, without having to make ENTER FRAMES. I really want to avoid that at all costs!!! For me, its important that a given movieclip check if something has changed, in order for it to change! But even if I name all instances in order for the code to access it directly, a heavier problem will arise!

Please Imagine this situation ( I have lots and lots and lots and lots of creatures that uses this example):

as3 imagine this situation.jpg

That toadChars function does this (AS2):
Code: Select All Code
stop();
onEnterFrame=function(){
   if (_parent._parent._parent._color=="blue")
       gotoAndStop("blue"); //head with blue mushroom
   else if (_parent._parent._parent._color=="yellow")
       gotoAndStop("yellow"); //head with red mushroom
  //else (do nothing, remain at RED)
}


I can also work in the stage (ROOT), like calling:
Code: Select All Code
MainClip(root).Level.ToadMain.toadSceneMain.ToadScene3.ToadHead.gotoAndStop("yellow");

But I dont know if the scene will be scene 3, I dont know if a given toad will have this head object, or a backside head object, or a frontside head object.
So I would need to make it more generic.
Code: Select All Code
MainClip(root).Level.ToadMain.allScenes.currentScene.head.gotoAndStop("yellow");


Then I would need to put instance names for all parts that will get affected:

as3 imagine this situation2.jpg
as3 imagine this situation2.jpg (127.69 KiB) Viewed 3563 times

Man, this would make my work a nightmare! Just imagine giving instance names of toad foot, toad torso, toad arm, toad forearm.....in all 12+ scenes! How about the other 330+ scenes that i said above?
Then, for me, in the current situation of the game, I need to use ENTER FRAMES inside those objects.
Do you have another idea? ;)

OwnerOfSuccuby Wrote:I use comand function that rearmor character on each change directly. Not use it on enter frame.

But this lead us to the problem above!

OwnerOfSuccuby Wrote:May be it is right to make event on rearm for example - to add event rearm to root - and listeners to it. If you monster do some thing he calls rearm function to change her armor - it is a little strange to check it on enter frame each time for me.

But then I need to instruct the rearm listener to go to the arm, leg, foot, head, of the current toad. Sometimes I use 'Toad scene 03 play' OUTSIDE of the Friend Toad Main (I use the Movieclip alone, separated), like in certain scenes in the blacksmith. I do this because I dont need 'Toad Main' (which is the main toad creature with tons of functions and all scenes). I just need ONE movieclip of the scene itself in that particular area. Then, the rearmor listener would need to search for
Code: Select All Code
MainClip(root).Level.currentScene.head.gotoAndStop("yellow");

instead of
Code: Select All Code
MainClip(root).Level.ToadMain.allScenes.currentScene.head.gotoAndStop("yellow").


OwnerOfSuccuby Wrote:I try to avoid this situation to put all MovieObjects in array - and check do they hittest each other, or make object that send to root comand - (Event=forExampleMyHit) - if it hit test the same type of object it screams to root layer, when other objects that add event listener on that screem to root layer hear it he do some thing to parent of that object for example.

Yes, I can do that too. Actually I already do that with some objects. I create an array, then the main loop checks if there is someone there, then I apply a given check. But I cant just do that, the game is already logically placed by using ENTER_FRAME listeners in many objects, and it worked so well in AS2 (onEnterFrame=function()).

OwnerOfSuccuby Wrote:Or may be i do not understand your code correct. I will try to look it more detailed tomorrow after work ;) - it is too late now :roll:

Thank you : ) Just understand that the objects (movieclips) can be in different hierarchies. So a given Toad can be in the Level directly, for example (like he is drowning in a bucket of water hehe). Then the code would need to find:
Code: Select All Code
MovieClip(root).Level.bucket.currentScene

But now I need to check if his Head, Arms, Torso, etc, changed clothes, because I can put a given code:
Code: Select All Code
MovieClip(root).Level.bucket.currentScene._naked=true;

So the toad will respond immediatelly, by being naked! But only this head, and only in this case!!
Without ENTER FRAMES, I would need to search all toads in all areas, by different hierarchies! Some are in the ground (MovieClip(root).Level.ground.Toad) , other are in the toiled (MovieClip_root.Level.ground.toilet.Toad2), etc! Its far better to use a loop (ENTER FRAME) which will check if the current object (like his arm, head, torso, etc) has a parent._naked, or parent.parent._naked. Etc.
And NO, this isnt slow. The performance is not dropped, because I already tested it in my benchmarks. They're quite efficient ;)

So we need brainstorming. :/

EDIT: Mariner has talked to me and its possible to extend classes which will do this work (of MAIN LOOPS in each object). I think that, by making the object in the stage call the associated class during its existence will avoid the problem with frames without ADDED TO STAGE listener, aside of more code organization.
Last edited by Ivan-Aedler on Mon Oct 12, 2015 2:04 am, edited 1 time in total.
User avatar
Ivan-Aedler
 
Joined: Fri Jun 03, 2011 6:34 am
Location: GMT -3

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby Ivan-Aedler » Mon Oct 12, 2015 12:10 am

Still about CODE:

OwnerOfSuccuby, check another reason to use a check inside the MC. Its for movement of mountains!
I noticed that we can have main loops inside objects, but:

Spoiler (click to show/hide):

1 - They have to be in the second frame onwards.

example with mountain code.jpg

2 - OR They have to include that ADDED_TO_STAGE check.

Code: Select All Code
this.addEventListener(Event.ADDED_TO_STAGE, function addedToStage(){
   this.addEventListener(Event.ENTER_FRAME, function onEnterFrame(){
   if (KeyEvents.isNextKeyPressed())
     play();
   });
removeEventListener(Event.ADDED_TO_STAGE, addedToStage);
  });


EDIT!!! ADDED_TO_STAGE is MAKING MIRACLES!!
EDIT2!!! GOREPETE (the Guru here on LOK, now called GO REPEAT) CONFIRMS its the way to go!

Code: Select All Code
stop();
obj=this;
addEventListener(Event.ADDED_TO_STAGE, function addedToStage(){
   CODE HERE
   CODE HERE
   CODE HERE (if it needs THIS, use OBJ above)
   CODE HERE
    removeEventListener(Event.ADDED_TO_STAGE, addedToStage);
 });

Lets go on!!!! ;)
Image
User avatar
Ivan-Aedler
 
Joined: Fri Jun 03, 2011 6:34 am
Location: GMT -3

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby GoRepeat » Mon Oct 12, 2015 4:49 am

Additional quality of life note:

If you want to swap or change all the instance names of an object on a timeline across all keyframes (like naming toad's head in your example) just make your change on the first keyframe, select the timeline, right click "Copy Motion" then "Paste Motion" and it will update all the other keyframes to the new object/name without having to sit there and change each one.

Also, given the current problems you are having, a "sloppier" but effective way to make embedded clips change/load for animations where they may or may not exist, you can just throw in a !=null check. Like if toad has a part that isn't always there for certain animations you could just do if(toad.part!=null){toad.part.gotoAndStop(3)} so if it is there, it updates, if not, it does nothing and doesn't throw errors at you.

And I agree with Succy, pushing your objects to a single array makes them really easy to manage, because then instead of having to reference _root.holder.blah.bloo.toad.poop.slop.grabble.flapper.boob.pop you can just reference obHolder[0] or obHolder[1].
Picarto LiveStream: https://picarto.tv/GoRepeat
Other Stuff: Click Here
User avatar
GoRepeat
Moderator
 
Joined: Wed Jul 21, 2010 2:26 am
Location: Behind the Looking Glass

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby Ivan-Aedler » Mon Oct 12, 2015 5:25 am

GoRepeat Wrote:Additional quality of life note: If you want to swap or change all the instance names of an object on a timeline across all keyframes (like naming toad's head in your example) just make your change on the first keyframe, select the timeline, right click "Copy Motion" then "Paste Motion" and it will update all the other keyframes to the new object/name without having to sit there and change each one.

Thank you!!! I've heard of a JSFL file which does that too: 'flash rename instance names QUICKER advanced' (here!)

flash rename instance names QUICKER advanced.zip
(641 Bytes) Downloaded 22 times

I used to execute this one in Flash CS6.....It doesnt work well in CC :/ Hence the problem. Now I'll do your method ;)

GoRepeat Wrote:Also, given the current problems you are having, a "sloppier" but effective way to make embedded clips change/load for animations where they may or may not exist, you can just throw in a !=null check. Like if toad has a part that isn't always there for certain animations you could just do if(toad.part!=null){toad.part.gotoAndStop(3)} so if it is there, it updates, if not, it does nothing and doesn't throw errors at you.

Great!!!! I was using hasOwnProperty:
Code: Select All Code
if (!obj.hasOwnProperty("style") || !obj.style))

But you see its a bit bulky. Now I can just do if (obj.style==null), right? Thats because if its not null, then It could be false or true (its a bollean) ;) So if it doesnt exist, the code will set TRUE. If it exists, but its FALSE, it will also set TRUE. This is perfect for my case!

GoRepeat Wrote:And I agree with Succy, pushing your objects to a single array makes them really easy to manage, because then instead of having to reference _root.holder.blah.bloo.toad.poop.slop.grabble.flapper.boob.pop you can just reference obHolder[0] or obHolder[1].

WAIT!!!!!!!! Wait a minute!! Now I remember! YES!! I used to pass variables by reference all the time!! I forgot that I could use an array of OBJECTS, where creatures are put inside there! So a toad inside _root.Level.ground.bathroom.toilet and a toad inside _root.Level.outsideLevel.haha could be referenced as creature[0] and creature[1]. Its all about initializing them in the stage (whoever they are) and making a PUSH with 'THIS' (its own object!)

Thank you again! ;) I'll write that down!

Image
User avatar
Ivan-Aedler
 
Joined: Fri Jun 03, 2011 6:34 am
Location: GMT -3

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby OwnerOfSuccuby » Mon Oct 12, 2015 6:34 am

By the way - i use on enter frame too - but have a problem - how do you avoid it ?

When i use some code in some object that use enter frame after i go to another level - the code does not stoping to work in that objects and gives me error.

So i have global function like goToAnotherLevel() - the same as gotoAndStop() - but with add of (sending event StoppAll and GoToNextLevel) - all objects have listeners that stop them and disable all image listeners on the stages for that object.

By the way - i start to thinking do not i make some idiotick steps making thingth like that in LoK as3 T version - i remove EventListeners by hands each time for example like:

Code: Select All Code
BB.addEventListener(MouseEvent.CLICK, fGoNext);

function fGoNext(e:MouseEvent):void{
       do some thing
     BB.removeEventListener(MouseEvent.CLICK, fGoNext);
}


Or flash removes it automatically when i do not use object and it is removed from stage ?

Becouse some times i get this strange constructions of code :mrgreen:

Code: Select All Code
this.addEventListener(Event.ENTER_FRAME,fSM);
this.addEventListener(Event.REMOVED_FROM_STAGE,fRT);
stage.addEventListener("GoToLevel", fRT);
this.addEventListener(MouseEvent.CLICK,fTC);

this.visible=false;

var makeVisible:Boolean=false;

function fSM(e:Event){
  if ((root as MovieClip).gameStatus=="Normal"){
    makeVisible=false;

    if ((parent as MovieClip).CHATTYPE=="SEX"){
     if ((root as MovieClip).KrystalHP>0){ // Если хп мало то не проверять на колизию и следственно не делать видимым чат с сексом
      for (var i:int=0;i<(root as MovieClip).playerMAArray.length; i++){
        if (this.hitTestObject((root as MovieClip).playerMAArray[i].parent.Body)){
           makeVisible=true;
          break;
       }
      }
     }
    }
    else {
       for (var i1:int=0;i1<(root as MovieClip).playerMAArray.length; i1++){
        if (this.hitTestObject((root as MovieClip).playerMAArray[i1].parent.Body)){
           makeVisible=true;
          break;
       }
      } 
    }
    if ((this.visible==true)&&(makeVisible==false)){
     this.visible=false;
     eB.gotoAndPlay("inactive");
   }
   else if ((this.visible==false)&&(makeVisible==true)){
     this.visible=true;
   }
   
   
  } // If Status=Normal
 
 
 
 else if ((root as MovieClip).gameStatus=="Pause"){
 }
 
 else if ((root as MovieClip).gameStatus=="Sex"){
   if (this.visible==true){
     this.visible=false;
   }
 }
}

function fTC(e:MouseEvent){
  if (this.visible==true){
    if(eB.currentLabel=="inactive"){
     if ((root as MovieClip).gameStatus=="Normal"){(root as MovieClip).gameStatus="Chat";
       eB.gotoAndPlay("active");
      (parent as MovieClip).gotoAndStop(2);
     }
    }
  }
}

function fRT(e:Event){
  this.removeEventListener(Event.ENTER_FRAME,fSM);
  this.removeEventListener(Event.REMOVED_FROM_STAGE,fRT); 
  stage.removeEventListener("GoToLevel", fRT);
  this.removeEventListener(MouseEvent.CLICK,fTC);
}
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby Ivan-Aedler » Mon Oct 12, 2015 7:47 am

OwnerOfSuccuby Wrote:By the way - i use on enter frame too - but have a problem - how do you avoid it ? When i use some code in some object that use enter frame after i go to another level - the code does not stoping to work in that objects and gives me error. So i have global function like goToAnotherLevel() - the same as gotoAndStop() - but with add of (sending event StoppAll and GoToNextLevel) - all objects have listeners that stop them and disable all image listeners on the stages for that object.

Oh no!! :o Thats the SAME problem I am having! :( :lol:
My problem is worse, because I have TONS of creatures, TONS of scenes, TONS of animated objects (coinboxes, etc) and everyone has its own life. So a given level can have like 400 listeners! :shock: And thats is NOT a bad practise, its only the way I wanted it to work. I like the independence of objects. Just think about AI. Everyone do what they are instructed to do, without interference. I've checked many projects and benchmarks that do this, and AS2 suffers when there is, say , 200 objects moving at the same time (or even less). In AS3, we can have 2,000 or even more, without performance hits!

But there are a way.....I think. This is the link that explains how.
http://stackoverflow.com/questions/1214 ... nce-in-as3
Inside this link, there is another, with instructions http://blog.reyco1.com/method-of-removi ... listeners/
This one appears to be even better! But we need to create three transparent buttons (control buttons) in the stage: http://jadendreamer.wordpress.com/2010/ ... listeners/

Then, when we change levels, the listeners are all removed.
GoRepeat, how do you make to overcome this one?
Last edited by Ivan-Aedler on Mon Oct 12, 2015 4:49 pm, edited 1 time in total.
User avatar
Ivan-Aedler
 
Joined: Fri Jun 03, 2011 6:34 am
Location: GMT -3

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby GoRepeat » Mon Oct 12, 2015 3:18 pm

Let me make sure I understand, the event listeners on your objects in frame 1 keep firing even when you enter frame 2 of the main stage? Personally I get around this by not using multiple frames on the main stage and would instead wrap each level (what would be frame 1, frame 2) as its own object that I load on the stage. That way when you remove it to load the next level, you just have to set it to null to garbage collect and stop all the objects contained within. But that would probably be a pretty large rework for you and not worth the effort.

If you do push all your objects to an array like we talked about earlier, you could always add a for loop before switching levels:
Code: Select All Code
for(var i:int=0; i<obHolder.length; i++){
   obHolder[i].removeEvents();
}


Then add a function to each object that clears its listeners:

Code: Select All Code
public function removeEvents():void{
   removeEventListener(Event.ENTER_FRAME, derpderp);
   removeEventListener(MoueEvent.CLICK, derpdoo);
   removeEventListener(etcetcetcetc)
}


That way right before you change levels (frames) it loops through all the objects on the stage and turns off their event listeners
Picarto LiveStream: https://picarto.tv/GoRepeat
Other Stuff: Click Here
User avatar
GoRepeat
Moderator
 
Joined: Wed Jul 21, 2010 2:26 am
Location: Behind the Looking Glass

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby OwnerOfSuccuby » Mon Oct 12, 2015 3:37 pm

Ivan-Aedler Wrote:
OwnerOfSuccuby Wrote:By the way - i use on enter frame too - but have a problem - how do you avoid it ? When i use some code in some object that use enter frame after i go to another level - the code does not stoping to work in that objects and gives me error. So i have global function like goToAnotherLevel() - the same as gotoAndStop() - but with add of (sending event StoppAll and GoToNextLevel) - all objects have listeners that stop them and disable all image listeners on the stages for that object.

Oh no!! :o Thats the SAME problem I am having! :( :lol:
My problem is worse, because I have TONS of creatures, TONS of scenes, TONS of animated objects (coinboxes, etc) and everyone has its own life. So a given level can have like 400 listeners! :shock: And thats is NOT a bad practise, its only the way I wanted it to work. I like the independence of objects. Just think about AI. Everyone do what they are instructed to do, without interference. I've checked many projects and benchmarks that do this, ans AS2 suffer when there is, say , 200 objects moving at the same time (or even less). In AS3, we can have 2,000 or even more, without performance hits!

But there are a way.....I think. This is the link that explains how.
http://stackoverflow.com/questions/1214 ... nce-in-as3
Inside this link, there is another, with instructions http://blog.reyco1.com/method-of-removi ... listeners/
This one appears to be even better! But we need to create three transparent buttons (control buttons) in the stage: http://jadendreamer.wordpress.com/2010/ ... listeners/

Then, when we change levels, the listeners are all removed.
GoRepeat, how do you make to overcome this one?


My way works - when i send comand to remove listeners - they saying about same strange constructions ( for me ) as i use :? :shock: :lol:
I thought that it is more easy way but interesting that some collector remove old listeners as i understand ? It is good.

I start some stupid things already - on button click i for example if i need next frame i remove listener to click and go next frame - but i think without removing listener nothing will change. No errors i thought that it will spend more memory or CPU if it will stay.

And now what do we know - for example if you use movie clip with with movie clip in it that have code on enter frame - you need to desaible this code before go to level 2 or you get an error - am i right ?
If so why not to use some kind of removing listener like i do ? And make first frame of objects empty - use only minimum of code there. I had the same project with Krystal head so i put image there and code that go to front or side looking head.
Becouse if i made go to and stop function i get errors becouse inhead objects do not go to their frame yet.

It is possible to put variables there and check if it get some comand like listener event - then it can not play some part of code end etc.

It is better see a little example - i know that adobe do not like when people do like i do ... but who cares ;) :lol: :mrgreen:
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby Ivan-Aedler » Mon Oct 12, 2015 5:06 pm

GoRepeat Wrote:Let me make sure I understand, the event listeners on your objects in frame 1 keep firing even when you enter frame 2 of the main stage? Personally I get around this by not using multiple frames on the main stage and would instead wrap each level (what would be frame 1, frame 2) as its own object that I load on the stage. That way when you remove it to load the next level, you just have to set it to null to garbage collect and stop all the objects contained within. But that would probably be a pretty large rework for you and not worth the effort.

Well, well, well....I changed this approach since LALEM problems back in 2013 : ). Preciselly, in 22th of April 2013. I used to do that, then very strange bugs started to appear, like the ground disappearing, and fish floating during end level status screen.

Spoiler (click to show/hide):

LALEM - before.jpg

Spoiler (click to show/hide):

LALEM - after.jpg
LALEM - after.jpg (86.58 KiB) Viewed 3495 times


Then I made the 'GRAND change' ;) In the second screen above, you dont see the AS linkages, but I put them all days later ;)

I dont have 30, 40, 50 levels in the Main Timeline anymore, but I still used a 'Screen Main' MC, with 20 fixed screens (options screens, pause screen, achievement screen, load game screen.....).
Recently (already in AS3) I destroyed 'Screen Main' MC, and now I use pure ADDCHILD and REMOVECHILD , in frame 3 of scene 1. Each screen has its own button listeners. The options screen has 5 buttons. So 5 MOUSE_CLICK listeners. The load screen, 9 buttons, and so on.

as3 addchild.jpg
as3 addchild.jpg (92.34 KiB) Viewed 3495 times

So I am in a better situation at least.
The problem: when I change screens, the older screen is still in the screen :/ So they are pushed on top of the other :(

screens.jpg


I am using this function (inside GameUtil class) to change screens (I'll organize my hundreds of MovieClip(root) functions into classes later):

Code: Select All Code
  public class GameUtils extends Sprite{
        //a reference to the stage
      private static var stage:Stage; //'stage' is the SCENE1, without any Movieclip on it!
      
      //Empty Constructor on purpose. To use the class, call the methods directly, with the class name before it. E.g: GameUtils.clone(this);
      public function GameUtils(stage:Stage){
         this.stage=stage;
      }

      //go to the Main Screen, unloading and reloading screens there.
      public static function goMainScreen(obj:MovieClip,screen:String) {
           obj.gotoAndStop("screen_select");
          if (obj.getChildByName("screenItem")!=null)
            obj.removeChild(obj.getChildByName("screenItem"));
             obj.attachMovieAS3(obj,screen,"screenItem",0);
          if (obj.getChildByName("screenItem")!=null)
             trace ("OKAY!!");
      }


I execute like this: GameUtils.goMainScreen(MovieClip(root),"Screen_Train");

AttachMovieAS3 is only the way I use currently, as it helped me a lot converting my 1000 or more older attachMovies.
As we know, we cant use a given layer that is not used (like layer 10,000), because Flash only uses the ones that is already in the stage.
So if I put a 'layer' parameter (older functions that is now called AttachMovieAS3), it still executes addChild again (not addChildAt). Just for convenience of legacy code.

Code: Select All Code
function attachMovieAS3(obj:MovieClip,libraryName:String,instanceName:String,layerNumber:int){
   if (layerNumber==0) {
          obj[instanceName] = obj.addChild(new (getDefinitionByName(libraryName) as Class));
         //I might do more calculations here later
       } else {
          obj[instanceName] = obj.addChild(new (getDefinitionByName(libraryName) as Class));
      }

    obj[instanceName].name = instanceName;
}


So the screens are getting changed, but on top of the other :/ If I keep going to the next screen, then the former, then the next, then the former, the game starts to be HELLISH slow! :o
And I am noticing the buttons of the former are still active. If I can remove the older screen and its listeners got garbage collected automatically, then it will be great!

I already tried to do your approach (!=null), but it doesnt work with movieclips, lets check!

Code: Select All Code
   public static function goMainScreen(obj:MovieClip,screen:String) {
        obj.gotoAndStop("screen_select");
       if (obj.screenItem!=null)
         obj.removeChild(obj.getChildByName("screenItem"));
          obj.attachMovieAS3(obj,screen,"screenItem",0);


It gives this error ReferenceError: Error #1069: Property screenItem not found on Main and there is no default value.

GoRepeat Wrote:Now I do this: If you do push all your objects to an array like we talked about earlier, you could always add a for loop before switching levels:

Yes, thats a good approach ;) But why not making a class and then 3 invisible buttons? That way, you dont need to add commands to each of your addEventListeners, because there is a class that increases addEventListeners funcionality for you (last link above).

OwnerOfSuccuby, I'll check your code ;)
EDIT: It threw errors. I disabled Strict Mode and removed FireSound and ExplodeSound (those are not in the library).

FIXED!

ownerSuccuby example.fla
(261.16 KiB) Downloaded 30 times

Now the demo runs, but I cant do anything. What it does actually? Hehe
Last edited by Ivan-Aedler on Mon Oct 12, 2015 10:03 pm, edited 1 time in total.
User avatar
Ivan-Aedler
 
Joined: Fri Jun 03, 2011 6:34 am
Location: GMT -3

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby Ivan-Aedler » Mon Oct 12, 2015 7:58 pm

Go Repeat and others, please check out this new demo I've made. Source code included.
It uses a new approach (actually from 2010) to remove all listeners, even ENTER_FRAMES (well, it worked here).

There is a README file inside.

AS3 LISTENER EXAMPLE.zip
(366.68 KiB) Downloaded 31 times
User avatar
Ivan-Aedler
 
Joined: Fri Jun 03, 2011 6:34 am
Location: GMT -3

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby Ivan-Aedler » Tue Oct 13, 2015 4:05 am

I need someone that could help me in this example.
GO REPEAT nailed it down!!!!!

PS: I think I've got a feat! Hehe

congratulations.jpg
congratulations.jpg (44.21 KiB) Viewed 3453 times
Last edited by Ivan-Aedler on Tue Oct 13, 2015 5:33 am, edited 1 time in total.
User avatar
Ivan-Aedler
 
Joined: Fri Jun 03, 2011 6:34 am
Location: GMT -3

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby GoRepeat » Tue Oct 13, 2015 5:25 am

You are calling the child by name, but never actually set the name of the child so the remove function doesn't see it. Just add the line:

Code: Select All Code
obj[instancName].name = instancName;


So the new function is:

Code: Select All Code
function attachMovieAS3(obj:MovieClip,libraryName:String,instancName:String,layerNumber:int){
   var newScreenMC:Class = getDefinitionByName(libraryName) as Class;
   obj[instancName]=new newScreenMC;
   obj[instancName].name = instancName;
   if (layerNumber==0)
      obj.addChild(obj[instancName]);
   else
      obj.addChildAt(obj[instancName],layerNumber);}


Then it works fine:

Click to Play
(Javascript Required)

Screen Example (CS5).swf [ 10.75 KiB | Viewed 3445 times ]



Edit note: I know it seems weird, but just because the object's name is something doesn't mean the object's actual name PROPERTY is the same thing. You created the object ob.stageObject, but it could be named "Frank" for all the game knows. "stageObject" is just a reference not the actual .name property. If that makes sense.
Picarto LiveStream: https://picarto.tv/GoRepeat
Other Stuff: Click Here
User avatar
GoRepeat
Moderator
 
Joined: Wed Jul 21, 2010 2:26 am
Location: Behind the Looking Glass

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby Ivan-Aedler » Tue Oct 13, 2015 5:32 am

GoRepeat Wrote:You are calling the child by name, but never actually set the name of the child so the remove function doesn't see it. Just add the line

Whatttttt??

Image
:( :( I feel like a first-rookie-pre-newbee in AS3 :(

Thank you!! ;)
EDIT: The problem keeps occurring in the game :/

GoRepeat Wrote:Edit note: I know it seems weird, but just because the object's name is something doesn't mean the object's actual name PROPERTY is the same thing. You created the object ob.stageObject, but it could be named "Frank" for all the game knows. "stageObject" is just a reference not the actual .name property. If that makes sense.

Oh I see! Now the 'property' (where VAR obj points to) is different than its .name property. I have to be careful next time!
I can continue the conversion!!!

as3 progressing - surgery attack 24th.jpg
Last edited by Ivan-Aedler on Wed Oct 14, 2015 7:07 am, edited 1 time in total.
User avatar
Ivan-Aedler
 
Joined: Fri Jun 03, 2011 6:34 am
Location: GMT -3

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby Ivan-Aedler » Wed Oct 14, 2015 7:02 am

I Fixed one of the hardest stages of AS3 conversion!!
Image

You! The message! You! I'll never forget U! :evil: :evil: :evil:

here lifes hateful message flash.jpg
here lifes hateful message flash.jpg (88.74 KiB) Viewed 3388 times
User avatar
Ivan-Aedler
 
Joined: Fri Jun 03, 2011 6:34 am
Location: GMT -3

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby Ivan-Aedler » Sat Oct 17, 2015 12:12 am

Giving out some news!

mim put as2 to as3.jpg
mim put as2 to as3.jpg (41.67 KiB) Viewed 3338 times
User avatar
Ivan-Aedler
 
Joined: Fri Jun 03, 2011 6:34 am
Location: GMT -3

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby Residentlover2 » Sat Oct 17, 2015 3:55 am

So next year will be fully converted, I guess we`ll get less bugs
keep it up man ! youre great ;)
English is not my main language :P
User avatar
Residentlover2
 
Joined: Tue May 24, 2011 3:01 am

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby naruto95 » Sat Oct 17, 2015 4:00 pm

That's great! so there's not gonna be more updates till you fully convert to AS3, right? :o


Ivan-Aedler Wrote:Giving out some news!

mim put as2 to as3.jpg
naruto95
 
Joined: Tue Sep 09, 2014 8:27 pm

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby overlord5 » Sat Oct 17, 2015 11:39 pm

naruto95 Wrote:That's great! so there's not gonna be more updates till you fully convert to AS3, right? :o


Ivan-Aedler Wrote:Giving out some news!

mim put as2 to as3.jpg

i belive ivan may add some contant (it's his way of relaxing) and if any crit errors are found he will proberbly fix it
User avatar
overlord5
 
Joined: Sat Jan 31, 2015 12:18 pm

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby Ivan-Aedler » Sun Oct 18, 2015 5:38 pm

Okay, screens being rendered in AS3, with a few glitches yet.

toad bed scene AS3.jpg
toad bed scene AS3.jpg (97.02 KiB) Viewed 3267 times

Residentlover2 Wrote:So next year will be fully converted, I guess we`ll get less bugs. keep it up man ! you're great ;)

Thank you ;) We can still do something in the current version!

naruto95 Wrote:That's great! so there's not gonna be more updates till you fully convert to AS3, right? :o

As Overlord said, and as you can see in PAGE 1, I am still working in the current version.

page 1.jpg
User avatar
Ivan-Aedler
 
Joined: Fri Jun 03, 2011 6:34 am
Location: GMT -3

Re: Hentai: Peach's Untold Tale 2.4.9 (Oct 5/15)

Postby Ivan-Aedler » Tue Oct 20, 2015 10:55 pm

PROGRESSING!!! Increasing conversion speed!

Image

NEWS!!!
I discovered a way to put code inside the timeline without having to put all of those listeners!
And I want to share this on LOK!

The usage is simple: In the attached class (AS3 format), you just add it to your project:
Code: Select All Code
import Timeline;


I called it 'Timeline' but you can call any name, like 'TimeLinePose' or 'MyGameTimelineFunctions'.
Then you edit the class, adding functions that you want to happen in the first frame of the current object timeline, like make her walk, or perhaps make her change position.
Remember to REMOVE/change the IMPORTS, like Lvl, Player....you dont need that for it to work!

Code: Select All Code
public static function preparePlayer(obj:MovieClip){
          if (!Player.tired)
   //do something, like making her ready
}
         


Code: Select All Code
public static function changeEyesWhenStopped(obj:MovieClip){
          if (obj.root.PLAYER.PeachDrunk)
           obj.root.PES(obj,"frown","closed","closed");
         else if (obj.root.isPeachHorny(false))
           obj.root.PES(obj,"frown","lidded","lidded");
         else
           obj.root.PES(obj,"closed","opened","opened");
      }   


Code: Select All Code
public static function checkCollision(obj:MovieClip){
          if (obj.hitTestObject(obj.root.Level.goomba))
                            //do something
         


Now go to the MovieClip, and put this in the first frame:

Code: Select All Code
Timeline.exec(this,"preparePlayer","changeEyesWhenStopped","checkCollision",true);


What will it do? If you check the class (its well documented), you will see that the first parameter is the object, and the three others are strings that points to function names of the class!
The first string is the function that will be executed ONCE, the second is executed IN EACH FRAME and the third is executed if the playhead RETURNS to frame 1 (so a movieclip with 20 frames will execute in 1/20th of the time) ;)

EDIT: You can also put Timeline.exec(this, null,null,null,true); if you just want to initialize the movieclip (the code you made is in later frames). So It wont run any function on frmae 1 and it will WORK!
Here is the class!

Timeline.as
(7.54 KiB) Downloaded 41 times

Of course it does not cover EVERYTHING, like mouse presses, etc. Its just for us (timeline coders) that have like 1,000 movie clips and WE DONT WANT to create A SWARM of classes just to give it a command in the first frame.
This kind of approach avoids coding in the timeline like this!!

Spoiler (click to show/hide):

'pz pose' movieclip - common way of coding in the timeline in AS3.jpg
Last edited by Ivan-Aedler on Thu Oct 29, 2015 2:53 am, edited 3 times in total.
User avatar
Ivan-Aedler
 
Joined: Fri Jun 03, 2011 6:34 am
Location: GMT -3

PreviousNext

Return to Flash Projects



Who is online

Users browsing this forum: No registered users