Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: Eppiox on March 15, 2015, 09:09:48 AM

Title: Energy Ideas
Post by: Eppiox on March 15, 2015, 09:09:48 AM
Short Question:
Is there a way to set power generation?

If Not?
I still need a bit of help, currently I've found two work arounds which are iffy:
1) Create an energy resource, then a siphon on it. (Player cannot see energy levels)
OR
2) Create a bunch of reactors overlapping for desired effect. (Player can see energy levels)
The new question is, how does one create a completed building (Currently it just starts constructing the unit).
Thanks for reading :D
Title: Re: Energy Ideas
Post by: warren on March 15, 2015, 10:39:15 AM
"REACTOR" CurrentCoords CreateUnit ->unit
<-unit CONST_ISBUILDING FALSE SetUnitAttribute


If you create a powerzone first, then you need one tenth as many reactors. In addition, you can directly manipulate the energy levels of structures other than the commandnodes.

Edit:
Of particular note, guppies will not return to base if they keep getting more energy.
Title: Re: Energy Ideas
Post by: Eppiox on March 15, 2015, 10:50:04 AM
Guppies would work perfect for the effect I'm after, however is there a way to disable them being moveable/selectable yet still dispatch power?
I'm thinking at perhaps running abortmove or something on them constantly?
Title: Re: Energy Ideas
Post by: warren on March 15, 2015, 10:58:02 AM
<-unit FALSE SetUnitSelectableOverride

Edit:
If you want to do this kind of thing, the GUPPYAIR needs the ammo modification, whereas it is the GUPPY that needs the selectability override.
Title: Re: Energy Ideas
Post by: Eppiox on March 15, 2015, 09:19:18 PM
Alas I tried with the GUPPYAIR, but the game locks up.  So it seems without placing a guppy base down first they won't work, but that means it won't send out packets.

Is there a way to place a landed guppy so it will distribute power?
Everything I've tried has not worked.
Title: Re: Energy Ideas
Post by: warren on March 15, 2015, 09:27:35 PM
Here is probably how to do it: In the editor: create the guppy base. Move the GUPPYAIR off the guppy base. In a script move both offscreen using SetPixelCoords (but to different coordinates) and set the base to be unselectable. When you want the guppy to suddenly appear, move the GUPPYAIR back.

Edit:
I mean: <-unit CONST_PIXELCOORDX -1000 SetUnitAttribute
Title: Re: Energy Ideas
Post by: Eppiox on March 16, 2015, 02:03:02 AM
Ah well after some testing, I just can't get this to work, I can move the Guppy and the GuppyAir to where ever I like yet the guppyAir will only ever release packets if it is manually landed or goes through that landing off the base phase, which means simply moving the base and guppyAir does not work :(

The other idea I had was to place the guppies in the map editor and select them but.. since there are going to be about 24 of them I'd rather not.

Title: Re: Energy Ideas
Post by: warren on March 16, 2015, 03:35:55 AM
That is a lot of guppies. Unfortunately, the only way I know how to make guppies work is to manually move them off the base the first time. Have you considered creating a field that auto charges weapons in range?

Edit:
OR, move the guppies off the base then save and load.