Author Topic: Complex Item Handling  (Read 2640 times)

Well I didn't say I wasn't going to try to make this, it sounds interesting. I just think I will probably have to have a alt-Q command for assigning a weapon to the secondary. This is depending on how much I can get it to work mind you.

That is not an argument, it is an exclusatory statement. If someone made a game that took advantage of some super processor in your computer only you didnt have it and complained you couldnt play the game, youd be pissed if the developer told you "well go spend money on some periphrial to your computer".
it's more like if someone made a game that required a single-core 1Ghz processor. and you said "not everyone has a singe-core 1Ghz processor"
also, no, I wouldn't even be pissed. I'm not gonna ask someone to make a game that looks bad just because I don't have a graphics card good enough for it

in any case, an actual keybind would be better than making it work with only one button

So the problem I am encountering is torque expects to know what datablocks are when the player connects, a way I am considering handling this is faking the weapons by mounting the images and shooting the projectiles corresponding to the image but I don't know how to make sure that image follows its appropriate state: all guns would shoot at the same rate. :/

Yeah I am going about this entirely the wrong way. I'll just override stuff with packages and see what I can get.

Yeah I have wasted enough time with this I have to get back to other projects.
So I was getting there when overriding the armor's ontrigger functions to divert mouseclicks to corresponding weapons, the problem is this did not work for any hold-to-fire weapons, a weapon that was supposed to be triggered by the right mouse would still sense the leftmouse being held instead of the right mouse, so there might be an override in the armor's detection I am missing?
My next idea would be to override the shapebaseimage::onfire but this doesnt seem to do anything, so to manually override I had a function that (taking the tutorial's method of eliminating datablock names for bricks, check the tutorial gamemode for more) found each datablock with an onfire and added the check for if their appropriate trigger was being held. I haven't quite gotten it to work and already don't like the theory because it would mess with alot of weapons without my ability to actually know what they were doing beforehand.
It's a fun challenge though and something this game has been missing so I encourage other modders to attempt to tackle this as well.
« Last Edit: October 03, 2014, 09:24:26 AM by Ladios »

Oh, my primary suggestion wasn't to have the secondary weapon fire from left hand.  While that would be a nice feature, I am aware that it would mainly just complicate things.  It was more of a third mouse button* allowing a quick switch between weapons, and allowing weapons to be stored in ways that do not involve moving to a specific order in the inventory.

Let's say this example.  [Brackets] means that the weapon is selected in right hand.  (Parenthesis) means the weapon is stored in left hand.

Sniper Rifle
Assault Rifle
Handgun
Knife
Grenade

Suppose the player wants Sniper Rifle next to Knife so that if a player gets close, they can use the knife, rather than scrolling having to scroll down to it just by using mouse3*.

[Sniper Rifle]
Assault Rifle
Handgun
(Knife)
Grenade

Or:

[Sniper Rifle]
Assault Rifle
(Handgun)
Knife
Grenade

Now suppose a player is entering close combat, and wants to switch to Assault Rifle:

Sniper Rifle
[Assault Rifle]
Handgun
(Knife)
Grenade

Suppose the player expends all their ammo and needs to reload and some hoodlum sneaks up on them in close quarters.  Use mouse3 and they now have their knife out putting their Assault Rifle in their left hand, rather than frantically having to scroll to the knife.

If anything, this is a kind of "in-a-pinch" tool.

*Or any other keybind.  This is my preference though.