Logo

Help With a Command (SM5)

Register Log In Back To Forums

Post #1 · Posted at 2014-05-14 02:36:56am 9.9 years ago

Offline Th3_Ov3rHell_3XoduZ
Th3_Ov3rHell_3XoduZ Avatar Member
313 Posts
Chile
Reg. 2012-09-13

"ITG, The Best Dance Machine!"
How I can make a determinate image move, for example an arrow move it to left and down and linear, like an animation, I dont know how to do it.

I am trying to recreate the ScreenWithMenuElements BG from the OpenITG to Stepmania 5. But using the codes doesnt move the images.

Anyone Help?
Quote: Released Themes for SM5 Beta 3
Quote: Released Themes for SM5 Beta 4 & 5.0.7
Quote: Simfles Packs Released

Post #2 · Posted at 2014-05-14 03:22:31am 9.9 years ago

Offline dbk2
dbk2 Avatar Member
332 Posts
Not Set
Reg. 2012-04-30


Last updated: 2014-05-14 03:23am
Moving an image in StepMania is a two-step process. You must specify a tween type and then an x/y quantity.

So, let's say you have an image loaded like...

Quote

LoadActor("myImage.png")..{
InitCommand=cmd(Center;);
OnCommand=cmd(linear,2; xy,100,100);
};

This image would initialize to be centered in its ActorFrame (because of the Center command in InitCommand).
When the screen is ready, the OnCommand is executed. This OnCommand will cause the image to move right 100px and down 100px from its initial location over a duration of 2 seconds at a constant (linear) pace.

It is not necessary to specify both x and y values. You could, for example, only specify linear,2; x, 100; which would move the image 100px to the right.

You can also try replacing linear with accelerate or decelerate to see what those look like.

Does this make sense?

Post #3 · Posted at 2014-05-14 03:29:16am 9.9 years ago

Offline Th3_Ov3rHell_3XoduZ
Th3_Ov3rHell_3XoduZ Avatar Member
313 Posts
Chile
Reg. 2012-09-13

"ITG, The Best Dance Machine!"
wow it works, but there is a way of queue the command OR repeat that movement, I try the queuecommand but doesnt work
Quote: Released Themes for SM5 Beta 3
Quote: Released Themes for SM5 Beta 4 & 5.0.7
Quote: Simfles Packs Released

Post #4 · Posted at 2014-05-14 03:32:12am 9.9 years ago

Offline dbk2
dbk2 Avatar Member
332 Posts
Not Set
Reg. 2012-04-30

You'll need to be more specific about what you are trying to accomplish.

Do you want it to move back and forth 2 times? 3 times? Forever? Maybe you don't want it to move back and forth, but rather you want it to reset automatically to starting position after reaching its destination. I can help you, but I need more information.

Post #5 · Posted at 2014-05-14 03:41:52am 9.9 years ago

Offline Th3_Ov3rHell_3XoduZ
Th3_Ov3rHell_3XoduZ Avatar Member
313 Posts
Chile
Reg. 2012-09-13

"ITG, The Best Dance Machine!"
Quote: dbk2
You'll need to be more specific about what you are trying to accomplish.

Do you want it to move back and forth 2 times? 3 times? Forever? Maybe you don't want it to move back and forth, but rather you want it to reset automatically to starting position after reaching its destination. I can help you, but I need more information.

Well, maybe if you have installed OpenITG you will understand me, look the image below, ignore the big center arrow and the options lines. Look all that textures at the background, what I want to is make all that images move from for example to the DownRight and repeat (loop) that movement, each image with a different movement.

Is very hard to explain you more detailed, I just speak little english, sorry XD. I hope you understand my Good explanation xd

http://fc09.deviantart.net/fs70/f/2014/133/d/8/untitled_by_ov3rhell3xoduz-d7iago7.png
Quote: Released Themes for SM5 Beta 3
Quote: Released Themes for SM5 Beta 4 & 5.0.7
Quote: Simfles Packs Released

Post #6 · Posted at 2014-05-14 04:02:47am 9.9 years ago

Offline dbk2
dbk2 Avatar Member
332 Posts
Not Set
Reg. 2012-04-30


Last updated: 2014-05-14 04:08am
This should get you started: http://pastebin.com/qe4zAAqN

I looked at the default theme for OpenITG and saw that ScreenWithMenuElements background pointed to _shared background normal which loaded _shared background no streaks. The default.xml file in _shared background no streaks contained the code for the screen you showed above.

