I was trying to make a custom unit...

Started by Ondrejoda, June 11, 2017, 10:48:24 AM

Previous topic - Next topic

Ondrejoda

And can i make a Creeper Bertha, what will work the same as the AC Bertha, too?

GoodMorning

It's possible, but the effect can vary.

An AC Bertha would likely operate by flattening Creeper in the area, much as a normal Bertha, and then placing AC where it was. There's also the "titanic AC payload" option.

You can also have it operate as a conversion.
A narrative is a lightly-marked path to another reality.

Ondrejoda

#17
And, could someone give me the two parts (the body and the barrel) of the sprayer?

Ondrejoda

#18
GoodMorning, could you give me the code for the first idea of the AC Bertha? (the first idea is the flattering and then putting down AC)

GoodMorning

A narrative is a lightly-marked path to another reality.

Nicant

If you want images for units, then you can get most of them here: http://knucklecracker.com/wiki/doku.php?id=crpl:custom_image_repository
Or here: http://knucklecracker.com/wiki/doku.php?id=cw3:units:concepts


Now making a working enemy Bertha is a bit difficult, but once one is made, you could reuse the code and make other turret-like units. Along with the Bertha you would also need a script for the projectile. I will make a rough script later that will help you form together a Bertha.
CW4 hype!!

Ondrejoda

I must say that the idea to be on the forum wasnt a bad idea... Anyways, thank you!

Ondrejoda

Well, i just put out the "Bertha" idea, but i found a custom image (the Scout image) and instead of targetin the Creeper/Units, it will find the Higest ammount of Creeper (GetDeepestCreeperCell), then it will do a blast (DamageCreeper) and then it will deploy AC/Creeper (AddCreeper). But I didnt found a solution for the unit to come back to the units and reload. Maby I could locate the Units and Queue the movement..?

Ondrejoda

#23
Wait, how do I make a code, that it makes CRPLCores with a different code?

GoodMorning

The approximate procedure is to write each script, and attach them to different Cores.

You ca also attach the same script to multiple Cores. Or multiple scripts to the same Core.
A narrative is a lightly-marked path to another reality.

Ondrejoda

Wait, I did finally manage to make it! I will upload the image and the code! (Put the Bertha.crpl to the CRPLCore, and dont attact the Bullet.crpl to anyting, just leave it there, put on the CRPLCore any image you want... :D
# Bertha.crpl
# Created on: 6/12/2017 2:42:36 PM
# ------------------------------------------

once
Self CONST_MAXAMMO 250 SetUnitAttribute #Sets maximum ammo
Self CONST_AMMO 0 SetUnitAttribute #Sets ammo to 0
Self CONST_CONNECTABLE True SetUnitAttribute #Makes sure unit can connect to collectors
Self CONST_SHOWAMMOBAR True SetUnitAttribute #Shows the ammo bar for the unit
0 SetTimer0 #Sets timer0 to 0 Timers are more useful than delays because they do not "freeze" the core
endonce

GetTimer0 eq0 if #Wait till the timer is at 0
Self CONST_AMMO GetUnitAttribute ->Ammo #Check how much ammo it has
<-Ammo 250 gte if #Check and see if there is atleast 100 ammo in it's ammo store
<-Ammo 250 sub ->Ammo #Subtract the total ammo supply by 100
CreateUnit("CRPLCore" CurrentCoords) ->Bullet
AddScriptToUnit(<-Bullet "Bullet.crpl")
Self CONST_AMMO <-Ammo SetUnitAttribute #Sets the ammo to the amount of ammo that it has from the subtractor
endif
endif

# Bullet.crpl
# Created on: 6/12/2017 3:10:38 PM
# ------------------------------------------

GetDeepestCreeperCell SetCurrentCoords
CurrentCoords -2500 AddCreeper
Destroy(self 3)




Ondrejoda

And, I just found a small problem. The problem is that when the bullet explodes, it leaves a Power Zone. Is there a command to turn off the Power Zone after destruction?

Builder17

Self CONST_CREATEPZ FALSE SetUnitAttribute

In Bullet.crpl there is one zero too much in creeper amount -2500?

Ondrejoda

Dont matter about the number... I just made it SUUUUUUUUUUUUUUUUUUUUUUUUUUUUPER OP....

Ondrejoda

And, is it possible to locate a CRPLCore?