Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: Nicant on December 01, 2015, 05:00:15 PM

Title: Custom Sleeper Units Template [UPDATED: February, 24]
Post by: Nicant on December 01, 2015, 05:00:15 PM
This is just Telanir's Sleeper map template (Telanir's Original Template (https://knucklecracker.com/forums/index.php?topic=18434.0)), but with the Custom Sleeper Units loaded into the Template! I did this because the scripts in the Custom Sleeper Units Scripts posts keep going over the Max Character limit, so i have just decided to just have it so you can download everything real quick and simple! The Sleeper node can build the custom units and you can toggle whether or not the CCN can build them. To do this, just select the sleeper node (By double clicking it in the map editor) and put a 1 or 0 by where it says the certain sleeper units! Make Sure you give credit to Telanir or none of this would of been possible!

--Changes--
- Relays added! (They act like microrifts from CW2, but with creeper!)

Re-Doing all of my custom sleeper units so they can run better and not cause much lag.
Units added so far:
Default sleeper units are obviously in
- Reactor
- Sniper
- Sprayer
- Bomber
- Bertha
- Guppy
- Nullifier
- Forge
- Relay

Notes: To defend your stuff against the Bertha, try using shields!

If you find any bugs that are not listed above, then please tell me!
[/size]
Instructions on how to place the template in a map.

Step 1: Go to MyDocuments, then go to creeperworld3 (the folder), then to the WorldEditor folder.

Step 2: Create a new folder in the WorldEditor folder and name it what you want your map to be called.

Step 3: Then place the file that you downloaded in this post into you folder that you created.

Step 4: Exit the folder and start Creeper World 3, go to your projects and find your map.

Step 5: Everything should be working fine! If anything is not working or you don't have any textures loaded tell me and i will try fix it! Have fun making your map and don't forget to resize your map! Also don't forget to credit Telanir for the Scripts! None of this would be possible without him!!!
Title: Re: Custom Sleeper Units Template
Post by: Nicant on January 06, 2016, 03:55:25 PM
Creep Bertha Added!
Title: Re: Custom Sleeper Units Template
Post by: Johnny Haywire on January 06, 2016, 11:01:51 PM
Nice! Now... just gotta wait for someone to make a map with these bad boys! (Hint hint)  ;)
Title: Re: Custom Sleeper Units Template
Post by: rer24 on January 09, 2016, 10:25:17 AM
Hey, would it be possible to re-purpose the Sleeper and creep codes to use AC and fight the original creeps? I'd love to have a grand battle!
Title: Re: Custom Sleeper Units Template
Post by: J on January 09, 2016, 10:44:47 AM
Quote from: rer24 on January 09, 2016, 10:25:17 AM
Hey, would it be possible to re-purpose the Sleeper and creep codes to use AC and fight the original creeps? I'd love to have a grand battle!
It's certainly possible, but a huge amount of work. In every script all creeper values have to be inverted and all logic for reacting to player units has to be rewritten to do something else. I'd love to do that sometime, but only when I have a few weeks spare time to get everything right.
Title: Re: Custom Sleeper Units Template
Post by: Nicant on January 09, 2016, 04:06:25 PM
Quote from: rer24 on January 09, 2016, 10:25:17 AM
Hey, would it be possible to re-purpose the Sleeper and creep codes to use AC and fight the original creeps? I'd love to have a grand battle!

