[Solved] How do I - Set angle of Motion to specific UID

Get help using Construct 2

Post » Tue Jul 28, 2015 3:01 am

I wan't to set the angle of a bullet to a specific sprite who's variables match up with a specific global variable. is there a way I can control this in a string?

I have "Bullet angle of motion = (sprite.x, sprite.y) degrees,

but is there a way I can incorporate a specific sprite?

What I mean is, in the condition I have

"System = Pick sprite where sprite = GlobalVarUID" But I assume this does not exactly help, since the bullet angle does not go to the sprite who's UID is equal to the Global Variable UID.

Is there a way I can type out "sprite.UID=GlobalVarUID.x" or something along those lines?

https://www.dropbox.com/s/rrljw4fp7ri8y ... .capx?dl=0
Last edited by SwatHound on Tue Jul 28, 2015 4:27 pm, edited 2 times in total.
B
6
S
2
Posts: 60
Reputation: 1,242

Post » Tue Jul 28, 2015 3:19 am

Theres a condition to Pick By Unique ID
B
47
S
14
G
7
Posts: 603
Reputation: 8,141

Post » Tue Jul 28, 2015 3:58 am

Ah, yes thank you, but I was hoping more for a way to set the angle of motion by mouse click to the target who's UID is whichever the one that the system holds in it's global variable at the moment.

Basically I have this bullet and I need it to collide with the sprite but the bullet is launched at the target who has the same UID as the Global UID Variable - is what I would like to happen.

The pick by unique id would require me to memorize each sprites id, or atleast check in the layout sheet each time I would have to change it, and with constantly spawning and destroyed sprites I don't think I could manage that all too well.

I was more hoping for a lesson on "This is what you should be typing in" if what I wanted is even possible.

I am able to have the system pick by comparison, the sprite's UID = GlobalVarUID, yes, but I don't know how if at all possible to make the bullet angle towards that very same UID.

I thought by having that condition, the following action "Set bullet angle towards sprite.x, sprite.y", the sprite in question would be the same one that the condition picked.
B
6
S
2
Posts: 60
Reputation: 1,242

Post » Tue Jul 28, 2015 4:10 am

B
6
S
2
Posts: 60
Reputation: 1,242

Post » Tue Jul 28, 2015 8:06 am

in your example delete

bullet - set bullet angle of motion to ...etc

and replace with

bullet - set angle towards (target.x,target.y)

(at the moment all you are doing is setting the bullet angle to 2,3,4 or 5 degrees (ie the uid of the chosen target))
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Tue Jul 28, 2015 10:16 am

you might, or might not, find this interesting ...

https://db.tt/CO7u9EGX

beta r210
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Tue Jul 28, 2015 4:21 pm

Thanks @RamPackWobble , that definitely was interesting to watch, pretty mesmerizing.

I think this is pretty damn close to exactly what I needed, reading over your notes now, thanks a lot!
B
6
S
2
Posts: 60
Reputation: 1,242


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests