I had too much fun with this one.
Again, another idea I got from Company of heroes, I was trying to give infantry the ability to build barricades, but just as i test I used the bombing run first.
So, to do this you have to go into the config file of the bombing run obj.army.bombingrun
go to the entry that says "unit constructor" and change it from the radio operator to sarge
Constructor("army.unit.sarge");
then go to sarges config and add this underneath the create unit entry
GameObj()
{
ThinkInterval(1);
IdleTask("Tasks::UnitConstructor");
Properties()
{
it should look like this
// UNIT
CreateObjectType("army.unit.sarge", "Unit")
{
GameObj()
{
ThinkInterval(1);
IdleTask("Tasks::UnitConstructor");
Properties()
{
if you add this to the "Add" section then sarges icon will appear always next to the bulldozer.
Add("Client::FacilityBar");
I tried to give sarge the ability to build units, but when I try to build the unit i get an error that says memory access violation. So I will have to do some more poking around before Sarge can start magically poofing grunts! But, it's a start
Giving units the ability to call in Airstrikes/Paratroopers/Magnyfying glass
Re: Giving units the ability to call in Airstrikes/Paratroopers/Magnyfying glass
Yes, while this idea is fun to play with, it's very dangerous in practice. The reason that the radio operator, or any unit that builds, does not attack is because the game's idle process for Tasks::UnitConstructor does to take weapons into account. Which sound fine, but Sarge will only attack if told to or while moving. Also if Sarge dies while constructing, the game crashes.
And units cannot build other units. This is because their models (.god files) do not contain the correct hard points for units. These hard points are used to tell the newly built unit where to spawn, where to walk, and where to exit the building. The points are called OP-EXIT-POST, OP-EXIT1, and OP-EXIT2.
Also, you can post code with the correct formatting using the code button when writing a post as such.
And units cannot build other units. This is because their models (.god files) do not contain the correct hard points for units. These hard points are used to tell the newly built unit where to spawn, where to walk, and where to exit the building. The points are called OP-EXIT-POST, OP-EXIT1, and OP-EXIT2.
Also, you can post code with the correct formatting using the code button when writing a post as such.
Code: Select all
GameObj()
{
ThinkInterval(1);
IdleTask("Tasks::UnitConstructor");
Properties()
{
Add("Filter::Army");
Add("Filter::Biological");
Add("Filter::Unit");
Add("Filter::Weapon");
Add("Filter::Heroes");
Add("Filter::Transportable");
Add("Client::FacilityBar");
Add("Client::ForceNameDisplay");
}
}
I may not make the best maps, or be the best player, but I put a lot of time, effort, and care into my stuff. That counts for something, right? No.
"Can we order a pizza?"
GameRanger ID: 913974
"Can we order a pizza?"
GameRanger ID: 913974
Re: Giving units the ability to call in Airstrikes/Paratroopers/Magnyfying glass
Cool, could I make sarge build other buildings?TommyCD1 wrote: ↑Sun Mar 12, 2017 12:59 am Yes, while this idea is fun to play with, it's very dangerous in practice. The reason that the radio operator, or any unit that builds, does not attack is because the game's idle process for Tasks::UnitConstructor does to take weapons into account. Which sound fine, but Sarge will only attack if told to or while moving. Also if Sarge dies while constructing, the game crashes.
And units cannot build other units. This is because their models (.god files) do not contain the correct hard points for units. These hard points are used to tell the newly built unit where to spawn, where to walk, and where to exit the building. The points are called OP-EXIT-POST, OP-EXIT1, and OP-EXIT2.
Also, you can post code with the correct formatting using the code button when writing a post as such.
code.png
Code: Select all
GameObj() { ThinkInterval(1); IdleTask("Tasks::UnitConstructor"); Properties() { Add("Filter::Army"); Add("Filter::Biological"); Add("Filter::Unit"); Add("Filter::Weapon"); Add("Filter::Heroes"); Add("Filter::Transportable"); Add("Client::FacilityBar"); Add("Client::ForceNameDisplay"); } }
Re: Giving units the ability to call in Airstrikes/Paratroopers/Magnyfying glass
Yes, but you face the same problems as explained previously, where as sarge has a problem shooting and crashes the game.
I may not make the best maps, or be the best player, but I put a lot of time, effort, and care into my stuff. That counts for something, right? No.
"Can we order a pizza?"
GameRanger ID: 913974
"Can we order a pizza?"
GameRanger ID: 913974
Who is online
Users browsing this forum: No registered users and 0 guests