SHINESPAAAAAARK

Get help using Construct 2

Post » Thu Nov 27, 2014 4:50 pm

I'm making a game about hexagons. There's a group called "People" which contains every hexagon, and they have their UIDs and an instance variable "faction", and each faction is a number, not a string. There's also a grid called FactionRelations, where each faction has an x value and a y value. For example, faction 2 is outlaws, and faction 0 is commoners. Then, to make them hit each other, I set the grid's coordinates X2 and Y0 to "hostile" (1 in my case), making them able to attack each other.
And I did that: I have an event that sets the values X0Y2 and X2Y0 to 1. And, people attack each other with projectiles. So, when the player character is creating a projectile, it spawns it, sets the projectile's NPCUID variable to its own UID. There's also a second event, "Projectile: On created", which sets its faction variable to the faction value of the NPC that spawned it. And it knows which NPC it should set itself to, because it picks the People object whose UID is equal to its NPCUID variable. Well, that doesn't work. The player's faction is 2, but he can hurt himself with the projectile, and can't hurt others (a beautiful metaphor for the life of a criminal in a perfect utopia, but I still have to do a game). So I did an event that sets the Sword projectile's frame to its faction variable. Turns out that it's 0, not 2. So I screwed around, and, turns out the event where the NPCUID is taken from the Player works, but not the "On created" one. So, I disabled the picking event. It worked, the faction is 2, you can hurt people to your heart's content. However, the Sword does that because it has no specific People object to get its variables from, so it just chooses the first People object ever created, which is the player. But I want the NPC to be able to use weapons, too, and do that according to THEIR OWN faction and will instead of the players. So, what exactly happened here? The events are in the Common Sense and the Shooting groups, or may be in no group at all. There's not that many events so I'm not bothering to give a screen right now.
You do not have the required permissions to view the files attached to this post.
Last edited by fassFlash on Fri Dec 05, 2014 4:32 pm, edited 1 time in total.
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,377

Post » Fri Nov 28, 2014 3:59 pm

Bah-bumparoo
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,377

Post » Sun Nov 30, 2014 2:36 pm

Bump
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,377

Post » Sun Nov 30, 2014 5:59 pm

Bomb
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,377

Post » Mon Dec 01, 2014 8:39 pm

Pumb
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,377

Post » Tue Dec 02, 2014 7:20 pm

Uhm
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,377

Post » Fri Dec 05, 2014 4:31 pm

THREE..
TWO..
ONE...

BUMP ROCKET LAUNCHING
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,377


Return to How do I....?

Who is online

Users browsing this forum: dop2000, LogoGuy2017 and 29 guests