Earthquake demo script

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Earthquake demo script

Postby ShadowHunter » Fri May 19, 2006 11:36 pm

Hi all,

I decided to post this in a new thread because I think more people can benifit from it.

On request of Candle I wrote a first, simple script to make a frame shake arbitrary ... nice for earthquakes, explosion, being shot or killed effects.

No plugin required !

You can download the demo here (460 Kb)

Hope you like it...

Kind regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Mystery » Sat May 20, 2006 12:10 am

I feel dizzy after watching the demo :wink:
It's really great, thanks for that ShadowHunter! :)
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby ShadowHunter » Sat May 20, 2006 12:16 am

Hi Mystery (wrong name corrected) :oops:,

Yeah... me too... had to watch it a few 100 times :D

Glad it works and your very, very welcome !

Kind regards,

ShAdOwHuNtEr
Last edited by ShadowHunter on Sat May 20, 2006 12:45 am, edited 1 time in total.
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Mystery » Sat May 20, 2006 12:27 am

Well since you start to mix up names of forum members, I really believe you that watching your earthquake demo more than 100 times is really dangerous. Maybe you should add a warning, lol :D

But seriously, this is something that I will definitely use because it is such a great effect that adds a lot to the game!
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Candle » Sat May 20, 2006 12:42 am

Ok that just so rocks..
You amaze me sometimes ya know that.
thank you so much..
Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3055
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Postby ShadowHunter » Sat May 20, 2006 12:47 am

Candle,

Thanks :D

I'm glad you like it... I'm happy to help !

Mystery,

Sorry to mix up names...

Yeah... It's kind of dizzy-making indeed.

Kind regards,

ShAdOwHuNtEr
Last edited by ShadowHunter on Sat May 20, 2006 1:16 am, edited 1 time in total.
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Candle » Sat May 20, 2006 12:54 am

I will have a nice program sometime tomorrow that will help everyone with hotspots and coordinates.
:)
Just about done with it.
Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3055
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Postby GM-Support » Sat May 20, 2006 9:33 pm

Very nice demo!

Congrats!

GM-Support
GM-Support
Forum Admin and Games Page admin
 
Posts: 2221
Joined: Thu Jun 05, 2003 7:52 pm

Postby ShadowHunter » Sun May 21, 2006 9:58 am

Thanks GM,

Though I really wanted to capture the frame and load it into the picturebox instead of loading it from the External folder but I was not able to accomplish it. But I'm sure it can be done :wink:

Also the second time you make the room shake, the black background picturebox isn't loaded anymore for some reason.

Finally it does not seem enough to just unload the controls to make the original hotspot active again... hence the visible = false action which obvisouly did the trick.

Any suggestions ?

Thanks for your help !

Kind regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Candle » Sun May 21, 2006 11:30 am

NM Did it a diff way.
Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3055
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Postby Mystery » Sun May 21, 2006 1:17 pm

Hi ShadowHunter

I use version 4.2 and here the black background isn't loaded at all (just realised that this was intended when I read your last post). How would it look like if it worked? Would it be an alternation between the picture of the library and the black background? Or how can I imagine it?

Anyhow the shaking room is a great effect per se so I don't mind if I can't use the black background. :) Or maybe I'll have a sudden idea what could be corrected in the script (though I doubt it). :wink:
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Candle » Sun May 21, 2006 1:22 pm

I used it on a 800x600 pictures /screen and it works fine for me. I don't see any black background?
It just shakes the ~~didn't mean to swear~~ out of the picture/screen.
Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3055
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Postby ShadowHunter » Sun May 21, 2006 2:42 pm

Hi,

It's not a big deal.

The meaning of the black background (behind the image that is been shaken) is to hide the original background in the offset zones.

In the demo just look at the text "Special thanks to MarkSA" you will see part of it remains steady while the first time this is black.

Kind regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Mystery » Sun May 21, 2006 2:51 pm

Ah all right, I have seen now what you mean! Thanks for the clarification. I guess this is really a minor difference.
And don't worry, your demo is just very fine as it is :)
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby ShadowHunter » Sun May 21, 2006 3:40 pm

Thanks Mystery,

I will try to solve it nonetheless :wink:

Kind regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby AncientRein » Sun May 21, 2006 4:25 pm

this a cute little program , thanks shadow.

im using 640x480 screens and see some black in the lower
right hand corner , looks good ,
i noticed if i click on the screen multiple times it
kind of just keeps shaking and never stops, after a couple of mins
it was still goin. it works just great for a single screen transition
i just might use it .

