Announcement: Why not try our official idea generator for inspiration when making puzzles?


Caravel Forum : DROD Boards : Architecture : Question about scripted moving images
New Topic New Poll Post Reply
Poster Message
robin
Level: Smitemaster
Avatar
Rank Points: 842
Registered: 09-01-2004
IP: Logged
icon Question about scripted moving images (0)  
I want to script something like The Second Sky : Chronometric Sanctum : Entrance

So when a certain var is OK the image should "move", like this one starts spinning.

I know I need an image whith all seperate part's of the spinning.
But I don't know how to use the "image overlay" properly to get it done.


____________________________
Click here to view the secret text

05-04-2016 at 11:45 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
uncopy2002
Level: Smiter
Rank Points: 431
Registered: 07-28-2014
IP: Logged
icon Re: Question about scripted moving images (0)  
You can always specify a layer to put the image on with an additional Layer command (for your purpose, you also need to use Rotate), and then use CancelLayer to remove it before repeat this process. In this way you don't need to worry about when to remove the image, and also you can place images beneath the player.

So it's like this:

DisplayTurns x
Layer 0
Rotate theta t

where x is the number of turn for that animation, and theta and t are the angle (in degrees) and duration of the spin.
05-04-2016 at 01:06 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
robin
Level: Smitemaster
Avatar
Rank Points: 842
Registered: 09-01-2004
IP: Logged
icon Re: Question about scripted moving images (0)  
Thanks for the response, but that isn't actually what I'm looking for.
It probably will be usefull someday, so I'm gonna remember this.

I was more thinking to use the "DisplayRect" script

____________________________
Click here to view the secret text


[Last edited by robin at 05-06-2016 11:00 AM]
05-05-2016 at 08:19 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
robin
Level: Smitemaster
Avatar
Rank Points: 842
Registered: 09-01-2004
IP: Logged
icon Re: Question about scripted moving images (0)  
After some scripting around, I'm confused.
  Set var "TimeTY" = 0
  Set var "TimeTX" = 0
  Set var "TimeTW" = 110
  Set var "TimeTH" = 110
  Set var ".tempx" = _MyX * 22
  Set var ".tempy" = _MyY * 22
  Image overlay 27820,setx $.tempx$ sety $.tempy$ layer 1 displayrect $TimeTX$ $TimeTY$ $TimeTW$ $TimeTH$ fadetoalpha 128 1000 fadetoalpha 255 1000 loop -1

This script works, but as soon as I delete "fadetoalpha", it's doesn't show my picture anymore, adding "setalpha 255" doesn't do the trick either.

What am I missing and what does the " setx $.tempx$ sety $.tempy$ " do?

____________________________
Click here to view the secret text

05-06-2016 at 10:59 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
uncopy2002
Level: Smiter
Rank Points: 431
Registered: 07-28-2014
IP: Logged
icon Re: Question about scripted moving images (+1)  
setx and sety sets the origin of the image you want to show from the top-left corner of the room, in pixels. Since each tile is 22x22 pixels big, you set the x/y pixel coordinate as so.


Have you tried adding a Display command? It's in the example inside the help files:

As an example, you can make an image start invisible, fade in, display for a couple seconds, then fade out by providing the following command sequence:

setalpha 0 fadetoalpha 255 1000 display 2000 fadetoalpha 0 800
05-06-2016 at 01:24 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Architecture : Question about scripted moving images
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.