Targeting Stunners

Started by Nicant, December 11, 2016, 02:53:09 PM

Previous topic - Next topic

Nicant

Alright, so im in a bit of a predicament here. I am making custom ship modules with PlanetFall's custom module guide and i do not know how to target enemy stunners. My module is like another discharger, but with a little something else. Here is a little tester to see if "GetNearestTarget" would also find stunners. I don't know if i am using the right notation or what, but it does not work.
EDIT: Do note: The tester is supposed to lower the stunners health and if the health lowers, then i would know it works.

# --Stunner Tester-- 12/11/2016 10:33:39 AM

CurrentCoords CurrentCoords 25 1 0 1 1 0 GetNearestTarget ->Target
#<-Target GetUnitIsEnemy 1 eq if
<-Target 0.25 SetUnitHealth
#endif



Any help will be appreciated! :)
CW4 hype!!

GoodMorning

I believe that Stunners are units, without virtual particles, and therefore do not interact with GetNearestTarget...

GetAllUnitsInRange and GetUnitType may be your friends.
A narrative is a lightly-marked path to another reality.

Nicant

#2
Ok, thanks i will try those out! I will let you know if they work out ok.

Edit: They strangely do not seem to interact with GetAllUnitsInRange either. I will test this further.

Edit2: As strange as it is, i don't think Stunners don't even have a UID! Here is my save for testing and notice every time a stunner passes over the PRPL core, it does not show any UID in the debug area!
CW4 hype!!

Sorrontis

I think V has some answering to do :P

Although, there's no NearestStunner command?
"If you want others to be happy, practice compassion. If you want to be happy, practice compassion."

Nicant

Or, i think my script for whatever reason keeps finding its self and nothing else. That could also be why it does not find it.
CW4 hype!!

Oblivion

#5
Stunners do have a UID Im sure

EDIT: They do, its "StunnerSpawner" if you haven't found it already.

EDIT #2: If you do successfully make a custom module I hope you wouldn't mind helping me out with mine, I dropped mine since I couldn't get it to work.
~Memes have been scientifrically proven to be the very essence of life unto itself~

GoodMorning

"StunnerSpawner" or the actual "Stunner"?

Nicant, have a look at the endgame trigger of PF's del. map, it creates Stunners.
A narrative is a lightly-marked path to another reality.

Nicant

#7
Quote from: Oblivion on December 12, 2016, 07:27:00 PM
Stunners do have a UID Im sure

EDIT: They do, its "StunnerSpawner" if you haven't found it already.

EDIT #2: If you do successfully make a custom module I hope you wouldn't mind helping me out with mine, I dropped mine since I couldn't get it to work.

Sure! When i am done i will try and help you as well! My module is not done yet though, but when it is i will try and help! :D

Quote from: GoodMorning on December 12, 2016, 09:33:43 PM
"StunnerSpawner" or the actual "Stunner"?

Nicant, have a look at the endgame trigger of PF's del. map, it creates Stunners.

I want the actual Stunner, not the spawner and i will have a look at that map! :)

Edit: I cannot seem to find that map. :P Is it an exchange map or a different map?
CW4 hype!!

Sorrontis

Have you tried to create a stunner using PRPL and see how/what that returns?
"If you want others to be happy, practice compassion. If you want to be happy, practice compassion."

Nicant

#9
Quote from: Sorrontis on December 13, 2016, 03:38:48 PM
Have you tried to create a stunner using PRPL and see how/what that returns?
Yeah, i tried doing that, but the problem is i don't know the UID for the Stunner. :P

Edit: Well when i try to make a stunner, it returns a -1 in the debug box.

Edit2: This is the code i am using to make stunners: I've tried spelling it in all caps and lowercase.

# --CHEEKY MONKEY-- 12/13/2016 3:53:59 PM

CurrentCoords "stunner" CreateUnit
90 Delay TraceAll
CW4 hype!!

Oblivion

Wasn't there a post before of someone trying to use something call a Initmissile command or something? maybe they know something about this?
~Memes have been scientifrically proven to be the very essence of life unto itself~

Sorrontis

Quote from: Nicant on December 13, 2016, 03:42:01 PM
Quote from: Sorrontis on December 13, 2016, 03:38:48 PM
Have you tried to create a stunner using PRPL and see how/what that returns?
Yeah, i tried doing that, but the problem is i don't know the UID for the Stunner. :P

Edit: Well when i try to make a stunner, it returns a -1 in the debug box.

Can't you make the node display the UID of its children? usually, when you create something you give it a Command ->ChildName ... print the <-ChildName. Does Stunners not work like that? I haven't delved with stunners yet.
"If you want others to be happy, practice compassion. If you want to be happy, practice compassion."

Nicant

#12
Quote from: Sorrontis on December 13, 2016, 03:58:23 PM
Quote from: Nicant on December 13, 2016, 03:42:01 PM
Quote from: Sorrontis on December 13, 2016, 03:38:48 PM
Have you tried to create a stunner using PRPL and see how/what that returns?
Yeah, i tried doing that, but the problem is i don't know the UID for the Stunner. :P

Edit: Well when i try to make a stunner, it returns a -1 in the debug box.

Can't you make the node display the UID of its children? usually, when you create something you give it a Command ->ChildName ... print the <-ChildName. Does Stunners not work like that? I haven't delved with stunners yet.


Just tried that, it displays nothing.

Edit: I have also tried Capital and lowercase for this as well.

Updated Code:
# --CHEEKY MONKEY-- 12/13/2016 3:53:59 PM

CurrentCoords "stunner" CreateUnit ->stunner
<-Stunner print
90 Delay TraceAll
CW4 hype!!

Sorrontis

<-Stunner print

should be

<-stunner print


capitalization matters
"If you want others to be happy, practice compassion. If you want to be happy, practice compassion."

Nicant

Quote from: Sorrontis on December 13, 2016, 04:08:01 PM
<-Stunner print

should be

<-stunner print


capitalization matters

Fixed that capitalization error, still displays nothing.

This is like finding out the UID for the anti-creeper emitter for CW3 again!
CW4 hype!!