THANKS

ar
AncientRein
User avatar
AncientRein
Senior Member
 
Posts: 200
Joined: Tue Nov 09, 2004 4:09 pm

Postby ShadowHunter » Sun May 21, 2006 4:53 pm

Hi AncientRein,

Glad you like it... never thought so many people would find it useful :D

The fact it keeps on shaking might be due to the timers don't get a change to reset themself in a fashioned way... not sure though... I will try to reproduce it... it can be solved by setting the repeat property of the 0.05 timer to false. You can also use a global variable to count how many times the screen may shake... the sky is the limit when coding :D

Thanks for your feedback,

Kind regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Mystery » Mon Jul 31, 2006 2:01 am

It is very useful :D
I just used it for my new game that I finished a couple of days ago. This gave me a new possibility to make a puzzle for players how to get out of a house with the stairs destroyed after an explosion.

I wanted to add a second explosion at a later time in the game but realised that the background frame of the first explosion was displayed. As I couldn't solve this problem, I gave up the idea of a second explosion.
I think this is similar to what you already described for the case that a hotspot is clicked more than once, right?

But this is no problem at all as I just chose an irritating sound for the second issue instead of a second explosion.

And I will use this Earth Quake effect also in future. So thanks again for making it ShadowHunter :)
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby ShadowHunter » Mon Jul 31, 2006 12:08 pm

Hi Mystery,

I'm glad you like it :D

It is perfectly possible to load a new picture in the control. You can also delete first control and create another one. No problem :wink:

Kind regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

It isn't even in a wav. movie file

Postby bunny survival » Fri Mar 09, 2007 7:31 pm

how do you run the movie if it ain't even in a wav. file????
YAY!a good website which helps with adventure maker:

www.junktrader.tk
bunny survival
New Member
 
Posts: 1
Joined: Fri Mar 09, 2007 4:10 am

Postby ShadowHunter » Fri Mar 09, 2007 8:49 pm

Hi,

Which movie do you mean ?

Kind regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Dalton » Fri Mar 14, 2008 4:40 pm

Hi everybody, i?m back :D
Well, that?s a great effect but i?m trying to use it in my game, and the following error message appears:

"type mismatch: ?Shake`

I?m trying to use this effect without clicking in the image.
Dalton
Expert Member
 
Posts: 329
Joined: Fri Nov 16, 2007 1:17 am
Location: BRAZIL

Postby Lyberodoggy » Fri Mar 14, 2008 4:54 pm

You 've got to copy/paste the VBS procedures listed in the demo to your game's procedures first...
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Dalton » Fri Mar 14, 2008 5:01 pm

I?ve already done this, but when i click in apply, the same message appears...


Lyberodoggy wrote:You 've got to copy/paste the VBS procedures listed in the demo to your game's procedures first...
Dalton
Expert Member
 
Posts: 329
Joined: Fri Nov 16, 2007 1:17 am
Location: BRAZIL

Postby Lyberodoggy » Fri Mar 14, 2008 5:05 pm

The message you get means the engine hasn't found the requested function or the function's values are not properly set... Are you sure you 've pasted the procedures? (not the code in the "Advanced", but this one:
Code: Select all
Sub Shake(ImageToShake,Duration)

   'PictureBox(0)will hold the image to shake While PictureBox(1) will have a black background
   '------------------------------------------------------------------------------------------

   LoadControl PictureBoxObject(0)   
   LoadControl PictureBoxObject(1)      
   
   PictureBoxObject(0).Top = 0
   PictureBoxObject(0).Left = 0   
   PictureBoxObject(0).Height = GetProjectHeight * 15
   PictureBoxObject(0).Width = GetProjectWidth * 15
   PictureBoxObject(0).Picture = LoadPicture(Action.GetPath + ImageToShake)   

   PictureBoxObject(1).Top = 0
   PictureBoxObject(1).Left = 0      
   PictureBoxObject(1).Height = GetProjectHeight * 15
   PictureBoxObject(1).Width = GetProjectWidth * 15
   PictureBoxObject(1).BackColor = &H00000000&

   PictureBoxObject(0).ZOrder(0)
   PictureBoxObject(1).ZOrder(1)

   PictureBoxObject(0).Visible = True
   PictureBoxObject(1).Visible = True

   'To adjust the shake speed adjust time 0.05 value
   '------------------------------------------------

   Action.CreateTimedEvent 0.05, "ShakeImage", True
   Action.CreateTimedEvent Duration, "StopShaking", False
   
