View Full Version : Animated Vis
hammerhead
25th December 2002, 22:06
Hi everyone,
I am trying to make an animated vis like in mmd3, but have no idea how. I would have used bizzyd's, but he lost his .m, and I need one that has 5 variations of it.
Can someone please give me some pointers?
Thx,
hh
Evil Pumpkin
25th December 2002, 22:15
I think it's done with Layerfx...just search the forum or see in the maki cheats thread...someone some time ago have explained that...sry if doesn't help.
hammerhead
25th December 2002, 22:22
Hmm.. I had an idea. I can use tons of show() and hide()s!
Another q: will studio bring up an error if an item that was already hidden was given a command to be hid?
iPlayTheSpoons
25th December 2002, 22:33
no error
hammerhead
25th December 2002, 22:42
thats good!
iPlayTheSpoons
25th December 2002, 22:59
the way you do an animated vis is by first reading the VU meters. its usually done where the left and right are added and devided by 2 (for the average). then depending on the VU level, it goes to that frame in the animation...get it? and for going through different animated vis, you just do something like
Global Int A
------
A = 0;
------
AnimVisOverlay.onLeftButtonUp(int x, int y){
if(A == 0){
A = 1;
Anim0.hide();
Anim1.show();
else if(A == 1){
A = 2;
Anim1.hide();
Anim2.show();
}
}
where the vis overlay would be a 1% opacity button or something over the vis. atleast thats how i would do it. you should know where that stuff up there would go by now
hammerhead
25th December 2002, 23:05
Thx, I am not actually going to use that, but I have thought of another good method of using the show/hides.
hh
iPlayTheSpoons
25th December 2002, 23:09
either way :)
hammerhead
25th December 2002, 23:18
ok, I'm planning on developing a system that has buttons to switch to another vis, like mmd3. Now can someone please help me correct this code? Pls bear with me, cos I know basically nothing about maki.
#include "../../../lib/std.mi"
Global AnimatedLayer vis1, vis2, vis3, vis4, vis5;
Global Button visbtn1, visbtn2, visbtn3, visbt4, visbtn5;
System.onScriptLoaded()
{
vis1 = getObject("player.animl.v1");
vis2 = getObject("player.animl.v2");
vis3 = getObject("player.animl.v3");
vis4 = getObject("player.animl.v4");
vis5 = getObject("player.animl.v5");
visbtn1 = getObject("player.v1");
visbtn2 = getObject("player.v2");
visbtn3 = getObject("player.v3");
visbtn4 = getObject("player.v4");
visbtn5 = getObject("player.v5");
}
visbtn1.onLeftClick() {
vis1.show();
vis2.hide();
vis3.hide();
vis4.hide();
vis5.hide(); }
visbtn2.onLeftClick() {
vis1.hide();
vis2.show();
vis3.hide();
vis4.hide();
vis5.hide(); }
visbtn3.onLeftClick() {
vis1.hide();
vis2.hide();
vis3.show();
vis4.hide();
vis5.hide(); }
visbtn4.onLeftClick() {
vis1.hide();
vis2.hide();
vis3.hide();
vis4.show();
vis5.hide(); }
visbtn5.onLeftClick() {
vis1.hide();
vis2.hide();
vis3.hide();
vis4.hide();
vis5.show(); }
Thanks for you guys helping out,
hh
DirtyLowMoFo
26th December 2002, 02:24
hamerhead..
the problem appears to be in onScriptLoaded() when getting a handle(terminology??) to your objects. If all your objects reside within the same group try using...
vis1 = getScriptGroup().getObject("player.animl.v1");
vis2 = getScriptGroup().getObject("player.animl.v2");
etc..
you will need to add
<script id="scriptname" file="location/scriptname"/>
into the group in your xml.
If the objects are not all in the same group (ie. 1 group for vis, 1 group for buttons) you will need a handle to the groups first...
eg.
Group visgroup = getContainer("main").getLayout("normal").getObject("visgroup");
Group visbuttonsgroup = getContainer("main").getLayout("normal").getObject("visbuttonsgroup");
then use..
vis1 = visgroup.getObject("player.animl.v1");
etc. &
visbtn1 = visbuttonsgroup.getObject("player.v1");
etc.
if doing it this way you will need a scripts.xml containing
<scripts>
<script id="scriptname" file="location/scriptname"/>
</scripts>
& you will also have to include the scripts.xml into the skin.xml
<include file="xml/scripts.xml"/>
iPlayTheSpoons
26th December 2002, 02:52
ya, i more or less agree with dlmf. you have to tell the maki where all of those buttons and animations are
hammerhead
26th December 2002, 10:15
Thanks, I will try that.
-HH
hammerhead
26th December 2002, 10:40
Ok, I have modified it like you told me, but the script is still not compiling.
#include "../../../lib/std.mi"
Global AnimatedLayer vis1, vis2, vis3, vis4, vis5;
Global Button visbtn1, visbtn2, visbtn3, visbt4, visbtn5;
Global Group visgroup, visbuttonsgroup;
System.onScriptLoaded()
{
Group visgroup = getContainer("main").getLayout("normal").getObject("visgroup");
Group visbuttonsgroup = getContainer("main").getLayout("normal").getObject("visbuttonsgroup");
vis1 = visgroup.getObject("player.animl.v1");
vis2 = visgroup.getObject("player.animl.v2");
vis3 = visgroup.getObject("player.animl.v3");
vis4 = visgroup.getObject("player.animl.v4");
vis5 = visgroup.getObject("player.animl.v5");
visbtn1 = visbuttonsgroup.getObject("player.v1");
visbtn2 = visbuttonsgroup.getObject("player.v2");
visbtn3 = visbuttonsgroup.getObject("player.v3");
visbtn4 = visbuttonsgroup.getObject("player.v4");
visbtn5 = visbuttonsgroup.getObject("player.v5");
}
visbtn1.onLeftClick() {
vis1.show();
vis2.hide();
vis3.hide();
vis4.hide();
vis5.hide(); }
visbtn2.onLeftClick() {
vis1.hide();
vis2.show();
vis3.hide();
vis4.hide();
vis5.hide(); }
visbtn3.onLeftClick() {
vis1.hide();
vis2.hide();
vis3.show();
vis4.hide();
vis5.hide(); }
visbtn4.onLeftClick() {
vis1.hide();
vis2.hide();
vis3.hide();
vis4.show();
vis5.hide(); }
visbtn5.onLeftClick() {
vis1.hide();
vis2.hide();
vis3.hide();
vis4.hide();
vis5.show(); }
Thanks,
-HH
DirtyLowMoFo
26th December 2002, 12:47
check your globals, there is a spelling error in visbtn4 (missed the N)
hammerhead
26th December 2002, 14:13
Oh yes, its compiling now. I'll post up an example soon.
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.