Any suggestions to how to animate triggered draw_0 to draw_3 brush/object?

Need help with using DizzyAGE then look here
Captain Jonesy
Your Backpack is Empty
Posts: 29
Joined: Mon Feb 15, 2010 12:27 pm

Any suggestions to how to animate triggered draw_0 to draw_3 brush/object?

Post by Captain Jonesy » Fri Oct 15, 2010 4:31 pm

Hi guys,

Wondering if I could pick your brains for any suggestions to how overcome the issue I'm having currently.

Basically I have this dragon character where I want to be able to give a item (ID==104 - skull) to and then he shoots a flame/fire (ID==1004) across the screen hitting/killing dizzy. I'm currently using waypoints for the flame which doesn't work, but wondering if because the flame is draw and material is set as "0" then becomes triggered to become draw and material "3". I Also tried using code below:

Code: Select all

if(IsUpdate(3)) 
    {
        //update the bat only once each 3 frames
        idx = ObjFind(1004);
        x = ObjGet(idx,O_ X) ;
        x+=4; // move from 4 to 4 pixels
        if(x>410) x=350;
        ObjSet(idx,O_X,x);
With this code, the flame was animated (flying across the screen) but it didn't kill dizzy although flame class is set to "Kill". Here is the current code I'm using:

Code: Select all

func UpdateRoom_1_3() ///////////dragon flame
{ 
 idx = ObjFind(1004);// dragon flame
     AIUpdateTrain(idx); 
     ObjPresent(idx);         
}
/////////////Dragon 
func ActionObject_1003()
{
idx = ObjFind(1003);

if (ObjGet(idx, O_STATUS) == 0)
{

  Message2(7,5,"Hello! Who comes there?");
  Message1(3,4,"Hello I'm Dizzy");
  Message1(4,5,"I'm wondering why\nare you preventing Jim\nfrom entering his\nlaboratory?"); MessagePop();
  Message2(7,5,"Well, I don't like wizards");
  Message2(7,5,"These wizards always\nuse these places to \ncreate anti-dragon devices."); 
  Message2(7,7,"Like potions and spells"); MessagePop();     
  Message1(4,5,"Jim isn't like that");
  Message2(5,6,"I don't believe you!\n Go away!"); MessagePop();  
  ObjSet(ObjFind(1003),O_STATUS,1);
  }
if(ObjGet(ObjFind(1003),O_STATUS)==1)
{      
Message2(7,5,"Get away, you wizard!"); MessagePop();
 idx = OpenDialogInventory();
     if (idx!=-1) 
    { 
     UseObject(idx);
    }
   }
  } 
func UseObject_1003( idx )
{
if(idx==ObjFind(104))////skull
    {
        InventorySub(idx);
        Message2(5,6,"A skull hahahahah");
        Message2(6,7,"You think that\nwould scare me off!");
        Message2(7,8,"Hahahahhahahaahah"); MessagePop();
        Message2(7,8,"I've killed many humans\nin my day"); MessagePop();
        Message2(5,6,"So I have no problem\nkilling you"); MessagePop(); 
        ObjSet(ObjFind(1004), B_DRAW, 3);
        ObjSet(ObjFind(1004), B_MATERIAL, 3);//Kill material 
         GameCommand(CMD_REFRESH);                      
    }     
  }
Any suggestions would great and thanks in advance.

Jonesy

Captain Jonesy
Your Backpack is Empty
Posts: 29
Joined: Mon Feb 15, 2010 12:27 pm

Post by Captain Jonesy » Fri Oct 15, 2010 4:34 pm

Sorry to make myself more clear - the flame currently doesn't animate with waypoints and trying to make the flame to travel from right to left on the screen hitting/killing dizzy as he finishes speaking to the dragon.

Thanks again

Jonesy

delta
Hard Boiled Egg
Posts: 3965
Joined: Fri Feb 09, 2007 7:08 pm
Location: North West
Contact:

Post by delta » Fri Oct 15, 2010 4:49 pm

uhhh still unsure exactly what the problem is...

does it animate as in move between frames? or is it just not moving across the screen? If the latter, that's not animation, that's movement!

Also, if it doesn't kill him, have you tried setting property COLLIDER to CALL HANDLER?

You may also have to change the STATUS property of the flame to 1, otherwise the AI code for the waypoints won't work.


Personally I wouldn't use waypoints for one movement like this, but that's just me :)
Image

Image

"Quotes from the internet may not be genuine" - Abraham Lincoln

Captain Jonesy
Your Backpack is Empty
Posts: 29
Joined: Mon Feb 15, 2010 12:27 pm

Post by Captain Jonesy » Mon Oct 18, 2010 2:28 pm

Yes the flame animates, just doesn't move across the screen. I was using waypoints with your suggestions but the invisible flame would kill dizzy before speaking/giving item to the dragon so that's no good. So yeah I think you are right that using movement is the right way forward for this, although I haven't coded any movment yet (used only waypoints so far), what code would you suggest? I want the flame move from right to left on the screen once as for this code from previous post

Code: Select all