Most of the commands are the same, really. I just converted only the lines for the arrows.png

Post #7 · Posted at 2014-05-14 04:06:54am 9.9 years ago

Offline Th3_Ov3rHell_3XoduZ
Th3_Ov3rHell_3XoduZ Avatar Member
313 Posts
Chile
Reg. 2012-09-13

"ITG, The Best Dance Machine!"
If I use the same code lines from that .xml files just move the images on x axis and not y axis likes OpenITG, so I just got this trying to copy the same codes lines... but only it moves to x axis.

http://sta.sh/02wjcs9pn83
Quote: Released Themes for SM5 Beta 3
Quote: Released Themes for SM5 Beta 4 & 5.0.7
Quote: Simfles Packs Released

Post #8 · Posted at 2014-05-14 04:13:05am 9.9 years ago

Offline dbk2
dbk2 Avatar Member
332 Posts
Not Set
Reg. 2012-04-30


Last updated: 2014-05-14 04:17am
By looking at your code briefly, I noticed that your parent ActorFrame is missing its OnCommand.

Quote

local t = Def.ActorFrame{
OnCommand=cmd(wag;effectmagnitude,0,5,0;effectperiod,12);
};

effectmagnitude takes three arguments (x, y, z) so it is possible adding that will fix your problem. If not, I would need to look at it more closely.

In SM3.95/OpenITG, the effect commands were capitalized (EffectMagnitude and EffectPeriod). In SM5, they are completely lowercase (effectmagnitude and effectperiod).

Post #9 · Posted at 2014-05-14 04:26:50am 9.9 years ago

Offline Th3_Ov3rHell_3XoduZ
Th3_Ov3rHell_3XoduZ Avatar Member
313 Posts
Chile
Reg. 2012-09-13

"ITG, The Best Dance Machine!"

Last updated: 2014-05-14 04:46am
if I add that line, this happens, How I can set that command only for the elements except the bg image?

http://fc03.deviantart.net/fs70/f/2014/133/c/8/untitled_by_ov3rhell3xoduz-d7iam34.png

EDIT: Also, if I add that OnCommand line, almost all the bg elements disappear


Forget that, I already fixed, the unique problem that I have is, adding the OnCommand line, almost all the others bg elements disappears. Any idea why?
Quote: Released Themes for SM5 Beta 3
Quote: Released Themes for SM5 Beta 4 & 5.0.7
Quote: Simfles Packs Released

Post #10 · Posted at 2014-05-14 04:46:32am 9.9 years ago

Offline dbk2
dbk2 Avatar Member
332 Posts
Not Set
Reg. 2012-04-30

On line55 of the code you posted:


Quote

-- Arrow
t[#t+1] = Def.ActorFrame{
InitCommand=cmd(fov,45;x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;rotationz,-30;rotationx,-30;rotationy,-15);
LoadActor( "arrow" )..{
OnCommand=cmd(diffusealpha,0.88;zoom,2;wag;EffectMagnitude,0,0,5;EffectPeriod,5);
};
};

EffectMagnitude and EffectPeriod don't exist any longer. You need to make them lowercase. Also, try changing the arguments you are passing to effectmagnitude (they are x,y,z). If you want them to wag on the y-axis, then maybe try 0,5,0.

Post #11 · Posted at 2014-05-14 04:51:09am 9.9 years ago

Offline Th3_Ov3rHell_3XoduZ
Th3_Ov3rHell_3XoduZ Avatar Member
313 Posts
Chile
Reg. 2012-09-13

"ITG, The Best Dance Machine!"
[Updated]

I have changed the EffectMagnitude and EffectPeriod to lowercase, this is the current codes lines http://sta.sh/0vhtwuv2swc and the only thing I have to fix is, the others elements doesnt show if I add that OnCommand, why?

http://fc00.deviantart.net/fs70/f/2014/133/4/9/untitled_by_ov3rhell3xoduz-d7iaof9.png
Quote: Released Themes for SM5 Beta 3
Quote: Released Themes for SM5 Beta 4 & 5.0.7
Quote: Simfles Packs Released

Post #12 · Posted at 2014-05-14 05:10:25am 9.9 years ago

Offline Kyzentun
Kyzentun Avatar Member
3,209 Posts
United States
Reg. 2008-02-20

