Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial code to sync buildings placement during gameplay #74

Merged
merged 10 commits into from
Mar 23, 2021

Conversation

sp00ktober
Copy link
Collaborator

This is just a start, there is still a lot missing. Whats working so far is:

  • placement of buildings
  • registering power generators and consumers to the power system
  • connecting a miner to the correct veins
  • flattening the terrain when placing a building and removing vegetation if needed.

It also includes a debug patch to free craft buildings and items.

Comment on lines 43 to 44
<Reference Include="Assembly-CSharp">
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Copy link
Collaborator

@hubastard hubastard Mar 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change intentional ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really 😅

rot = rot
}, 0);

GameMain.mainPlayer.controller.actionBuild.NotifyBuilt(-0, ret);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it should be 0 not -0

@hubastard hubastard linked an issue Mar 23, 2021 that may be closed by this pull request
@sp00ktober sp00ktober merged commit 5008578 into NebulaModTeam:master Mar 23, 2021

namespace NebulaModel.Packets.Factory
{
public class EntityPlaced
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like another struct candidate

for(int i = 0; i < recipe.productIds.Length; i++)
{
GameMain.mainPlayer.package.AddItemStacked(recipe.productIds[i], count);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this add to the Mecha's storage, not the main player's?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, this is debug code.


for (int i = 0; i < veinsInAreaNonAlloc; i++)
{
if(minerType == EMinerType.Vein)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Over here, maybe moving the miner type switch above the loop might be better.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll PR.

minerPool[minerId].pcId = pcID;
}
minerPool[minerId].GetMinimumVeinAmount(GameMain.mainPlayer.factory, GameMain.mainPlayer.factory.veinPool);
// TODO: do some stuff with entitySignPool, is it important?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is basically updating the image overlays on top of rendered objects. In example, logistics stations, recipes in assembler, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sync buildings build during gameplay to other players
3 participants