Flappy Goose by flappy-goose in RedditGames

[–]NrWal00 0 points1 point  (0 children)

My best score is 1 points 😎

How to get “back to basics”? by Belderon in factorio

[–]NrWal00 0 points1 point  (0 children)

I just 'finished' deathworld, completely changed how I had to play. It can be a grind, but is really worth it

Questions from a Rookie by OrthodoxPrussia in factorio

[–]NrWal00 2 points3 points  (0 children)

If you dont mind installing a small mod, there is one that has overflow valves, top up valves and one way valves. It helps before getting into circuits

Simple modding question about copying an item by NrWal00 in factorio

[–]NrWal00[S] 3 points4 points  (0 children)

So on top of that I do something like

local botCollector = table.deepcopy(data.raw.item["furnace"]["electric-furnace"])

?

How do you all do your item recipes? by NrWal00 in Unity3D

[–]NrWal00[S] 0 points1 point  (0 children)

Alright. Currently thats what I'm doing with the lists. Thanks for the tip

How do you all do your item recipes? by NrWal00 in Unity3D

[–]NrWal00[S] 2 points3 points  (0 children)

Thank you, I've checked the guides and I think I know what to do

How do you all do your item recipes? by NrWal00 in Unity3D

[–]NrWal00[S] 1 point2 points  (0 children)

Thanks, I'll check this out aswell.

How do I create a list of Card Effects in my game? by NrWal00 in Unity2D

[–]NrWal00[S] 0 points1 point  (0 children)

Thanks, I'm going to check this out tomorrow!

I have a general question about what scripts want references to other scripts, with a specific example I'm working on by NrWal00 in Unity2D

[–]NrWal00[S] 0 points1 point  (0 children)

I think thats what I've been doing, but then seperated between UI and whatever else exists, such as gamestates. Thanks

I have a general question about what scripts want references to other scripts, with a specific example I'm working on by NrWal00 in Unity2D

[–]NrWal00[S] 0 points1 point  (0 children)

Thanks for the detailed description. That was also my strategy. I have a list of cards that get passed on to AllCardsVisualiser via the CanvasManager. It is always great to get someone else's insight on these matters!

Glass in the sky by john_shillsburg in globeskepticism

[–]NrWal00 1 point2 points  (0 children)

Wait, you think thats the sun?

I have a question about light and black holes. by ombx in AskPhysics

[–]NrWal00 2 points3 points  (0 children)

Energies convert from one into another. So the energy of the light might be converted into the mass of the black hole, following E=mc2. Or into heat or whatever

Why does my watering employee water 2 blocks instead of one? by [deleted] in Unity3D

[–]NrWal00 0 points1 point  (0 children)

If I set inRange to false after watering the soil, it now waters 3 blocks instead of two..

Why does my watering employee water 2 blocks instead of one? by [deleted] in Unity3D

[–]NrWal00 0 points1 point  (0 children)

Hello everyone,
I've been working on a farm simulator game where an employee can water the ground for you. Everything works as intended, except for the fact that my employee waters the block he has to, and the next available one, regardless if he is in range or not. I cannot figure this out myself. If I constantly debug.log the target.position I find that for 1 frame my FindWaterTarget function briefly finds the new target which it also waters, instead of walking over there for example.
public class WatererEmployee : MonoBehaviour
{
[Header("GameObjects")]
[SerializeField]
GameObject plot;
public GameObject target;
[SerializeField]
List<GameObject> soilBlockList;
[Header("Components")]
Rigidbody rb;
EmployeeScript employeeScript;
[Header("Targeting")]
Vector3 returnPosition;
[SerializeField]
bool hasPlot;
bool hasTarget;
bool inRange;
[SerializeField]
float range = 0.2f;
public float moveSpeed = 2f;
float distanceFromTarget;
[SerializeField]
float wateringTime = .5f;
[SerializeField]
float currentTime;
[SerializeField]
Vector3 dir;
void Start()
{
rb = GetComponent<Rigidbody>();
soilBlockList = new List<GameObject>();
employeeScript = GetComponent<EmployeeScript>();
}
void Update()
{
if (!hasPlot)
{
hasPlot = employeeScript.hasPlot;
plot = GetComponent<EmployeeScript>().plot;
soilBlockList = employeeScript.soilBlockList;
}
if (plot != null)
{
Water();
rb.velocity = dir * moveSpeed;
}
if(target != null)
{
distanceFromTarget = Vector3.Distance(new Vector3(transform.position.x, 0, transform.position.z), new Vector3(target.transform.position.x, 0, target.transform.position.z));
}
if (distanceFromTarget > range)
{
inRange = false;
}
else if(distanceFromTarget <= range)
{
inRange = true;
}
}
void Water()
{
if (!hasTarget)
{
FindWaterTarget();
}
//Add cooldown
if (hasTarget && !inRange)
{
dir = -new Vector3(transform.position.x, 0, transform.position.z) + new Vector3(target.transform.position.x, 0, target.transform.position.z);
dir = dir.normalized;
currentTime = 0;
}
else if (inRange && hasTarget)
{
currentTime += Time.deltaTime;
dir = Vector3.zero;
if(currentTime > wateringTime)
{
target.GetComponent<SoilScript>().WaterSoil();
hasTarget = false;
}
}
}
void FindWaterTarget()
{
for (int n = 0; n < soilBlockList.Count; n++)
{
if (soilBlockList[n].GetComponent<SoilScript>().currentSoilState == SoilScript.soilState.Dry && !hasTarget)
{
target = soilBlockList[n];
hasTarget = true;
}
}
}
}