if(IsUpdate(3)) 
    {
        //update the bat only once each 3 frames
        idx = ObjFind(1004);
        x = ObjGet(idx,O_ X) ;
        x+=4; // move from 4 to 4 pixels
        if(x>410) x=350;
        ObjSet(idx,O_X,x);


moves the flame from left to right and the movement keeps looping (starting from left to right again), which isn't what I'm looking forward, yet again thanks for the help and support.

By the way, thanks Pogie for the tip but this is my 1st dizzy level/game so I'm trying to keep things simple for the time being, I will defo use that guide/tips when I become more experienced using dizzy.

Thanks

Jonesy

Captain Jonesy
Your Backpack is Empty
Posts: 29
Joined: Mon Feb 15, 2010 12:27 pm

Post by Captain Jonesy » Mon Oct 18, 2010 2:55 pm

Sorry to forgot include this in previous post but code:

Code: Select all

if(IsUpdate(3))
    {
        //update the bat only once each 3 frames
        idx = ObjFind(1004);
        x = ObjGet(idx,O_ X) ;
        x+=4; // move from 4 to 4 pixels
       if(x>410) x=350;
        ObjSet(idx,O_X,x);


the flame is always active whilst in the room, what code would you suggest to use to allow the flame to be enabled once dizzy gives the dragon the item?

macon
Hard Boiled Egg
Posts: 174
Joined: Mon Apr 30, 2007 1:08 pm
Location: Grimsby, England

Post by macon » Mon Oct 18, 2010 5:23 pm

It sounds what you after is similar to when Dizzy meets Zaks in my game 'Excalibur Dizzy'. If you haven't played it then what happens is that Zaks throws an lightening bolt at Dizzy if he approaches. I know you want it to happen by the giving of an item rather than a collision but the same code should work, it's just the trigger is different.

I don't have 'Excalibur' on this computer to give you more details but you're welcome to look at my source code if you want. I'll be able to help further tomorrow if your still stuck.

Captain Jonesy
Your Backpack is Empty
Posts: 29
Joined: Mon Feb 15, 2010 12:27 pm

Post by Captain Jonesy » Mon Oct 18, 2010 6:59 pm

Hi Macon, thanks for the heads up. I've just downloaded 1.2 version of your Excalibur Dizzy game, here: http://www.yolkfolk.com/bb/showthread.php?t=211

This version hasn't got any scripts so I can't look and learn from your code, do you have version with script files included i could look at please?

macon
Hard Boiled Egg
Posts: 174
Joined: Mon Apr 30, 2007 1:08 pm
Location: Grimsby, England

Post by macon » Mon Oct 18, 2010 7:09 pm

In DizzyAge there is a tool called PAK. Use it to unpack the file named Dizzy.pak within the excalibur folder. This will give you a folder containing the scripts, map, graphics, music etc. Make sure you unpack it to the same folder.

Captain Jonesy
Your Backpack is Empty
Posts: 29
Joined: Mon Feb 15, 2010 12:27 pm

Post by Captain Jonesy » Mon Oct 18, 2010 9:41 pm

That's great, I didn't realise could you do that, I wondered why 90% people levels I've downloaded so far didn't have scripts in the folder by default, this certainly explains why. Thanks a lot and I start learning the way of the code! :v2_dizzy_smile:

Captain Jonesy
Your Backpack is Empty
Posts: 29
Joined: Mon Feb 15, 2010 12:27 pm

Post by Captain Jonesy » Tue Oct 19, 2010 12:17 pm

Hi Macon, sorry to be pain. I'm just looking at your code figuring out how the thunder bolt is triggered and how it disabled after dizzy dies, just wondering if you would explain your code or confirm if my understanding is correct;

Code: Select all

 ACTIVATE LIGHTENING (2182)
///////////////////////////////////////
func CollideObject_2182_2(idx)
{
    if (!ObjGet(ObjFind(2182),O_STATUS))
    {
        Say(ZAKS,"I don't know how\nyou managed to get\npast my guardians!");
        Say(ZAKS,"But you will not find\nit as easy to get\npast me !!!");
        ObjSet(ObjFind(2182),O_STATUS,1);
    }
    ObjSet(ObjFind(2181),O_DISABLE,0);
}

//////////////////////////////////////////
// DE-ACTIVATE LIGHTENING (2183)
//////////////////////////////////////////
func CollideObject_2183_2(idx)
{
    ObjSet(ObjFind(2181),O_DISABLE,1);
    ObjSet(ObjFind(2181),O_X,3428);
}



I'm not quite sure what func CollideObject command is for, but I'm guessing that it is some type of collision triggering device that when player walks into it, triggers a event in this case with "func CollideObject_2182_2(idx)" a dialogue with Zaks and then afterwards activates the thunder via -
ObjSet(ObjFind(2181),O_DISABLE,0);.

I'm not sure what func CollideObject_2183_2(idx) is but I can see that thunder disables with code:

ObjSet(ObjFind(2181),O_DISABLE,1);// disable thunder
ObjSet(ObjFind(2181),O_X,3428); // thunder Movement?

Also what I'm wondering how does this code correspond the thunder bolt
move across the screen only once (not keep looping) or stopping after dizzy death? Anyway thats I gather so far, I am on the right track? I hope you clear up some of my understanding. Thanks in advance.

Jonesy

Post Reply