|Posted By: J (2004-02-29 19:00:30) |
I guess I am on a roll. I haven't asked questions forever, now, I have tons. Here the question:
I create an Engineer who in turn creates a Gate. Now, the gate can tranport all kinds of units, including the Engineer. However, lets say I want to pick up the gate and move it. If I simply try this, the engineer will go inside the gat and be transported. However, if I make sure the gate is to its maximum carrying capacity (which happens to be 1), then try to pick it up, the engineer succeeds. I hope this makes sense. There needs to be a solution where the unit can turn on or off accepting new units. Thus, a Gate or other unit that transports could shut its doors and not allow any new units in, which would allow it to then be picked up.
|Posted By: Ken Pierce (2004-02-29 19:32:34) |
hmm one way to do that is to suround the 2nd gate with 8 units.
|Posted By: J (2004-03-01 00:31:31) |
maybe, but that solution requires 8 additional units. There should be an easy programming way to fix this by simply allowing transport-enabled units the ability to close their doors manually, sort of speaking.
|Posted By: Tully (2004-03-01 14:55:00) |
This one can be a really tough problem. How do you know if it is trying to transport the gate or move through the gate. The reason it works if the gate is full is it now knows there is only one action it can take. What can be done is gates can be made to not transport engineers and that would fix it. I remember adding some way to make a non-movable object get into an engineer on its own. The origional problem was finding a way to pick up a sea defense with a land based eng, but I don't remember what the solution was.
|Posted By: Ken Pierce (2004-03-01 17:19:13) |
you could have a sea defense make a packed ver of itself say takes 2 turns then it can be deployed to a land square then then have it destroy itself after it deploys the packed unit, Then an eng picks it up. Then the packed ver can make a sea defense in 2 turns and again the packed unit would destroy itself after it redeploys the sea defense. two problems with this would be you would have to be able to alter the amount of turns it creates (which if i remember you did allow) also you also have to limit the hold in inventory to 1 unit. (again not real problem) you wouldnt want packed units cranking out a bunch of unpacked units.
You might be able to do this with the gate also. once the gate has a packed ver it will not allow units in. the problem with the gate is when it unpacks it will get a new number and will not be tied to the gate it used to be tied to. not sure it that really is a problem though.
|Posted By: J (2004-03-02 00:15:01) |
As a programmer, It seems that the solution would be simple. The only time I can pick up the gate is when it is full. Therefore create a button that will affect a selected unit that has transporting capabilities. This button will psuedo-change the variable for how many units are being carried, to the max number. The original/real number can also be stored for that unit in another variable. This will allow the unit to be transported easy.
|Posted By: Tully (2004-03-02 07:52:02) |
That has a lot of implications, loading and saving the right state, scripts that run against the unit (like the gate has) that will do things when they think the unit is full, deallocation of the object tries to delete stored units based on the count, etc.
Not that it all can't be worked around but I think the real answer is just to change it's state to "move to transport" and then check to see if something wants picked up before a unit tries to store itself. There are other problems with this solution though.
I think this is what I added in previously for the sea unit. If the sea defense is damaged its state goes to move to transport and if a transport is right next to it even though it is a non-moving object it is allowed to move the one square it needs to get into the transport.
Soon as I have a chance I will check this out and see how close a real solution is.
|Posted By: J (2004-03-02 09:36:43) |