I was thinking about having a Sleeper AC Node or even "neutral" units that if creeper or AC touch it, it would be converted into the respected "team".
Title: Re: Custom Sleeper Units Template
Post by: Johnny Haywire on January 09, 2016, 06:06:30 PM
Heh, maybe a kind of "Capture the flag" like in other games - whoever controls the flag controls the device or something.
Title: Re: Custom Sleeper Units Template
Post by: Nicant on January 09, 2016, 06:13:46 PM
Quote from: Johnny Haywire on January 09, 2016, 06:06:30 PM
Heh, maybe a kind of "Capture the flag" like in other games - whoever controls the flag controls the device or something.
I might actually try and make an AC node in the next map! Yeah NVM, i just tried and convert it and it is waaaaaaaay out of my coding range.  :P Someone who is a lot more talented could probably do it.
Title: Re: Custom Sleeper Units Template
Post by: Builder17 on January 10, 2016, 04:15:23 AM
Cannot it be just Flip emitter code little changed?
Title: Re: Custom Sleeper Units Template
Post by: TLFP on January 10, 2016, 01:28:58 PM
Maybe you could have greyed-out units that when creeper or Ac touches them you could spawn a sleeper or player unit?
It might work and be less of a pain to code. :D
Someone did something like that where you had to kill a greyed-out unit in order for the corresponding player unit to spawn in.
And just to clarify, I mean a grey picture of the unit on a core, not the units tab. ;)
Title: Re: Custom Sleeper Units Template
Post by: Nicant on January 10, 2016, 03:53:50 PM
Quote from: Builder17 on January 10, 2016, 04:15:23 AM
Cannot it be just Flip emitter code little changed?
no because you would have to get ride of the digitalis parts of the code which the code depends on. It would need a total rewrite in order for there to be an AC node.
Title: Re: Custom Sleeper Units Template
Post by: Nicant on January 10, 2016, 03:56:07 PM
Quote from: TheLongFellowPLAYER on January 10, 2016, 01:28:58 PM
Maybe you could have greyed-out units that when creeper or Ac touches them you could spawn a sleeper or player unit?
It might work and be less of a pain to code. :D
Someone did something like that where you had to kill a greyed-out unit in order for the corresponding player unit to spawn in.
And just to clarify, I mean a grey picture of the unit on a core, not the units tab. ;)
Yeah that's what i was thinking, but since it will require a total rewrite of code to make an AC sleeper node, i am not doing it.
Title: Re: Custom Sleeper Units Template
Post by: TLFP on January 10, 2016, 05:10:32 PM
Quote from: Nicant on January 10, 2016, 03:56:07 PM
Quote from: TheLongFellowPLAYER on January 10, 2016, 01:28:58 PM
Maybe you could have greyed-out units that when creeper or Ac touches them you could spawn a sleeper or player unit?
It might work and be less of a pain to code. :D
Someone did something like that where you had to kill a greyed-out unit in order for the corresponding player unit to spawn in.
And just to clarify, I mean a grey picture of the unit on a core, not the units tab. ;)
Yeah that's what i was thinking, but since it will require a total rewrite of code to make an AC sleeper node, i am not doing it.
I would spawn a player controlled unit, for example a greyed pulse cannon will spawn an actual pulse cannon when in AC but in creeper you would just destroy the grey core and build a sleeper cannon core. I know it's not AI controlled but it's the next best thing. :D
Edit: I pasted code from the wiki to code the unit so here's the code:currentcoords getcreeper ->creeperAmount
if(<-creeperAmount 0 gt)
"CRPLCore" CurrentX CurrentY CreateUnit ->unit
<-unit "CCannon.crpl" AddScriptToUnit
self 2 destroy
endif
if(<-creeperAmount 0 lt)
"PULSECANNON" CurrentX CurrentY CreateUnit
self 2 destroy
endif

The problem is it builds a building player cannon, not a built cannon, but it works for the sleeper cannon.
And you wouldn't need a AC node to do it, just have the player, the Sleeper, and this code.
Title: Re: Custom Sleeper Units Template
Post by: Builder17 on January 11, 2016, 03:05:11 AM
CONST_ISBUILDING eq FALSE SetUnitAttribute could work.
Title: Re: Custom Sleeper Units Template
Post by: J on January 11, 2016, 04:31:06 AM
Quote from: Builder17 on January 11, 2016, 03:05:11 AM
CONST_ISBUILDING eq FALSE SetUnitAttribute could work.
Quote from: J on January 05, 2016, 01:41:50 PM
eq is a comparison operator

If that doesn't work, try setting the CONST_AMMO unit attribute to the amount needed to build it.
Title: Re: Custom Sleeper Units Template
Post by: TLFP on January 11, 2016, 07:04:22 AM
Quote from: J on January 11, 2016, 04:31:06 AM
Quote from: Builder17 on January 11, 2016, 03:05:11 AM
CONST_ISBUILDING eq FALSE SetUnitAttribute could work.
Quote from: J on January 05, 2016, 01:41:50 PM
eq is a comparison operator

