Knuckle Cracker

Particle Fleet => Map Makers, Ship Builders, and Coders => Topic started by: Nicant on December 11, 2016, 02:53:09 PM

Title: Targeting Stunners
Post by: Nicant on December 11, 2016, 02:53:09 PM
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! :)
Title: Re: Targeting Stunners
Post by: GoodMorning on December 11, 2016, 03:52:05 PM
I believe that Stunners are units, without virtual particles, and therefore do not interact with GetNearestTarget...

GetAllUnitsInRange and GetUnitType may be your friends.
Title: Re: Targeting Stunners
Post by: Nicant on December 12, 2016, 03:09:00 PM
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!
Title: Re: Targeting Stunners
Post by: Sorrontis on December 12, 2016, 04:58:08 PM
I think V has some answering to do :P

Although, there's no NearestStunner command?
Title: Re: Targeting Stunners
Post by: Nicant on December 12, 2016, 05:05:12 PM
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.
Title: Re: Targeting Stunners
Post by: 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.
Title: Re: Targeting Stunners
Post by: 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.
Title: Re: Targeting Stunners
Post by: Nicant on December 13, 2016, 03:12:49 PM
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?
Title: Re: Targeting Stunners
Post by: Sorrontis on December 13, 2016, 03:38:48 PM
Have you tried to create a stunner using PRPL and see how/what that returns?
Title: Re: Targeting Stunners
Post by: 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.

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
Title: Re: Targeting Stunners
Post by: Oblivion on December 13, 2016, 03:51:40 PM
Wasn't there a post before of someone trying to use something call a Initmissile command or something? maybe they know something about this?
Title: Re: Targeting Stunners
Post by: 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.
Title: Re: Targeting Stunners
Post by: Nicant on December 13, 2016, 04:01:56 PM
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
Title: Re: Targeting Stunners
Post by: Sorrontis on December 13, 2016, 04:08:01 PM
<-Stunner print

should be

<-stunner print


capitalization matters
Title: Re: Targeting Stunners
Post by: Nicant on December 13, 2016, 04:10:41 PM
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!
Title: Re: Targeting Stunners
Post by: Sorrontis on December 13, 2016, 04:12:08 PM
have you tried:

SetText <-stunner
Title: Re: Targeting Stunners
Post by: Nicant on December 13, 2016, 04:17:32 PM
Quote from: Sorrontis on December 13, 2016, 04:12:08 PM
have you tried:

SetText <-stunner
Now in the debug box it says STUNNER, but there is no stunner clearly visible.

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

->Stunner2 "STUNNER"


CurrentCoords <-Stunner2 CreateUnit ->stunner
<-stunner print
90 Delay TraceAll



Edit: Also tried turning it into an enemy, but doing that makes the debug box empty again.

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

->Stunner2 "STUNNER"


CurrentCoords <-Stunner2 CreateUnit ->stunner
<-stunner SetUnitIsEnemy
<-stunner print
90 Delay TraceAll


Edit2: also tried replacing CurrentCoords with CurrentPixelCoords, still nothing new.
Title: Re: Targeting Stunners
Post by: GoodMorning on December 13, 2016, 05:12:55 PM
Try this:

"Stunner" CurrentCoords CreateUnit ->Unit


In PRPL, some strings need lowercase.
Title: Re: Targeting Stunners
Post by: Nicant on December 13, 2016, 05:32:23 PM
Quote from: GoodMorning on December 13, 2016, 05:12:55 PM
Try this:

"Stunner" CurrentCoords CreateUnit ->Unit


In PRPL, some strings need lowercase.

yes it finally works! Turns out i have put the notations in the wrong order. :P Thanks!
Title: Re: Targeting Stunners
Post by: Sorrontis on December 13, 2016, 05:37:22 PM
So, it's a unit then? not a particle?
Title: Re: Targeting Stunners
Post by: GoodMorning on December 13, 2016, 06:05:39 PM
Yes, Sorrontis.

If you think about it, it makes sense, as it doesn't need to directly interact with the particle sim.

Note that "Omni" has already been proven to be needed.

Additionally:
Particles seem to come in standard and virtual varieties, with VPs on everything from Emergent to Omnis to ships. Probably amp factories and energy pods as well. If it can be hit by particles (and is not land or a standard particle), it has a VP, I think.