Jump to content
Sign in to follow this  
F.hao

RotatetheEntitys

Recommended Posts

Hello guys,  how are you all, hope you'll have a good mood. And, this time i have a new problem. It's really funny and made me insane.

Have a look the video, here i have a demon ball, it contains three entity, the body(ball),the left wing, and right wing.

I hope it can follow me and aim me. And, in the same time, the double wings can fly(i set rotate animation to them).

For now, you guys can see it in the video, the wings is flying ,but when the ball aim me, it's direction is changing,  and the double wings still keep the original direction. Well, that's not what i want. 

And i don't how to make the double wings keep fly and aim me to. Well, just fly like a normal creature who has wings.?

I upload my ycomp file, hope it can help some. Can someone help me find a way to made it?

TESTDAMENBALL.zip

Share this post


Link to post
Share on other sites
5 hours ago, F.hao said:

Hello guys,  how are you all, hope you'll have a good mood. And, this time i have a new problem. It's really funny and made me insane.

Have a look the video, here i have a demon ball, it contains three entity, the body(ball),the left wing, and right wing.

I hope it can follow me and aim me. And, in the same time, the double wings can fly(i set rotate animation to them).

For now, you guys can see it in the video, the wings is flying ,but when the ball aim me, it's direction is changing,  and the double wings still keep the original direction. Well, that's not what i want. 

And i don't how to make the double wings keep fly and aim me to. Well, just fly like a normal creature who has wings.?

I upload my ycomp file, hope it can help some. Can someone help me find a way to made it?

TESTDAMENBALL.zip

as all scripters know , there are many ways to do this. here is just one of them which seemed to me to be the simplest .. it is not completely ideal, but it will guide you in the direction in which you can further develop the script.
if you need help, I'll be happy to do it, but I'd need more information, such as whether it will be used for multiplayer or singleplayer...

DEMON FOLOWING.zip

Share this post


Link to post
Share on other sites

@Mello1223 posted after I saw this but before I worked it out. To prove his point here is my solution. I made use of groups in mine so you will not be able to spawn new ones. However seeing as there is a player limit in ylands games it is easy enough to create eg 8 copies, and assign them to different players as needed or store them when not in use.
Using groups is probably the 'intended way' to solve the problem imo.

DAMENTEST_F.HAO.zip
As I was writing this I had a thought and came up with yet another solution. this one doesn't use groups so you can spawn the same way you are currently. The key thing to note is that you need to have your rotation animator rotating around a reference point, then you can rotate that reference point the same as the body. Also it is possible to do the flying animation with just 1 rotation animator.
DAMENTEST_F.HAO_V2.zip

@Mello1223 I had a quick look at yours, it is possible to solve problem without using loops, and I think its better to avoid those when possible.

  • Like 1

Share this post


Link to post
Share on other sites
4 hours ago, Mello1223 said:

as all scripters know , there are many ways to do this. here is just one of them which seemed to me to be the simplest .. it is not completely ideal, but it will guide you in the direction in which you can further develop the script.
if you need help, I'll be happy to do it, but I'd need more information, such as whether it will be used for multiplayer or singleplayer...

DEMON FOLOWING.zip

Oh my god, you guys so cool! @Oliver Hope @Mello1223

Hey, Mello, i get your ycomp and ran it. It's cool, rotate good. It's cost my little to understand how the loop work. It seem like you figure the last rotate angle for wings, then let them rotate to there, then keep do it. I think it's a good way to made this, and in this loop, maybe i can add some code to let the demon ball up and down when it follow me at the same time .

And hi Oliver @Oliver Hope, i ran your ycomp too. And i think i know the way you made it. By setting a point to the rotate animation , at the same time move the point with player.Yes this way made the rotate so smooth. But like you say, if i need more demon balls, i must prepare it before i use it.

--------So i think i'm to rush too post my problem with less explain, in fact for now, i'm trying to make a rogue-like game. First here will have 1-4 player at world, most 4.at least 1. Then , there must have many monster like demon ball. Of course, not every type got left arm and right arm. But for a demon ball. maybe there will appear 8 numbers(if there have 4 player, number is 4*8=32).That means i need spawns many entity(I do it at game start. and i don't destroy just hide them).  you know, i must consider the game performance, like Fps. 

So Oliver, i think i can assign many reference point to every monster in the unique rotate animation. But the total number of monster maybe 600. It will cost so many hand work?, and not easy to manger.

And Mello. seems the way your provide is good for this monster. I just need write few type animation for monster, and just call the function, and i hope the Fps not so low when there are many monsters.

Or maybe there got other suitable ways to mange many monster follow&rotate? Whatever, thanks you both very much?.

  • Like 1

Share this post


Link to post
Share on other sites
9 hours ago, Oliver Hope said:

As I was writing this I had a thought and came up with yet another solution. this one doesn't use groups so you can spawn the same way you are currently. The key thing to note is that you need to have your rotation animator rotating around a reference point, then you can rotate that reference point the same as the body. Also it is possible to do the flying animation with just 1 rotation animator.
DAMENTEST_F.HAO_V2.zip

@F.hao It should be possible to modify this second solution to be able to spawn as many as you need (like your original ycomp). (I thought you could how it is as I sent it, but now you said stuff that reminds me you can't). to modify it, You can spawn a separate entity reference point and rotation animator for each demon ball. 

If you are going to have many balls I recommend using an entity storage game logic to keep all the instructions and variables for the demon balls in. Let me know if I can help further

Share this post


Link to post
Share on other sites
30 minutes ago, Oliver Hope said:

@F.hao It should be possible to modify this second solution to be able to spawn as many as you need (like your original ycomp). (I thought you could how it is as I sent it, but now you said stuff that reminds me you can't). to modify it, You can spawn a separate entity reference point and rotation animator for each demon ball. 

If you are going to have many balls I recommend using an entity storage game logic to keep all the instructions and variables for the demon balls in. Let me know if I can help further

Hi Oliver, how can i spawn a separate rotation animator? I try it, but the rotation animator can't be choose by logic template(I can spawn a reference point by this way). Did i misunderstand your means?

Share this post


Link to post
Share on other sites

Hmmm, I assumed you could but I just checked now and you are correct, it is not possible ?
my solution will not work then?

Share this post


Link to post
Share on other sites
9 minutes ago, Oliver Hope said:

Hmmm, I assumed you could but I just checked now and you are correct, it is not possible ?
my solution will not work then?

? Hahahaha, But from this way to control the rotate is very smooth, i can use it at the pet function. Because player can only get one Pet.? 

Share this post


Link to post
Share on other sites

Question, where do you put these zip files? I'd like to have a look to see how you get entities to follow you so i can expand my scripting knowledge. 

Share this post


Link to post
Share on other sites
12 minutes ago, IEuphe said:

Question, where do you put these zip files? I'd like to have a look to see how you get entities to follow you so i can expand my scripting knowledge. 

Hi IEuphe ,Unzip it, put it into the file of your yland installed.the last file place is :\rail_user_data\2001099\17293822637842182107\cloud_storage\files\Compositions

Put the ycomp into the compositions file. and check it at yourself Component label in the game. Click it and put it in your scene.

Edited by F.hao

Share this post


Link to post
Share on other sites

for a larger number of entities, I recommend converting the loop to a time trigger. create an invisible object, such as a trigger zone or an impermeable barrier,do not use reference point,because ref point you can't deleted.then set : follow me object,aim to me object,and every timer spin move to demon and Wings get position object, if variable =true rotate Wings get rotation object +30 degree,or if variable= false -30 degree... I Can send you next ycomp,but latter..now  in work

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×