If that doesn't work, try setting the CONST_AMMO unit attribute to the amount needed to build it.
Ok, let me try that....
EDIT: IT WORKED!!!! Except that it spawned in a damaged unit... so I don't know what I'm doing wrong.
Here's the updated code:currentcoords getcreeper ->creeperAmount
if(<-creeperAmount 0 gt)
"CRPLCore" CurrentX CurrentY CreateUnit ->unit
<-unit "CCannon.crpl" AddScriptToUnit
self 2 destroy
endif
#Problem is that it will spawn a cannnon but it will be a a low
#total health
if(<-creeperAmount 0 lt)
"PULSECANNON" CurrentX CurrentY CreateUnit ->unit
<-unit CONST_ISBUILDING FALSE SetUnitAttribute
self 2 destroy
endif
Title: Re: Custom Sleeper Units Template
Post by: TLFP on January 11, 2016, 02:18:49 PM
It's FINALLY working!!!  8)
If you want to use this code, feel free to credit me.
currentcoords getcreeper ->creeperAmount
if(<-creeperAmount 0 gt)
"CRPLCore" CurrentX CurrentY CreateUnit ->unit
<-unit "CCannon.crpl" AddScriptToUnit
self 2 destroy
endif
#Change the PULSECANNON to whatever you want to build, same with the Sleeper Ccannon.crpl
if(<-creeperAmount 0 lt)
"PULSECANNON" CurrentX CurrentY CreateUnit ->unit
<-unit CONST_ISBUILDING FALSE SetUnitAttribute
<-unit CONST_HEALTH 50 SetUnitAttribute
<-unit CONST_AMMO 50 SetUnitAttribute
self 2 destroy
endif
Title: Re: Custom Sleeper Units Template
Post by: Nicant on January 11, 2016, 03:39:00 PM
Thanks i will try it!
Title: Re: Custom Sleeper Units Template
Post by: Nicant on January 11, 2016, 05:52:16 PM
I tried it, and i am trying to make it build all the way and nothing i try is working. I used the health unit constant and whatever health value i give it, it always says that it only has 1.5 health.
Title: Re: Custom Sleeper Units Template
Post by: TLFP on January 11, 2016, 06:37:50 PM
Quote from: Nicant on January 11, 2016, 05:52:16 PM
I tried it, and i am trying to make it build all the way and nothing i try is working. I used the health unit constant and whatever health value i give it, it always says that it only has 1.5 health.
That's weird, it works when I do it.
EDIT: I would check to see if you are using the latest version of CW3, because it works for me and I checked the code.
If that doesn't work,  I can re-post the code and I'll do that anyway because I might have messed up stuff while copying and pasting it.
CurrentCoords GetCreeper ->creeperAmount
if(<-creeperAmount 0 gt)
"CRPLCore" CurrentX CurrentY CreateUnit ->unit
<-unit "CCannon.crpl" AddScriptToUnit
self 2 destroy
endif
if(<-creeperAmount 0 lt)
"PULSECANNON" CurrentX CurrentY CreateUnit ->unit
<-unit CONST_ISBUILDING FALSE SetUnitAttribute
<-unit CONST_HEALTH 50 SetUnitAttribute
<-unit CONST_AMMO 50 SetUnitAttribute
self 2 destroy
endif

I screenshotted it but I don't know how to paste it.
I'll just paste my save. The script you want is titled "deadunit.crpl"
Title: Re: Custom Sleeper Units Template
Post by: Nicant on January 11, 2016, 09:58:10 PM
Quote from: TheLongFellowPLAYER on January 11, 2016, 06:37:50 PM
Quote from: Nicant on January 11, 2016, 05:52:16 PM
I tried it, and i am trying to make it build all the way and nothing i try is working. I used the health unit constant and whatever health value i give it, it always says that it only has 1.5 health.
That's weird, it works when I do it.
EDIT: I would check to see if you are using the latest version of CW3, because it works for me and I checked the code.
If that doesn't work,  I can re-post the code and I'll do that anyway because I might have messed up stuff while copying and pasting it.
CurrentCoords GetCreeper ->creeperAmount
if(<-creeperAmount 0 gt)
"CRPLCore" CurrentX CurrentY CreateUnit ->unit
<-unit "CCannon.crpl" AddScriptToUnit
self 2 destroy
endif
if(<-creeperAmount 0 lt)
"PULSECANNON" CurrentX CurrentY CreateUnit ->unit
<-unit CONST_ISBUILDING FALSE SetUnitAttribute
<-unit CONST_HEALTH 50 SetUnitAttribute
<-unit CONST_AMMO 50 SetUnitAttribute
self 2 destroy
endif

I screenshotted it but I don't know how to paste it.
I'll just paste my save. The script you want is titled "deadunit.crpl"