"I'm honestly pissed off."
One big thing that dbk2 hasn't mentioned yet is that you should find the Logs/log.txt file that stepmania creates and search if for errors. Just open it in notepad or something and search for "error". If something causes a problem it will often be reported there. The most likely cause of your disappearing elements is a syntax error in your code.
silenttype01: Kyzentun is never harsh. He says it how it is.

GENERATION 24: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.

Post #13 · Posted at 2014-05-14 05:14:54am 9.9 years ago

Offline dbk2
dbk2 Avatar Member
332 Posts
Not Set
Reg. 2012-04-30

I was just about to recommend that next, Kyzentun. Smile

Post #14 · Posted at 2014-05-14 05:16:12am 9.9 years ago

Offline Th3_Ov3rHell_3XoduZ
Th3_Ov3rHell_3XoduZ Avatar Member
313 Posts
Chile
Reg. 2012-09-13

"ITG, The Best Dance Machine!"

Last updated: 2014-05-14 05:19am
impossible, i know that but, this doesnt crash the stepmania so the log.txt doesnt exist. Maybe is something wrong with the default.lua file.

EDIT: well the file exist, but it only includes messages when something crashes STepmania or shown a window error (example a image dimension, etc). this belong to the default.lua file.
Quote: Released Themes for SM5 Beta 3
Quote: Released Themes for SM5 Beta 4 & 5.0.7
Quote: Simfles Packs Released

Post #15 · Posted at 2014-05-14 05:21:45am 9.9 years ago

Offline Kyzentun
Kyzentun Avatar Member
3,209 Posts
United States
Reg. 2008-02-20

"I'm honestly pissed off."
That file should always exist, though output to it is buffered and only written when necessary. It's often useful to hold F3 and press W to flush the buffer to the file before looking at it.
silenttype01: Kyzentun is never harsh. He says it how it is.

GENERATION 24: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.

Post #16 · Posted at 2014-05-14 05:33:38am 9.9 years ago

Offline Th3_Ov3rHell_3XoduZ
Th3_Ov3rHell_3XoduZ Avatar Member
313 Posts
Chile
Reg. 2012-09-13

"ITG, The Best Dance Machine!"

Last updated: 2014-05-14 05:33am
I have decided to divide the entire code.

..ThemesIn The Groove 2 ~GT~BGAnimationsScreenWithMenuElements backgrounddefault.lua

http://sta.sh/01vplysi5t5o

and ..ThemesIn The Groove 2 ~GT~BGAnimationsScreenWithMenuElements background
ostreak.lua

http://sta.sh/01zigfk9zy5b

Separating like that all the codes, shows all the elements, but this happens, If i get center everything, this finally will be fixed.

http://fc02.deviantart.net/fs71/f/2014/133/9/e/untitled_by_ov3rhell3xoduz-d7iar8k.png

LOL, Finally fixed!!!!!!!

I just had to delete a little code and it is finally fixed and working now... this took me all the entire day.

Thanks to dbk2 for all the HELPS. You are amazing!!

Thanks guys!

http://fc08.deviantart.net/fs70/f/2014/133/a/1/untitled_by_ov3rhell3xoduz-d7ias4e.png
Quote: Released Themes for SM5 Beta 3
Quote: Released Themes for SM5 Beta 4 & 5.0.7
Quote: Simfles Packs Released

Post #17 · Posted at 2014-05-14 01:31:04pm 9.9 years ago

Offline CrzP
CrzP Avatar Member
36 Posts
China
Reg. 2014-02-21

Hmmm ...I have something more if you need:
A 'playcommand' command can be used in command lines such as OnCommand and Offcommand.

Like this:
OnCommand=cmd(playcommand,'New');

Then you must have a 'NewCommand' line in this part of actorframe.

Like:NewCommand=(linear,1;addx,10;linear,1;addx,-10;queuecommand,'New');

Then it will auto-loop NewCommand.If you want to stop its loop after achieving some goals,just write the NewCommand in 'function' style.

Like:NewCommand=function(self)
self:xxxxxx(xx)
if xx then
self:xxxx()
end;
end;

Hope this can help you a little~I replyed you by my smartphone...so forgive the ugly formatted text..QAQ.
Register Log In Back To Forums

0 User(s) Viewing This Thread (Past 15 Minutes)

©2006-2024 Zenius -I- vanisher.com -5th style- IIPrivacy Policy
Web Server: 3% · Database: 4% · Server Time: 2024-04-26 15:06:38
This page took 0.013 seconds to execute.
Theme: starlight · Language: englishuk
Reset Theme & Language