EarthQuake Demo

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

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

EarthQuake Demo

Postby mercedes » Mon Jun 13, 2011 9:26 am

Hi there..:)

This post here...

http://www.adventuremaker.com/phpBB2/viewtopic.php?t=1851&postdays=0&postorder=asc&highlight=earthquake&start=0

...Can the earthquake be called from a hotspot..used in script?
If i remember correctly..You could only call it from the frame's advanced right..? I don't want to download it..to find out i can't..:(..

It would be handy if you could...You could simulate slamming doors..or drawers....or...u know.. walls falling..[which is what i need it for..lol..]
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby reneuend » Mon Jun 13, 2011 12:39 pm

You can call it from a hotspot, but you can't have it the earthquake efffect occur on the hotspot. It works on the whole frame.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Mon Jun 13, 2011 11:49 pm

reneuend wrote:You can call it from a hotspot, but you can't have it the earthquake efffect occur on the hotspot. It works on the whole frame.


Ya that would be fine...If it happens on the whole frame...

However can u call it...when you want though in the hotspot..[Is what i should have asked.]

I want it to only shake...if something happens..[with a condition..]..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby reneuend » Tue Jun 14, 2011 12:30 am

I'll test it and let you know! :-)

LOL! The demo that ShadowHunter uses a hotspot over the whole frame! So, yes, hotspots are in...now you said a condition...let me check.

yes, you can put a condition on it. Here is the call that ShadowHunter used:

Code: Select all
'Define the image you want to load and set the duration of shaking in seconds
'The image file must be located in the External folder
'
'Syntax:
'
'Shake "FILENAME", TIME_TO_SHAKE(S)
'-----------------------------------------------------------------------------

Shake "Library.jpg", 6



so, you could put,
Code: Select all
If myVar = 1 then
    Shake "Mercedes.jpg", 3
end if
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Tue Jun 14, 2011 1:11 am

Oh that's excellent!...Thanks for testing it!~ I can hardly wait to see how it works again..I only remembered using it from the frame's advanced..I couldn't picture it in the hotspot at-all..

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

Postby Lyberodoggy » Tue Jun 14, 2011 1:17 am

If I remember correctly though, the code uses a pictureboxobject, which (if I also remember correctly) can't be moved to any position other than 0,0 therefore it can't adapt to the hotspot's coordinates
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Tue Jun 14, 2011 2:50 am

yes i remember now...I'll most likely see a black frame around the hotspot..

Which is why i remember using it in the frame's advanced only..I tried it with a hotspot...it didn't do well cause of the pictureboxobject..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby reneuend » Tue Jun 14, 2011 3:26 am

I thought you wanted it triggered by the hotspot not that the effect had to occur in the hotspot. Isn't that what you said?


mercedes wrote:
reneuend wrote:You can call it from a hotspot, but you can't have it the earthquake efffect occur on the hotspot. It works on the whole frame.


Ya that would be fine...If it happens on the whole frame...

However can u call it...when you want though in the hotspot..[Is what i should have asked.]

I want it to only shake...if something happens..[with a condition..]..
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Tue Jun 14, 2011 5:01 am

Yes..I do want to trigger it with the hotspot..
But because of the hotspot being on the same frame it shakes....


I tried this once in a hotspot..and that's what happened to me..[black frame appeared around it..or behind it..]

The reason why i used it in the frame's advanced is because of the blackframe that appeared around it...


**************
Although is that how you tested it Bob......On a small hotspot..Similar to the button sequence puzzle..I wondered that..



Hotspot..there's another word..I can barely spell fast..Usually comes off as hotpost..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby reneuend » Tue Jun 14, 2011 5:50 am

I guess I just don't understand. I just want to make sure that you aren't giving up on something that might work.

I think the reason it worked for me is because the small hotspot I used on the frame was transparent. So, when it shaked, it didn't have the black frame issue. Could you do something similar? Does the hotspot have to be an image or can it just be transparent?
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Tue Jun 14, 2011 6:10 am

