How do I "Create Object (By Name)"

Get help using Construct 2

Post » Thu Jun 02, 2016 10:47 am

Is there a way to create a sprite by using the name of the sprite, like how layouts can be called by name? (I'm using Rex's CSV Plugin to make a dialogue system and, when a character is talking, I want to have a sprite of them onscreen). Effectively:

    When Text = "sprite_alice"
    • Create sprite "sprite_alice"
Is there any way to do this currently?
B
16
S
5
G
4
Posts: 29
Reputation: 3,100

Post » Thu Jun 02, 2016 11:42 am

there is no current C2 expression create object by name... however you dont actually need it... you can add a variable and say

When Text = "sprite_alice"
set variable to 1

triggeronce
variable=1

create alice at x y

When Text = "sprite_john"
set variable to 2

triggeronce
variable=2
create john at x y
B
70
S
20
G
67
Posts: 1,314
Reputation: 42,301

Post » Thu Jun 02, 2016 12:14 pm

Okay, that's a pretty simple workaround. I can see that getting quite complex quite quick with an RPG with a lot of characters, though, keeping track of all those numbers...

EDIT: Just remembered that variables don't have to be numbers, and that text variables is a thing that exists. Thanks for your help! ^_^
B
16
S
5
G
4
Posts: 29
Reputation: 3,100

Post » Thu Jun 02, 2016 1:02 pm

I suppose you already checked this out .
plugin-nickname-behavior-nickname_t74522
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests