Question about script

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

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

Question about script

Postby igelkott » Tue Sep 22, 2015 8:42 pm

Hello!
I've got a little problem...I want that some multiple frames replaced each other, one after the other.
--------
Sub MyCode
If codetrigger = 1 Then Action.GoToFrame "frame1", 3, 1
Action.GoToFrame "frame2", 3, 1
Action.GoToFrame "frame3", 3, 1
End Sub
-------
- doesn't work (show only last frame "frame3"). What am I doing wrong?
igelkott
Junior Member
 
Posts: 12
Joined: Sun Dec 28, 2014 10:36 pm

Re: Question about script

Postby reneuend » Wed Sep 23, 2015 10:20 pm

You can add code to the First, Second and Third Frame's Frame Properties separately like this:
Note: You need to use the Action.CreateTimedEvent function when calling "Action.GoToFrame" from the frame properties.

Frame0:
Frame Properties - Advanced:
Code: Select all
If CodeTrigger = 1 Then
    Action.CreateTimedEvent .5, "Action.GoToFrame ""Frame1"", 3, 1",False
End If



Frame1:
Frame Properties - Advanced:
Code: Select all
If CodeTrigger = 1 Then
    Action.CreateTimedEvent .5, "Action.GoToFrame ""Frame2"", 3, 1",False
End If


Frame2:
Frame Properties - Advanced:
Code: Select all
If CodeTrigger = 1 Then
    Action.CreateTimedEvent .5, "Action.GoToFrame ""Frame3"", 3, 1",False
End If
---


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

Re: Question about script

Postby igelkott » Thu Sep 24, 2015 10:13 pm

Thank you very much for answer.
Initially, I wanted to insert a gif-animation, which consists of only 2 frames. And I thought - by the code refer to the frames in sequence 1-2-1-2-1-2-1-2..., and after go to the frame 3. In your example, one transition - one frame, and they can't be looped, am I right?
I fixed my problem by using "Gif Sequence Player v1.1" plugin (really nice thing:)).
When I create exec file from my project, the plagin will be included? Or user on another computer must to install something?
igelkott
Junior Member
 
Posts: 12
Joined: Sun Dec 28, 2014 10:36 pm

Re: Question about script

Postby reneuend » Sat Sep 26, 2015 1:53 am

It will automatically be included. No more work needed.
Good job!
---


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

Re: Question about script

Postby igelkott » Fri Oct 02, 2015 4:13 pm

Thanks, reneuend!
I've got a question about sound:
After clicking on the hotspot, the sound is played only once. How can I make a multiple sound, each time when I press the hotspot (for example, the doorbell. My OS Win7, use Sub PlaySoundWin7).
igelkott
Junior Member
 
Posts: 12
Joined: Sun Dec 28, 2014 10:36 pm

Re: Question about script

Postby reneuend » Sat Oct 03, 2015 6:53 am

I'm not at my computer at the moment, but I believe that the PlaySound routine has a parameter for repeating sounds a specified number of times. If not, then I would use the CreateTimedEvent routine. I'll explain better when I can get to my computer.
-----------------------------------------------------
Update:

The PlaySoundWin7 routine does have a repeat parameter: Sub PlaySoundWin7(SoundFile, NumRepeat, ChannelNumber)

Try this and let us know if this is what you needed..

If you want to try the CreateTimedEvent routine, it has a repeat option, but you must write code to stop the repeating or go to another frame.

Action.CreateTimedEvent X, "CODE", REPEAT
- NOTE: Timed Events are automatically removed when the user goes to another frame!!!!
---


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

Re: Question about script

Postby igelkott » Mon Dec 07, 2015 12:16 am

Ohh... The next problem:
Hotspot Properties -> Action Tab -> Display a text message.
English text displayed correctly anyway. Russian text correct in Win7, not correct in Win8.
I think it's a problem because Unicode...
What can be done to properly display Cyrillic on any computer?
igelkott
Junior Member
 
Posts: 12
Joined: Sun Dec 28, 2014 10:36 pm

Re: Question about script

Postby reneuend » Mon Dec 07, 2015 1:20 am

I have delved into this area with AdventureMaker. Let's hope someone else has an answer they will share.
If out-of-the-box AM is not giving you what you need, how about a plugin?

Can you give me an example of what you are looking for, and where it is failing? Maybe I can help.
---


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


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 2 guests

cron