No.. there is a picture in it...:(

I had 2 ideas...

Take my symbol puzzle for example..; When the sequence was entered..the room would shake..

Then when they went to the next frame..The wall would be down..or door would be open..

I also thought to put it in the TEXTBox [i]enter[/i] button...on the very last frame..It is just a hotspot..but there is a pic in it...

Anything that I want to do..is almost never simple...lol
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby juhuwoorps » Tue Jun 14, 2011 6:45 am

Mercedes, do you have tried the earthshake by yourself?
I think the black frame just appears with transparetn gifs.

I dont have tested this plugin, so I'm not sure.

If you want to have a shake when the puzzle is done, just call the earthquake sub in your code when the puzzle is done.

To have a opend door when going to next frame, you can either go to a other frame with the opend door, or set a variable and load another background picture to frame you want to go if the var is set to 1.
juhuwoorps
Code Master
 
Posts: 622
Joined: Tue Jul 08, 2008 3:13 pm

Postby juhuwoorps » Tue Jun 14, 2011 7:43 am

If you just want to shake only a hotspot, I have figured out some code based on Shadowhunters code.

Here's the code for the subs:

Code: Select all
sub InitializeHS_Shake (duration)
ycor=hotspot(1).top
xcor=hotspot(1).left

timedevent=0
Text(1)=duration
timedevent=Action.CreateTimedEvent ((0.05), "ShakeHS", True)
Action.CreateTimedEvent duration, "StopShake 0", False
End Sub

sub ShakeHS
Randomize
Hotspot(1).Top = ycor + int(rnd*(5))*15
Hotspot(1).Left = xcor + int(rnd*(5))*15

End Sub

sub StopShake (duration)


Action.RemoveTimedEvent timedevent
Hotspot(1).top=ycor
Hotspot(1).left=xcor


End Sub


If you want to have a shake, just call the sub from frame properties, hotspotproperties or from your own script with this little code.

Code: Select all
InitializeHS_Shake 3


The number is the time in seconds how long the shake will be run.

you have also to register 3 vars called xcor and ycor and timedevent.

Hope this is a bit helpful for you.

Edit: I have edited the code above. The first code just has allowed to run the shake once a time. at a second time the shake doesn't stop
juhuwoorps
Code Master
 
Posts: 622
Joined: Tue Jul 08, 2008 3:13 pm

Postby reneuend » Tue Jun 14, 2011 1:34 pm

Thanks for taking the time to do this Juhu! This could bring about some interesting games! :-)
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Wed Jun 15, 2011 4:27 am

That's excellent Juhu!..Thank you!!...:D..


EDIT - 1

Can i simply take out this part Juhu..;

Text(1) = Duration ?
Making TEXT transparent..doesn't work..

-----------------
EDIT - 2

Just call the sub from frame properties, hotspot properties or from your own script with this little code.


I called it from the Hotspot within the condition I had set..

When i put it into the Frame's Properties...
It changes the TEXT on the frame...to 3 --The initialization time..

But it's not shaking..either way..:(

I'm assuming you didn't use the plugin.. right... or did you...?
Shadow's code..didn't require the plugin..which is why I ask..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby reneuend » Wed Jun 15, 2011 11:17 am

I tried it also and its not working. The code looks correct.

You don't need the Text objects. That was just for testing.

I'll keep playing with this to try to get it to work. Meanwhile, I changed the procedures so the hotspot index wasn't hard-coded. When you call InitializeHS_Shake using the procedures below you will pass in the hotspot index as well as the duration.

Code: Select all
InitializeHS_Shake 1, 3




procedures:
Code: Select all
sub InitializeHS_Shake (hs_index,duration)
  ycor=hotspot(hs_index).top
  xcor=hotspot(hs_index).left
  timedevent=0
  timedevent=Action.CreateTimedEvent (.05, "ShakeHS(hs_index)", True)
  Action.CreateTimedEvent duration, "StopShake hs_index, 0", False
End Sub

sub ShakeHS(hs_index)
  Randomize
  Hotspot(hs_index).Top = ycor + int(rnd*(5))*15
  Hotspot(hs_index).Left = xcor + int(rnd*(5))*15
End Sub

sub StopShake (hs_index, duration)
  Action.RemoveTimedEvent timedevent
  Hotspot(hs_index).top=ycor
  Hotspot(hs_index).left=xcor
End Sub


Of course, it doesn't matter until we get it working. :?
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby reneuend » Wed Jun 15, 2011 11:36 am

I know..double post...but this is a different thought and I didn't want it mucked up with my previous poat! :?

If you replace your sub from the code I provided above, it shows that the coordinates are changing, but the hotspot is not moving. I'm not sure why. Where is Lyberodoggy when you need him! :P

Note: Be sure to have a text object with index 1 if you plan on using the following as is.

