|
Post by runes on Jul 2, 2014 10:12:35 GMT
I'm experimenting with a little pseudo 3d and it goes well. I can recommend for anyone who's learning to look into older Actionscript 2 tutorials. A lot of stuff is quite easy to use in Hippo Animator. Here's my work so far: 3dscenetest.hani (962.52 KB) There's 2 things I need help for.. 1. Preview throws an error: "Unable to apply arithmetics between '100' and '100'." I'm not really sure what line causes this. And everything works when exported. 2. I need to z-sort the trees somehow. They're all based on the same Timeline object so sort by size should be sufficient. But I have absolutely no idea where to start. Any hint will be welcome. Lastly, please don't mock my code. But suggestions for improvements are welcome.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jul 2, 2014 12:04:34 GMT
runes1.Preview throws an error ------------------------------------- Please correct your code like this "Movement()": It is not: thing.Width = thing.Height = screenDistance * scaleRatio; but: thing.Width = screenDistance * scaleRatio; thing.Height = screenDistance * scaleRatio; And before the "thing.X = player.X+(dist_side*scaleRatio*10);" please insert one line code of: if(isNaN(dist_side)) return; And also please do not ask me why it doesn't show anything in the player , I don't know too. 2. the z order we did in a very large RPG system is sort by Y. You don't need to sort them by Z , because Z is need to cacular , and also it transform by Y.
|
|
|
Post by runes on Jul 2, 2014 12:56:32 GMT
Thanks! I knew I could count on you FlashKnight I have no intention of making actual z-sorting. I was thinking to just sort by height, but y probably makes more sense. The problem is I have no idea HOW to sort anything, so I'm a bit stalled right now ....
|
|
|
Post by Hippani on Jul 2, 2014 13:14:00 GMT
function SortY(A,B){ return A.Y<B.Y; } //assume an array called Items Items.sort(SortY);
|
|
|
Post by Hippani on Jul 2, 2014 13:19:58 GMT
We've just done an update.
If you try to do this:
A=B=100;
You should get a better error.
|
|
|
Post by Hippani on Jul 2, 2014 13:32:26 GMT
Another fix. var A=1.3; A=NaN;
This should work now.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jul 2, 2014 15:11:18 GMT
great to hear that ! I met those problems before , I just record them on my development notebooks in case later use .(a real book , not an iPad ) I spend some time to find out those before , but now is faster to locate the problem because I have a notebook. I really suggest you runes to got one , and taking notes in it . It is really useful when you met a solution before and wants to be faster to solve problems. regards.
|
|
|
Post by runes on Jul 3, 2014 3:43:41 GMT
function SortY(A,B){ return A.Y<B.Y; } //assume an array called Items Items.sort(SortY); Forgive my ignorance, but I need a little more help than this. I tried creating the array and adding the function to General. Then on Update added: Items.sort(SortY); for(var i=0;i<Items.length;i++){ ItemMoveToFront(""+Items); } This does nothing. I assume that my array is sorted correctly, but I need a guide to actually make the positions of the objects.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jul 3, 2014 6:52:37 GMT
runes , I would like to correct it for you , but a donation or a charge would be fine. You can preview what I did , move with your mouse , so you would see the things below: export.zip (452.48 KB) You are welcome to contact with me. and also: @hippo Studios: The Out Event() seems never work. I paused the moving in the OnOut() , but it still moving...
|
|
|
Post by Hippani on Jul 3, 2014 8:19:39 GMT
The over and out events have been fixed.
|
|
|
Post by runes on Jul 3, 2014 9:25:43 GMT
Thank you FlashKnight. But this is purely for educational use. So I really want to make the actual corrections myself. I plan to make a contribution to the gallery and a tutorial if I get anything usable out of it.
|
|
|
Post by Hippani on Jul 3, 2014 12:18:47 GMT
I've not actually tested this:
var List=new Array(Sprite1,Sprite2); var Ids=new Array("Sprite1","Sprite2"); var Swap; bool Changed = false; do { Changed = false; for (var i = 0; i < List.Length - 1; i++) { if(List[i].Y>List[i+1].Y){ Swap = List[i]; List[i] = List[i + 1]; List[i + 1] = Swap;
Swap = Ids[i]; Ids[i] = Ids[i + 1]; Ids[i + 1] = Swap;
ItemMoveForward(Ids[i]); //Or might be ItemMoveForward(Ids[i+1]); not sure Changed = true; } } } while (Changed);
|
|