End Sub

Sub ShakeImage
   'To adjust the shake movement change the -20 value, LEFT and TOP can have a different value
   '------------------------------------------------------------------------------------------

   Randomize
   PictureBoxObject(0).Top = int(rnd*(-20))*15
   PictureBoxObject(0).Left = int(rnd*(-20))*15

End Sub

Sub StopShaking

   'When additional timers are used on the frame adjust the RemoveTimedEvent accordingly
   '------------------------------------------------------------------------------------

   Action.RemoveTimedEvent 1
   PictureBoxObject(0).Visible = False
   PictureBoxObject(1).Visible = False
   Action.UnloadControl PictureBoxObject(0)   
   Action.UnloadControl PictureBoxObject(1)

End Sub
)
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Dalton » Fri Mar 14, 2008 7:21 pm

Yes, i used the copy/paste with this code but the problem didn?t changed. I had to unistal and install again the AM, and now is working. :D

Lyberodoggy wrote:The message you get means the engine hasn't found the requested function or the function's values are not properly set... Are you sure you 've pasted the procedures? (not the code in the "Advanced", but this one:
Code: Select all
Sub Shake(ImageToShake,Duration)

   'PictureBox(0)will hold the image to shake While PictureBox(1) will have a black background
   '------------------------------------------------------------------------------------------

   LoadControl PictureBoxObject(0)   
   LoadControl PictureBoxObject(1)      
   
   PictureBoxObject(0).Top = 0
   PictureBoxObject(0).Left = 0   
   PictureBoxObject(0).Height = GetProjectHeight * 15
   PictureBoxObject(0).Width = GetProjectWidth * 15
   PictureBoxObject(0).Picture = LoadPicture(Action.GetPath + ImageToShake)   

   PictureBoxObject(1).Top = 0
   PictureBoxObject(1).Left = 0      
   PictureBoxObject(1).Height = GetProjectHeight * 15
   PictureBoxObject(1).Width = GetProjectWidth * 15
   PictureBoxObject(1).BackColor = &H00000000&

   PictureBoxObject(0).ZOrder(0)
   PictureBoxObject(1).ZOrder(1)

   PictureBoxObject(0).Visible = True
   PictureBoxObject(1).Visible = True

   'To adjust the shake speed adjust time 0.05 value
   '------------------------------------------------

   Action.CreateTimedEvent 0.05, "ShakeImage", True
   Action.CreateTimedEvent Duration, "StopShaking", False
   
End Sub

Sub ShakeImage
   'To adjust the shake movement change the -20 value, LEFT and TOP can have a different value
   '------------------------------------------------------------------------------------------

   Randomize
   PictureBoxObject(0).Top = int(rnd*(-20))*15
   PictureBoxObject(0).Left = int(rnd*(-20))*15

End Sub

Sub StopShaking

   'When additional timers are used on the frame adjust the RemoveTimedEvent accordingly
   '------------------------------------------------------------------------------------

   Action.RemoveTimedEvent 1
   PictureBoxObject(0).Visible = False
   PictureBoxObject(1).Visible = False
   Action.UnloadControl PictureBoxObject(0)   
   Action.UnloadControl PictureBoxObject(1)

End Sub
)
Dalton
Expert Member
 
Posts: 329
Joined: Fri Nov 16, 2007 1:17 am
Location: BRAZIL

Postby Lyberodoggy » Fri Mar 14, 2008 7:53 pm

aww... Could a wrong installation be connected to that problem? Anyway it's working now...
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Dalton » Sun Mar 23, 2008 12:27 am

Thanks for the tips Lyberodoggy :D

Lyberodoggy wrote:aww... Could a wrong installation be connected to that problem? Anyway it's working now...
Dalton
Expert Member
 
Posts: 329
Joined: Fri Nov 16, 2007 1:17 am
Location: BRAZIL

Postby mercedes » Sat Aug 16, 2008 6:04 am

I hope its ok I post here..seems fit for it..:? Just let me know if its not ok please..:)

Is there any way i can use this feature for a hotspot..as opposed to an entire frame..? ..I have tried adjusting the picture boxes..to no avail...:( Was hoping that this could be done...:) Thanks~

Peace~
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Sat Aug 16, 2008 7:53 pm

It would be difficult...
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Next

Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

cron