Code: Select all
sub ShakeHS(hs_index)
  Randomize
 
  xval = xcor + int(Rnd()*(50))*15
  yval = ycor + int(Rnd()*(50))*15

  Hotspot(hs_index).Top = xval
  Hotspot(hs_index).Left = yval


  'xval = xcor + int(Rnd()*50)*15
  'yval = ycor + int(Rnd()*50)*15
  'Hotspot(hs_index).Move xval,yval

  Text(1).Caption = xval & "," & yval

End Sub
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby juhuwoorps » Wed Jun 15, 2011 11:44 am

Do you have registered the variables?
juhuwoorps
Code Master
 
Posts: 622
Joined: Tue Jul 08, 2008 3:13 pm

Postby reneuend » Wed Jun 15, 2011 11:53 am

yes. as global variables:
xcor as integer
ycor as integer
timedevent as integer
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby juhuwoorps » Wed Jun 15, 2011 12:05 pm

Here's the project folder. It works for me.
Attachments
shake_hotspot.zip
(114.28 KiB) Downloaded 327 times
juhuwoorps
Code Master
 
Posts: 622
Joined: Tue Jul 08, 2008 3:13 pm

Postby reneuend » Wed Jun 15, 2011 3:17 pm

Thanks Juhu.

I find it odd that I can't get my project working. :?
I'll start with a copy of yours and see if I can modify it to allow passing the hotspot index.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby juhuwoorps » Wed Jun 15, 2011 9:22 pm

Does my project work for you?
juhuwoorps
Code Master
 
Posts: 622
Joined: Tue Jul 08, 2008 3:13 pm

Postby reneuend » Wed Jun 15, 2011 9:58 pm

Yes. that's why I find it odd that mine doesn't work.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby juhuwoorps » Wed Jun 15, 2011 10:05 pm

That's really strange. Do you have made a own project to test it, or do you have tried it in an existing project?
juhuwoorps
Code Master
 
Posts: 622
Joined: Tue Jul 08, 2008 3:13 pm

Postby reneuend » Wed Jun 15, 2011 10:20 pm

All I did was change it so I could pass in the hotspot index. I'm going to start with yours and try to see what I missed. Odd thing is that I set it up so I could see the coordinates changing but the hotspot didn't move.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby juhuwoorps » Thu Jun 16, 2011 8:42 am

It seems that there is a problem to give the hs number to the second sub.

If you create a global variable for the hotspotnumber it works:


Code: Select all
sub InitializeHS_Shake (duration,hsnr)
ycor=hotspot(hsnr).top
xcor=hotspot(hsnr).left
shakehsnr=hsnr


timedevent=Action.CreateTimedEvent ((0.05), "ShakeHS", True)
Action.CreateTimedEvent duration, "StopShake", False
End Sub

sub ShakeHS

Randomize
Hotspot(shakehsnr).Top = ycor + int(rnd*(5))*15
Hotspot(shakehsnr).Left = xcor + int(rnd*(5))*15

End Sub

sub StopShake
Action.RemoveTimedEvent timedevent
Hotspot(shakehsnr).top=ycor
Hotspot(shakehsnr).left=xcor


End Sub



Code: Select all
InitializeHS_Shake 3,1
juhuwoorps
Code Master
 
Posts: 622
Joined: Tue Jul 08, 2008 3:13 pm

Postby reneuend » Thu Jun 16, 2011 11:54 am

That's a good alternative.
I wonder if we tried passing it as a reference instead of value if it would work.
I'll give it one more test.

Thanks for taking the time to look at this Juhu! :)
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Fri Jun 17, 2011 7:34 am

juhuwoorps wrote:Here's the project folder. It works for me.


Great!...I downloaded it.. Thanks Juhu! :D
I'm gonna try it tomorrow..I hope it works for me..If it doesn't work..It'll most likely only happen to me..so...:lol:

I"m that person who's in the scene of an accident...Calls an ambulance.. and the ambulance squeals right on past me....Missing me completely.

So if this doesn't work for me..I won't be surprised...I have the worse luck..lol..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby reneuend » Fri Jun 17, 2011 1:02 pm

Naw, if you had the worst luck, the ambulance would run you over as it was passing you by! :lol:
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Sat Jun 18, 2011 2:31 am

hey..Juhu..Did you manage to shake frame...as well from a hotspot..?

Thanks..:)

---------------------
Naw, if you had the worst luck, the ambulance would run you over as it was passing you by


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


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron