Loding Path File Using Variable

For questions about using Classic.

Post » Wed Nov 17, 2010 9:37 pm

Hi,

One more question: I would like to load a path file from file like this "paths/path[color=#FF0000:2ervpop7]X[/color:2ervpop7]" where [color=#FF0000:2ervpop7]X[/color:2ervpop7] is a Variable. How to separate variable from normal text?

Thx
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910

Post » Wed Nov 17, 2010 9:46 pm

Ampersand is your friend.
paths\&"pv"
Image Image
B
161
S
48
G
90
Posts: 7,350
Reputation: 66,755

Post » Wed Nov 17, 2010 9:54 pm

thanks

I've bumped in to one more issue. What i would like to do is to make a choice of movements for enemies. I went with:

[code:3ofd8gs1]
--If var = 1 then path movement
--if var = 2 then bullet mov
--if var = 3 then rts mov[/code:3ofd8gs1]

The problem i have is that all of same enemies are being given change of movement and not only one, so i wander how to call only a single sprite?

PS. It's funny thought that in prototype where coding was much more chaotic everything worked as it should and now when I'm cleaning it up towards beta it's not ;)
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910

Post » Wed Nov 17, 2010 10:14 pm

You have to figure a way to pick that sprite, then compare.
Something like:
>-distance(friendly.x,friendly.y,enemy.x, enemy.y) <50
Image Image
B
161
S
48
G
90
Posts: 7,350
Reputation: 66,755

Post » Wed Nov 17, 2010 11:14 pm

[quote="newt":4a97y7uz]Ampersand is your friend.
paths\&"pv"[/quote:4a97y7uz]
That how it should work?
"paths/path\&global('EPM')"


Thanks for hlep!
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910

Post » Wed Nov 17, 2010 11:30 pm

Pretty sure it should be all back slashes, and unless you have the file type included in the variable name you'll need another &.filetype.
Image Image
B
161
S
48
G
90
Posts: 7,350
Reputation: 66,755


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests