Making a CRPLCORE Targetable

Started by Xeos, April 12, 2015, 08:11:11 AM

Previous topic - Next topic

Xeos

I want to make a CRPLCORE which is effectively an image that can be automatically targeted and destroyed by a spore tower, the image then flips to a destroyed version of it. Because I cant seem to find out how to do it, I have done it by cheating. I have put a unit under my image and detected when it is destroyed and then flipped the image that way (as below) But visually it doesn't work how I would like it to and it would be so much better if I could make the image targetable in the first place. Ideally, it would need a health bar too. Could someone kindly advise me please?
Thanks in advance :)

PS. I am doing this in a PAC map

$unitdetect:1
$flag:0

GetUnitCountInRange(currentcoords 2) ->unitdetect

<-unitdetect 1 lt if
<-flag 1 lt if
CreateEffect(7 CellToPixel(CurrentCoords) 1 3 3 0.02)
Self "main" "Custom1_128pp" SetImage
Self "main" 2.1 2.1 SetImageScale
Self "main" 2 SetImagePositionZ
PlaySound("Explosion6")
1 ->flag
endif
endif
A child of 5 could beat this map ... Go fetch a child of 5 !

Telanir

Could you describe what happens to the image when it goes into this 'destroyed' state? The visual problems you are experiencing might be because of the Custom1_128pp, maybe try making it just a normal 128?

When it comes to auto-targeting, the PAC spore towers are run on custom code, you would need to delve into those .crpl's to figure out a method to make spore towers automatically target it. I don't see why you would want to though because the player should typically have full control over their units (or it can get frustrating).

If you're just talking about a generic spore tower, it can't target CRPL objects as far as I'm aware.
Want to make genius CRPL? The new top map? You can start here!

Find out more about Creeper World 3 on the wiki!

CW3, The Sleeper Menace!

Own an iOS device? Check out my game Blobivers

J

A normal unit basically just checks for creeper underneath it, does that work for you?

Xeos

Thank you Telanir and J for posting :)

This is on a PAC map just so you know.

What I am currently doing is I have a wall of images ( which looks like a wall) and underneath the images are units like a collector which can be targeted by a spore tower. When the collector is destroyed I flip the image to a destroyed image in the code above and that actually works ok . But what I wanted to make was a CRPLCORE which could be targeted by a spore tower automatically ( so it would need to see the CRPLCORE as a unit it could destroy) and that is what I was looking to do. so is this not possible?

A child of 5 could beat this map ... Go fetch a child of 5 !

Tyler21

Telanir already provided the easiest solution: if you want to do this on a PAC map, simply change the script of the custom spore tower to enable it to target those specific "wall" cores. Check line 297-302 in StructureGui.crpl.
"Enjoyment appears at the boundary between boredom and anxiety, when the challenges are just balanced with the person's capacity to act."
― Mihaly Csikszentmihalyi

Check my collection of the 30 most difficult and challenging maps in Colonial Space!

Xeos

Quote from: Tyler21 on April 12, 2015, 04:40:35 PM
Telanir already provided the easiest solution: if you want to do this on a PAC map, simply change the script of the custom spore tower to enable it to target those specific "wall" cores. Check line 297-302 in StructureGui.crpl.
Thanks :) I will take a look
A child of 5 could beat this map ... Go fetch a child of 5 !