
The old Activate callback will vanish. Instead, there will be - consistent with all the other Control* callbacks - the following:
ControlUse(object clonk, int x, int y)
The clonk uses the object. In the standard control, this is a click with the mouse. x and y are local coordinates of the cursor. It gets called when the player presses the mouse button down.
ControlUseStop(object clonk, int x, int y)
Same as above but gets called when the player releases the mouse button.
We are not sure about how a callback that is continuously called while the mouse button is hold. For now, it is:
ControlUseHolding(object clonk, int x, int y)
But it may be subject to change.
For objects which are controlled from the inside (submarine etc.), the callbacks are called Contained*, again consistent with the other callbacks.

>In the standard control, this is a click with the mouse. x and y are local coordinates.
yes
so what about the retancle selection area? is it disabled when there is a "ControlUse" in the clonk-object?






That's not to say there shouldn't be something like Use1 and Use2, assigned to the same key or mouse command. It's just that we also need an interface for as many commands as are needed for a specific object.

Another idea I had for 2 use functions was for the barrel; Use1: Empty Barrel, Use2: Open/Close Barrel Lid. This way you could safely throw barrels around (ie into lorries) without the barrel emptying immediately. I've got most of this already implemented, just no command to set the barrel to "closed".
You could put the open/close function on the same button as a toggle. In fact, I don't believe it's very useful to have it as two different buttons.

I am strongly for just one Use command to keep the (usage of the) objects in the game easy. I'd rather have 9 weapons with each just one shooting-mode than 3 with three shooting modes each. I'd rather have a sword (stab), a hammer (stomp) and a shield (block) than to have a sword (and most other weapons) that has each up to 3 different functions.
Why? KISS - one object, one function.
The practical reason for just one Use command is the limited space on the mouse. I plan to use the controls like this:
LMB - use selected object (e.g. bow)
RMB - use other selected object (e.g. shovel)
or e.g. sword and shield. Then, you'd stab with the left mouse button and block with the right one. I fear if we use up both mouse buttons for use controls to one object, the gameplay will be more tenacious than in CR because even in CR you could use the shovel and e.g. a bow without switching the inventory around.

Also, in the event that an object would definitely require more than one usable function (ie magic wand/book/playable-guitar xD) there is always scripted menus.


>some kind of menu
A menu with shortkeys. Joint of both principles. (Uhm, I'm sure s.o. suggested that already somewhere.)

If an object has greater-than two Use commands, left clicking could operate the first Use command, and right click could bring up a menu of all possible Use commands for the object (selectable with short-keys).
What do you think?

Your mouse has two buttons. Put the context menu on the left and ignore the right one. I prefer having one most important action and other less important ones, but yep, that's a question of style, noone can answer for everyone.

ControlUseIdle(object clonk, int x, int y)
...in which it continually returns the position of the mouse-cursor when the object is selected in a Clonk's inventory. That way bows/guns could track the mouse smoothly, instead of snapping to the proper angle when the mouse button is pushed.
We need to synchronize cursor coordinates across the network in that case; depending on latency, you could see noticeable lag.


>you could see noticeable lag.
The only way to circumvent that is to have synchronous and asynchronous scripts. The asynchronous ones would capture the mouse events for drawing whenever they are available and the synchronous ones would capture mouse events that affect the game. IF you like to implement that, ... I'd be happy about it, you could distribute profiling stuff between the faster machines or make complex HUD functions available for a larger amount of players, and whatnot. But I think we've had that in #oc-dev, right?
It might lag? Every game we play in CR you have ~ 500-1000 objects lying or flying around the landscape. What would one extra coord-pack per player affect? Player 1: Mouse at 1293 | 457... Player 2: Mouse at 494 | 764... and so on. Ok, in CR synchronization rate can be changed and is mostly played on 2-4 frames per sync. But we can sacrifice a ridiculous amount of bandwith for some coordinates.



HoldingEnabled()
that returns true. Perhaps later it is added that it can return an int if a call per frame is not needed.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill