How do I multiple instances of "doors" with text

Get help using Construct 2

Post » Sat Apr 29, 2017 10:33 pm

Image

I have a trigger object which checks variables and if all are true then the bridge will lower.

My issue is, how can I add in a text object that will show up for only that trigger instance and then not show any more after the bridge is down? I tried stuff but it hid or deleted all of the text instances.

Could I add the text to a container and set its position, then when the bridge is down have it invisible or delete it?
B
15
S
8
G
2
Posts: 68
Reputation: 2,465

Post » Sun Apr 30, 2017 4:19 am

not sure if this will work but it's worth a try:

give the text object an instance variable = "drawbridge"
make a sub sub event under all that stuff in the picture
text instance variable = "drawbridge" --> set visible, wait 2 sec, set invisible

if that doesn't work try using the system pick by comparison
B
25
S
16
G
26
Posts: 125
Reputation: 16,103

Post » Sun Apr 30, 2017 4:39 am

no need for that entire sub event. you set Drawbridge.Open to 1 and then check if it's 1. No need to check if it's 1, you already knows its 1. On E pressed will only trigger once, if you are worried about spamming the 'E' key, just add Drawbridge.Open not equal to 1 in the condition.

as to how how to add text.. (you should use spritefonts - download plugin SpriteFont+ and the program GiveYourFontsMonoSpace)

-on your Text or Spritefont object, put the Fade behavior
-add an action that has Drawbridge Spawn another object.. and that object should be the text.
-set the Text to whatever you need it to be.
-make sure the fade behavior (on the text) is set to Active At Start and Destroy on fadeout.
-set the Fadeout or Wait value to be able as long as your drawbridge going down which looks to be just over 2 seconds.

so
Fade in 0
Wait 2
Fade out 0.25

or adjust as you like
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Post » Sun Apr 30, 2017 10:42 am

I got it to work as I wanted like this:

Image

I put the text into a container of the trigger object, so the text will only show when you are overlapping that object. Plus when I delete the object the text also goes with it.
B
15
S
8
G
2
Posts: 68
Reputation: 2,465


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 18 guests