Wait no, i did not see what you did to make it work when i posted that it did not work. But, i tried it now and it works fine! :D Want me to make a gray texture for it?
Title: Re: Custom Sleeper Units Template
Post by: TLFP on January 12, 2016, 09:05:30 AM
Quote from: Nicant on January 11, 2016, 09:58:10 PM
Quote from: TheLongFellowPLAYER on January 11, 2016, 06:37:50 PM
Quote from: Nicant on January 11, 2016, 05:52:16 PM
I tried it, and i am trying to make it build all the way and nothing i try is working. I used the health unit constant and whatever health value i give it, it always says that it only has 1.5 health.
That's weird, it works when I do it.
EDIT: I would check to see if you are using the latest version of CW3, because it works for me and I checked the code.
If that doesn't work,  I can re-post the code and I'll do that anyway because I might have messed up stuff while copying and pasting it.
CurrentCoords GetCreeper ->creeperAmount
if(<-creeperAmount 0 gt)
"CRPLCore" CurrentX CurrentY CreateUnit ->unit
<-unit "CCannon.crpl" AddScriptToUnit
self 2 destroy
endif
if(<-creeperAmount 0 lt)
"PULSECANNON" CurrentX CurrentY CreateUnit ->unit
<-unit CONST_ISBUILDING FALSE SetUnitAttribute
<-unit CONST_HEALTH 50 SetUnitAttribute
<-unit CONST_AMMO 50 SetUnitAttribute
self 2 destroy
endif

I screenshotted it but I don't know how to paste it.
I'll just paste my save. The script you want is titled "deadunit.crpl"

Wait no, i did not see what you did to make it work when i posted that it did not work. But, i tried it now and it works fine! :D Want me to make a gray texture for it?
Yes, because I'm still setting up editing programs for textures. I used this in my latest map: http://knucklecracker.com/forums/index.php?topic=19949.msg139204;boardseen#new
EDIT: Ok, I just made them and I'm attaching them here at the bottom but they're JPG file textures, so I don't know if you have to convert it.
Title: Re: Custom Sleeper Units Template
Post by: GameGibu on January 12, 2016, 10:05:05 AM
Ugh jpgs much suck for this use. :P  >:(

png is the way to go, otherwise your units donot look clean.

-GameGibu
Title: Re: Custom Sleeper Units Template
Post by: TLFP on January 12, 2016, 10:32:47 AM
Quote from: GameGibu on January 12, 2016, 10:05:05 AM
Ugh jpgs much suck for this use. :P  >:(

png is the way to go, otherwise your units donot look clean.

-GameGibu
Sorry, I had to convert them in order to edit them. :-\
If you want I can convert them back. They should stay the same.
EDIT: Even thought it says they're jpg they're not because I didn't rename them. If it's any comfort my editing software WILL NOT accept anything that's not JPG so I checked and they're PNG all right.  ;D
Edit2: I just realized that they are HUGE. I hope you can resize them without much trouble.
Title: Re: Custom Sleeper Units Template
Post by: Nicant on January 12, 2016, 03:21:44 PM
Thanks! I am going to use these in my map! (I will also give you credit :) ) Edit: My next map will probably be the best map i have ever made. It will not just be any sleeper map.
Title: Re: Custom Sleeper Units Template
Post by: TLFP on January 12, 2016, 03:37:03 PM
Quote from: Nicant on January 12, 2016, 03:21:44 PM
Thanks! I am going to use these in my map! (I will also give you credit :) ) Edit: My next map will probably be the best map i have ever made. It will not just be any sleeper map.
Thanks!  ;D ;D Hope it's a great map.  :D
Title: Re: Custom Sleeper Units Template
Post by: Nicant on January 12, 2016, 03:55:27 PM
Also played your sleeper security map and you forgot credits for the sleeper units. :P :P :P
Title: Re: Custom Sleeper Units Template
Post by: TLFP on January 12, 2016, 05:03:20 PM
Quote from: Nicant on January 12, 2016, 03:55:27 PM
Also played your sleeper security map and you forgot credits for the sleeper units. :P :P :P
Oops, forgot. I'll add that in the original.  :D
EDIT: Credit added.  ;)
Title: Re: Custom Sleeper Units Template [UPDATED: March,12] NEW TEXTURES UPDATE!
Post by: Nicant on March 12, 2016, 04:20:33 PM
Added New Textures!
Title: Re: Custom Sleeper Units Template [UPDATED: July, 31]
Post by: Nicant on July 31, 2016, 10:38:17 PM
Added New Stuff!
Title: Re: Custom Sleeper Units Template [UPDATED: January, 10]
Post by: Nicant on January 10, 2018, 04:26:01 PM
Added in Sleeper guppy and nullifier! Other small changes too! :)
Title: Re: Custom Sleeper Units Template [UPDATED: January, 18]
Post by: Nicant on January 18, 2018, 09:56:16 PM
Sleeper forge now added in!
it currently has 7 different upgrades/abilities!