Difference between revisions of "How To Disable Interaction Without Hiding the Cursor (h2)"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "{| class="ts" style="width:100%" |- ! style="text-align:left" | Name !! style="text-align:left;width:10%" | By |- | Disable Interaction Without Hiding the Mouse Cursor (interf...")
 
Line 11: Line 11:
 
== Tutorial  ==
 
== Tutorial  ==
 
One of the first things I did was create a transparent image file the size of the default game resolution (1920x1080 in my case) & then I created a semi-transparent version of my default mouse cursor - you can create a custom cursor to indicate loading/inactive state if you prefer.
 
One of the first things I did was create a transparent image file the size of the default game resolution (1920x1080 in my case) & then I created a semi-transparent version of my default mouse cursor - you can create a custom cursor to indicate loading/inactive state if you prefer.
 +
 +
After you've done sorting out those images, open up the interface section of the editor & create a new interface. Now open up the properties for the interface & assign the image with the transparent background you created to the background image section. Tick the '''show interface permanently''' option & set displacement to '''absolute'''. Don't forget to set the class to something like '''miscellaneous'''. & that's it for that, you can now feel free to close the properties tab.
  
 
{| class="ts"
 
{| class="ts"
 
|-
 
|-
| ''Quick note: You may also want to create a temporary image the same size of your game default resolution with a solid color as it makes it easier to draw the interface area when you can see exactly what you are working with.''
+
| ''Quick note #1: You may also want to create a temporary image the same size of your game default resolution with a solid color as it makes it easier to draw the interface area when you can see exactly what you are working with.''
 +
|-
 +
| ''Quick note: #2: You can create custom classes for interfaces with the explorer tool (ctrl/⌘ + e). I think we need to create documentation for the explorer tool, sorry for the inconvenience.''
 
|}
 
|}
 
After you've done sorting out those images, open up the interface section of the editor & create a new interface. Now open up the properties for the interface & assign the image with the transparent background you created to the background image section. Tick the show interface permanently option & set displacement to absolute. Now close the properties tab.
 
 
  
 
[[File:diwhc_1.png|800px]]
 
[[File:diwhc_1.png|800px]]
  
blah blah blah...
+
Next you will be wanting to select the create and edit interface area button & then draw around the outer edges of your interface background. It should be approx. the same size as your default game resolution or greater. ''I recommend you use a temporary background image with a solid color to make it easier to draw around - if you do, then don't forget to set it back to the transparent background after you have finished setting the interface area.''
  
 
[[File:diwhc_2.png|800px]]
 
[[File:diwhc_2.png|800px]]
  
{| class="ts"
+
Now navigate over to the characters section of the editor, then navigate to the interfaces tab of your playable character & assign the new interface you have created to them otherwise it will not show up when the game is running.
|-
 
| ''Quick note: In Visionaire Studio we can force which animation frames of an animation can be played by defining the initial & end frame using AnimationFirstFrame & AnimationLastFrame.''
 
|}
 
  
The little script above randomly generates a number between 1 & 20 & if the number is less than 13 then it will only play the idle part of the animation but if it equals 13 or more then it will play the idle part of the animation & then the blink part of the animation. This means that there is a 7 out of 20 chance that the character will blink at the end of the idle animations loop cycle.
+
[[File:diwhc_2.png|800px]]
 
 
Pretty straightforward, no?
 
 
 
{| class="ts"
 
|-
 
| ''Quick note: In Visionaire Studio we can force which animation frames of an animation can be played by defining the initial & end frame using AnimationFirstFrame & AnimationLastFrame.''
 
|}
 
 
 
[[File:blink_screen_code.png|800px]]
 
 
 
 
 
== Tutorial #2: Double Blink ==
 
Same principal as [[#Tutorial #1: Single Blink|Tutorial #1]] except this time we will be adding some additional frames to the end of the animation, so that the character blinks twice, though technically I suppose you could also use a value, force the animation to play the blink frames only & increment or decrement the value until the value = 0 then force it back to the initial animation frame - ''actually now that I think about it, this would be a much better method as you can get a lot more creative with the amount of times the character consecutively blinks, but we'll delve into that at some other point in the future.''
 
 
 
Right, so again, you need to begin by attaching enough blink animation frames to the end of each of your idle animations to allow your character to be able to blink twice in a row & then what you are going to do is edit the first frame & create an execute a script action part inside of the actions area for said animation frame. It should contain something along the lines of this...
 
<syntaxhighlight>
 
blink = math.random(60)
 
 
 
if blink < 40 then
 
ActiveAnimations["animation_name"].AnimationLastFrame = 16 -- no blink
 
elseif blink >= 40 and < 50 then
 
ActiveAnimations["animation_name"].AnimationLastFrame = 21 -- single blink
 
else
 
ActiveAnimations["animation_name"].AnimationLastFrame = 27 -- double blink
 
end
 
</syntaxhighlight>
 
... again, the "animation_name" should be changed to the actual name of the animation you have added the little script to, & the AnimationLastFrame values should reflect the amount of frames you have used for idle, single blink & total. ''Remember to take into consideration that animation names are case sensitive.''
 
  
<html><img src="https://wiki.visionaire-tracker.net/images/3/33/Dynamic_blink_(2).gif" width="100%"/></html>
 
  
 
== Resources ==
 
== Resources ==

Revision as of 15:02, 18 April 2017

Name By
Disable Interaction Without Hiding the Mouse Cursor (interfaces, action parts, Lua) AFRLme


This tutorial shows you how to manually disable player interaction for events without using begin/end cutscene or show/hide cursor action parts. It also shows you how you could prevent the automatically triggered cutscene event whenever a display text / narration text action part is executed.


Tutorial

One of the first things I did was create a transparent image file the size of the default game resolution (1920x1080 in my case) & then I created a semi-transparent version of my default mouse cursor - you can create a custom cursor to indicate loading/inactive state if you prefer.

After you've done sorting out those images, open up the interface section of the editor & create a new interface. Now open up the properties for the interface & assign the image with the transparent background you created to the background image section. Tick the show interface permanently option & set displacement to absolute. Don't forget to set the class to something like miscellaneous. & that's it for that, you can now feel free to close the properties tab.

Quick note #1: You may also want to create a temporary image the same size of your game default resolution with a solid color as it makes it easier to draw the interface area when you can see exactly what you are working with.
Quick note: #2: You can create custom classes for interfaces with the explorer tool (ctrl/⌘ + e). I think we need to create documentation for the explorer tool, sorry for the inconvenience.

Diwhc 1.png

Next you will be wanting to select the create and edit interface area button & then draw around the outer edges of your interface background. It should be approx. the same size as your default game resolution or greater. I recommend you use a temporary background image with a solid color to make it easier to draw around - if you do, then don't forget to set it back to the transparent background after you have finished setting the interface area.

Diwhc 2.png

Now navigate over to the characters section of the editor, then navigate to the interfaces tab of your playable character & assign the new interface you have created to them otherwise it will not show up when the game is running.

Diwhc 2.png


Resources

Name Description
- N/A