Anyway, it would be possible to have this functionality in the wipf, too, but why is this preferrable?
>Anyway, it would be possible to have this functionality in the wipf, too, but why is this preferrable?
It's preferrable to be kept maintainable and dynamic.
In real words: add only things that are absolutely necessary AND make sure other people can also use them. For example, if I had an own monster/item (a WOPF!) and I wanted to also show that in a lorry, I could ideally do that in a few lines without changing the lorry. (Because the lorry is in Objects.ocd and my Wopf is in ZappersBetterObjects.ocd).
Oh, and the only real solution would probably be to just attach the wipf meshs to the lorry. Then the wipfs would rotate properly, be IN the lorry (e.g. in the picture) and much more!
(I have nothing against having it in the lorry btw. Or in an additional library that my Wopf would just include.)
Did not think about attaching meshes, this probably is a good solution.
>Did not think about attaching meshes, this probably is a good solution.
It's done like that e.g. in the catapult.
>then I need an interface somewhere in the vehicle as well.
You don't need an interface for attaching stuff. It's as simple as calling AttachMesh.
You do need an interface (in the lorry) for making sure that you attach max. 5 meshes, that you add and remove them when they enter/leave the lorry or are randomly removed by a script. Stuff like that.
(And I still have nothing against doing that in the lorry)
>Interface: I do not mean a GUI or anything, I am talking about functions such as IsPrey() or IsToolProduct() that tell other objects something about this object.
Yes, I know. I was just saying that attaching the mesh is not the code-intensive/error-prone part. You mentioned the plane, which is a completely different usecase and there it's probably really enough to use AttachMesh without needing some sort of library that cares about attaching stuff.
>I set the layers with GFXOV_MODE_Object so that it displays up to 5 wipfs.
How do you draw the Wipfs *behind* the lorry?
I'm asking, because I'm looking for a way to have an (2d) object attached to a mesh and have it always face the camera. (billboarding) The problem is that I don't want the overlay in front of the parent object, but rather somewhere between.
Is there some sort of depth check for overlays set with SetGraphics?
> Is there some sort of depth check for overlays set with SetGraphics?
No -- depth checks are only performed for attached meshes. In principle overlays could be drawn before the object itself is drawn, but I think the engine does not do this, either.
In other words: Do meshes keep their overlays when attached?
I think the scripter has control over whether he supplied nil or a number.
So you can either write:
Clonk->Place()->SetName("Wolli");
or
for (clonk in Clonk->Place(Random(10))) clonk->SetName("Wolli");
But I'm also not opposed to leaving out the first option (i.e. always return an array) if others think that makes the API too complicated.
[Update]
What about moving the old buy and sell implementation from Library_Base to the vendor library, as well as removing the old engine menu?
[Update]
The base library also has a "bug": Do buy looks for buyable material of the player that calls the menu, but decreases the material of the player that owns the base. Usually this is the same player, but this is wrong imo.
[Update]
I will present a reworked version later
> The base library also has a "bug": Do buy looks for buyable material of the player that calls the menu, but decreases the material of the player that owns the base. Usually this is the same player, but this is wrong imo.
This was intended in CR, in OC I left it like this. So we need some opinions, I think I'd leave it like it is.
// Interface for custom buy conditions
public func AllowBuyMenuEntries(){ return !ObjectCount(Find_ID(Rule_BuyAtFlagpole));}
and keep it as a simple "return true" in the vendor library. So we can have a dedicated market building in the future and just keep the rule for some special scenarios where this is not feasible (e.g. quick base melees where you want to combine both structures). Then the market could be a "high tier" building requiring advanced stuff like cloth to build.
Also remember to call indirectly (this->AllowBuyMenuEntries() instead of AllowBuyMenuEntries()) to allow runtime overloads.
On the other hand, only the cursor of the player is passed as a parameter to the menu, so if I select a lorry on one tab of the menu, then the flag still only displays the clonk's contents as sellable. For now I'll skip the sell menu.
So I don't like the extra sell area. Instead, we should highlight the items in the container that can be transferred somehow. Or gray out the ones which can not.
- the stack can be set to contain 0 items (the object gets removed if you use DoStackCount() but not with SetStackCount()). This can lead to strange behaviours, because the returned stack count still is 1. The function should either be consistent in that the object is always removed on stack count 0, or that the correct stack count is returned.
- in the documentation there is an example use case: Clonk with arrow stack, bow with arrow stack, the Clonk collects a third arrow stack. This third arrow stack fills the bow arrows first, then the inventory slot arrows and gets collected by the Clonk. In practice, in my test, only the bow arrow stack is filled and the stack is not collected. Which behaviour is desired? I think the way it behaves currently is not that bad, because an infinite stack would fill a lot of stacks once it is collected.
- the function name "TryPutInto" suggests, imo, that it would make the stack enter another object, but it rather tries to fill existing stacks in a container. If it cannot fill any stack it stays where it is - this is misleading. Any suggestions?
The tests revealed another problem:
Infinite stacks currently count as 50 objects. The infinite stack gets deleted if you remove 50 or more items from an infinite stack.
- stacks would always be removed if set/changed to a stack count of 0, since this seems more consistent
- infinite stacks would not get removed by taking 50 or more objects from them. They should get removed when merging infinite stacks, though.
- the behaviour of TryPutInto() should stay the same, even though the name suggests that the object might enter the other object
- do not change the behaviour of filling stacks - use case #2 from the stackable documentation would not work like that. The desired behaviour has to be discussed though and may be changed later.
I need actual feedback on my proposed changes, so that I can continue.
I don't get your last point. What documentation?
Personally, I do not find TryPutInto misleading, but what about TryAdd() or TryPut() then?
>Personally, I do not find TryPutInto misleading, but what about TryAdd() or TryPut() then?
How would that help? I'd need a longer name such as
TryToPutIntoContainedStack
to clear up the ambiguity. (I am the one who invented that name, I guess). Or TryMergeInto
.PS: I checked and at least the comment above that function is very concise about what it does and what not :)
Why not the other way around? I expect a method to rather modify itself than another object.
>Why not the other way around? I expect a method to rather modify itself than another object.
What exactly do you mean?
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill