How do I trigger once ?

Get help using Construct 2

Post » Tue Mar 08, 2016 4:19 pm

its been a whole while again and i cant remember how that worked.
ive got this code :

Image

As you can see a typewriter function should be triggered and executed till the end once the player collides with an certain sprite.
however it doesnt work at all , but when i choose something else like "while keyboard_key "1" is down" it works
B
27
S
7
G
3
Posts: 299
Reputation: 4,551

Post » Tue Mar 08, 2016 4:26 pm

See that green arrow? That means it's a trigger once. This will override the every tick you have just below it. The keyboard works because it's effectively triggering a repeated state of on and off.

Perhaps you should use a boolean instead, and have it triggered on. Then, when it's on, run event 16.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
79
S
12
G
7
Posts: 961
Reputation: 10,717

Post » Tue Mar 08, 2016 4:30 pm

AnD4D wrote:See that green arrow? That means it's a trigger once. This will override the every tick you have just below it. The keyboard works because it's effectively triggering a repeated state of on and off.

Perhaps you should use a boolean instead, and have it triggered on. Then, when it's on, run event 16.

Thanks alot, also this means ill have a extra bool variable for every text i want to display but its something.
Btw heres how it worked for me now : Image


Also how can i check if the text is displayed completely ?
B
27
S
7
G
3
Posts: 299
Reputation: 4,551

Post » Tue Mar 08, 2016 4:37 pm

Just so you know, you don't ever need to use Every Tick. It's just there so people can see it. Take it out, and you'll see it makes no difference.

Put your add 1 in the collision. Remove the bool, change the bool condition to 'If var_global_txt_counter is greater than 0'.

Saves you a global variable.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
79
S
12
G
7
Posts: 961
Reputation: 10,717

Post » Tue Mar 08, 2016 4:38 pm

Sorry, missed your last question.

Have an invisible text object that contains the finished text. If spritefont = text.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
79
S
12
G
7
Posts: 961
Reputation: 10,717

Post » Tue Mar 08, 2016 4:50 pm

AnD4D wrote:Sorry, missed your last question.

Have an invisible text object that contains the finished text. If spritefont = text.


Lol easy ! : )

btw , i thought about having one Spritefont in the middle of my screen to display all dialogue texts i want.
But then , i have different objects in the game that should trigger different texts.

howd you manage this with typewriting ?
B
27
S
7
G
3
Posts: 299
Reputation: 4,551

Post » Tue Mar 08, 2016 5:09 pm

by the way, thats how i managed to do it :

Image

its a bit messy but it brings results =

Image
B
27
S
7
G
3
Posts: 299
Reputation: 4,551


Return to How do I....?

Who is online

Users browsing this forum: sublimate and 2 guests