Triggering Changes Using Image Points?

For questions about using Classic.

Post » Tue Aug 09, 2011 6:22 am

Is it possible, and how, can I change image point usage during game play for upgrades? My ship has three image points. One is the default weapon. I want to grab an item that will allow me to change from using image point 1 to using points 2 and 3 (shutting off 1) to use a different weapon. I can grab the item (doing same method to grab a health pack) but not sure how to enable and disable image points, if possible.

Maybe the idea would be to make a copy of the object (the ship) using the two points, and a trigger to switch the object instead?

Thank you.
B
5
S
1
G
1
Posts: 157
Reputation: 1,219

Post » Tue Aug 09, 2011 7:57 am

no need to make a new ship
just make a private variable 'gunmode' or something
and either set it 0 or 1 for different modes
or set it to "front", "sides"
and make all your gun placement events work testing the variables first

if 'gunmode' == "front"
-------set gun position to ship.imagepoint(1)
else
-------set gun positions to ship.imagepoint(2)
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Tue Aug 09, 2011 8:20 pm

Could you tell me what action I would use? I can make it take the item and change the value, but not sure which action to use the commands to set image points.

As of now...

+ Hero: On collision between Hero and poweruplevel2
+ Hero: Value 'Weapons' Equal to 1
-> poweruplevel2: Destroy

Thank you.
B
5
S
1
G
1
Posts: 157
Reputation: 1,219

Post » Tue Aug 09, 2011 9:06 pm

Ah, I was able to figure it out.

The ship grabs the power up and change weapon state from 0 to 1:

+ Hero: On collision between Hero and poweruplevel2
-> Hero: Set 'Weapons' to 1
-> poweruplevel2: Destroy

Then I changed my SPACE PRESS from:

+ MouseKeyboard: On key Space pressed
-> System: Create object Bullet on layer 1 at (0, 0) from Hero 's image point 1
-> XAudio2: Autoplay resource "imphenzia_soundtrack_laser36.wav" (No loop)

to:

+ MouseKeyboard: On key Space pressed

+ Hero: Value 'Weapons' Equal to 0
-> System: Create object Bullet on layer 1 at (0, 0) from Hero 's image point 1
-> XAudio2: Autoplay resource "imphenzia_soundtrack_laser36.wav" (No loop)

+ Hero: Value 'Weapons' Equal to 1
-> System: Create object Bullet2 on layer 1 at (0, 0) from Hero 's image point 2
-> System: Create object Bullet2 on layer 1 at (0, 0) from Hero 's image point 3
-> XAudio2: Autoplay resource "imphenzia_soundtrack_laser36.wav" (No loop)

This was assuming point numbers (1, 2, 3) are assigned in order of creation, and not in the image point list in the picture editor (because in my list, the point 1 is at the bottom of the three points in the list).

Now I have a basic understanding. Thanks for leading me the way.
B
5
S
1
G
1
Posts: 157
Reputation: 1,219


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests