This topic contains 14 replies, has 0 voices, and was last updated by  Bobirov 10 years ago.

  • Author
    Posts
  • #5192

    Bobirov
    Participant

    @A few months back, in the dev forum, I wrote:

    Another thing I just noticed last night was that it seems that if you use WeaponMoveTank but you have false, you do not lose ANY of the item when you use it. I was thinking that it should remove 1 of that item from your inventory in that case just like any other weapon does. If not, its not a big deal as I should be able to get around that by using WeaponGiveAccessory with a value of -1 to force the inventory count down by 1.

    @gavin, in response, wrote:

    I debated about this too. But in the end I decided that it would be best this way (if you look in CVS the version before used 1 fuel).

    If you are using the fuel selection type but asking it not to use any fuel then what are you trying to achieve. If you just want to give the user the chance to move x times then give them x times the maximum fuel amount.
    If you are not using the fuel selection type then it will use 1 of the weapon you have used as per usual. Allowing you to have the tank move to a projectile position etc…

    Quick question, if I were to revert back that change on my server it wouldn’t totally break compatibility with 40.1d would it? It would just be one of those cases where the client didn’t know it had lost one of the item until the next turn correct?

    If you are using the fuel selection type but asking it not to use any fuel then what are you trying to achieve?

    If you are not using the fuel selection type then it will use 1 of the weapon you have used as per usual.

    I am trying to achieve just that, using the fuel selection type to first move the user to a position, place an explosive device, and then move back. I would gladly use one of the other selection methods, but in this instance the fuel selection method fits perfectly. Since I am actually moving the user to the position to set the bomb, the select area should only highlight areas he/she can actually walk to. The fuel selection method accomplishes that perfectly.

    For this reason, I can’t really use the limit method as it highlights (and accepts clicks from) everywhere within the given range, even though the player might not be able to move there due to terrain. That leads to the player being able to place explosives in places they shouldn’t be able to because they can’t get there.

    If you just want to give the user the chance to move x times then give them x times the maximum fuel amount.

    Thats a good idea, and I might just have to compromise and do that as its probably the best option, but again it doesn’t fit with what I am doing at all. I need to be able to give the user exactly 3 of these things. If I give him 3*fuelrange he could actually use it 6 times at half the range. That is undesirable. Although its certainly better than the current setup where they essentially have infinite of the item. 😉

    I see why it is the way it is, it makes sense really from a pure logic standpoint. You’re using fuel position selection, you’re also moving the tank and you have the movement set to not use any fuel. That sounds like it should be infinite fuel to me. But to that I say that we already have a way to do that, for all players or for an individual tank type. I don’t see the point in having a second method of doing something if its at the cost of doing something else that is useful.

    What I don’t have now is a way to use fuel selection and movement just like it was a standard item. Like you said, all other movement/position selection combinations will use 1 item, like all weapons. Since we already have methods to give infinite fuel, why shouldn’t this instance be treated like all the other position selection methods?

    #38272

    a banana
    Participant

    @bobirov wrote:

    Thats a good idea, and I might just have to compromise and do that as its probably the best option, but again it doesn’t fit with what I am doing at all. I need to be able to give the user exactly 3 of these things. If I give him 3*fuelrange he could actually use it 6 times at half the range. That is undesirable. Although its certainly better than the current setup where they essentially have infinite of the item. 😉

    I like having infinite explosives! It brings out my alter-ego of the Mad Banana Bomber. 😈

    #38273

    Bobirov
    Participant

    I went back and found where this was changed in the code and I reinstated it on the opscorched server. So now, if usefuel=false, you’ll use one of the item per move. As a result, it takes 2 explosives now to lay one (because you use one on the way there and one on the way back). I just consider that the guy uses 2 pounds of explosive or something like that. 😉

    So now the engineer starts out with enough explosives for 3 uses and he receives enough explosives for 2 uses from a resupply. This is more what I intended for the explosives.

    Just for reference, the code change is in actions/TankMovement.cpp at line 257, re-add:

    // If this weapon is not to use fuel, just use one unit for the whole movement
    if (!weapon_->getUseFuel())
    {
    tank->getAccessories().rm(weapon_->getParent());
    }

    After seeing the effect of this change though, I was thinking that maybe instead of usefuel being a boolean value, maybe it should accept a few different things like a specified amount (integer), normal (standard fuel use rate) and none (no fuel at all is used), or something like that. Perhaps I’ll have a look at something like that.

    #38274

    cbx550f
    Participant

    Rob – where did we leave this off? Was anything changed in the cvs?
    I can’t remember, and if I did change something, I forgot to update the TODO.

    #38275

    Bobirov
    Participant

    I didn’t commit anything, and I don’t think you did either. I just changed this this snippet for my Opscorched server for now until something a bit more permanent and flexible could be done.

    What I was thinking maybe is that usefuel could be made to either accept true/false like it does now with the same behaviour. But it could also accept an integer value, so that you could either use the current style of fuel use, or you could set a predetermined amount of the item to use per move. That seems the most flexible and able to fit any desired behaviour. So, to sum up, usefuel could accept the following values:

    true : use however many of the item it takes to move that distance (default)
    false : use no fuel at all, no matter what the distance is
    integer : use exactly this amount of fuel for that movement

    Having it like that you could pretty much do whatever you wanted, you could make an item that moves the player 3 times in a turn, but only uses 1 unit of fuel to do it. Things like that are prohibited with the current true/false behaviour.

    #38276

    Bobirov
    Participant

    I have noticed that the explosives in OpScorched are broken again in the current build, due to the behaviour when using the ‘fuel’ position selection method.

    We can now set usefuel to use a specific amount of the item, which is great. However, even when doing that, the selectable range is still tied to the number of that item that the player has. There is still no way to use fuel position selection type and use a preset maximum range that is greater than the number of the item you give them. I would use the limit selection type, but it does not take the terrain into account. So if I use it, the player’s could set bombs in places they can’t move to, and thats no good.

    What I was thinking that maybe if usefuel is something greater than 0 (e.g. not true/false), that the fuel type’s value should be used to calculate the movable distance instead of the number of that item the player has. We need a way to be able to use the fuel position selection type and just give it a preset range that is not tied to the number of the item the player has.

    Another method that might work would be if there was some way to make the limit position selection type to analyze the terrain like the fuel type does. That way I could just use limit, set the selection range to 25 and tell it to only allow clicks onto moveable terrain. That is all I want to do, but there is just no way to do it at the moment. I’d be happy with any way to do that.

    I’ve tryed browsing the code a bit to spot where the selection range is determined, but I haven’t been able to spot or understand it yet. But thats no surprise, I suck with the code. 😛

    #38277

    imported_gcamp
    Participant

    I’ll have a look. As a warning don’t change the code just on the server for v41 as this will cause the clients to get out of sync.

    #38278

    Bobirov
    Participant

    @gcamp wrote:

    I’ll have a look. As a warning don’t change the code just on the server for v41 as this will cause the clients to get out of sync.

    Good point, I haven’t touched anything yet. 😉

    #38279

    Deathstryker
    Participant

    @bobirov wrote:

    Good point, I haven’t touched anything yet. 😉

    Yeah right. I bet you were always the kid to pull unexpected items into the grocery kart when you were little.

    #38280

    imported_gcamp
    Participant

    I’ve added a new position type called fuellimit which works the same way as the limit type except only for places you can move to in range. See if that works for you.

    #38281

    Bobirov
    Participant

    @gcamp wrote:

    I’ve added a new position type called fuellimit which works the same way as the limit type except only for places you can move to in range. See if that works for you.

    Awesome, that sounds perfect. I’ll check it out. Many thanks. 🙂

    #38282

    Bobirov
    Participant

    Having issues using it. If you use the fuellimit type and combine it with a WeaponMoveTank, the WeaponMoveTank is still ‘silently’ tied to the amount of the item you have. Even if you set false, you will still only be able to move as far as you can go with how many of the item you have.

    Try this weapon out, just a stripped down version of the explosives. If you enable giveallweapons, it works like a charm. If you only have a limited number of the item though, you can only move so far. In a situation like the weapon below, where you provide WeaponMoveTank with a position to move to, and set false, then the movement should not be bound to the amount of the item the player has.

    	
    Explosives
    10
    Places a timed explosive at a nearby position.
    You select where you want to place this item.
    You will retreat to your previous position
    after you place the explosive charge.
    fuel.bmp
    battery/battery.wav
    2
    2000
    10




    0.05
    false


    6.0

    5.0

    0.5
    down
    5
    exp00
    explosions/medium.wav







    true
    true
    2

    6.0

    0.05
    false






    fuellimit
    25

    It should be noted that changing the value of for the first WeaponMoveTank has no effect on whether or not the player can move beyond the range allowed by the number of the item they have. IMO, if usefuel=false then the movement range should only be bound to the WeaponMoveTank’s setting, if any is given. Otherwise, it should just move where I tell it to. 😛

    However, I am pleased to say that, in the example above, the weapon only uses up 1 of the item, like I want it to. So I am glad I don’t have to fight with that part at least. 😉

    #38283

    imported_gcamp
    Participant

    Yes, it won’t work for tank movement. Only for other weapons to show where you could move to.

    I thought that was what you wanted. Movement worked, but you couldn’t place an item on the movement path.

    #38284

    Bobirov
    Participant

    @gcamp wrote:

    Yes, it won’t work for tank movement. Only for other weapons to show where you could move to.

    I thought that was what you wanted. Movement worked, but you couldn’t place an item on the movement path.

    Placing an object in the path has never been a problem, I just move to the spot, place it and then move back to the original spot. Its become clear now with the new fuellimit selection that the problem is WeaponMoveTank being so persistantly tied to the number of the item the player has. With usefuel set to true, false, or a specific value, in the end it doesn’t matter. The max range the player can move is always tied to the number of the item the player has.

    Using the old fuel position selection, everything worked fine, its just that the selectable range winds up being tied to the amount of the item. So if you only have 3 of them, you’re only allowed to move 3 units to place the item. This is not the behaviour I desire. I want them to be able to move 25 units to a movable spot, regardless of how many of the item they have. And I only want to use up one of the item in the process (the one explosive they lay at the end of the path).

    The new fuellimit selection type is great because it is not tied to the number of the item the player has. It does exactly what I want by simply using the selection limit as the maximum range and only allowing selections to movable positions, perfect. The problem, however, is that MoveTank refuses to let a player move to a range that is beyond what they could move to if they were burning that item as fuel. So even though I’ve now got the selectable range I desire, regardless of item count, the movable range is still invisibly just like it was.

    By having WeaponMoveTank unavoidably tied to the item number, in all cases, it is preventing it being used in more interesting ways than just its standard original use as fuel. The mod developer should have the freedom to make an item that moves a player wherever the mod developer decides is appropriate, and not be limited to just using it like fuel. If I provide WeaponMoveTank with a position and its not set to use fuel, it should move where I tell it to. As it is now, the only way to really get that kind of functionality is to either just treat the item like fuel (give enough of it to cover movement range) or to give them infinite of the item to bypass the item count’s limitations on the movable range, neither of which is desirable when you’re trying to use it in the role of a weapon.

    When false for WeaponMoveTank, the player’s maximum movable range should be whatever is given in the tag. The range restriction based on item number shouldn’t come into play when false. It seems far better to me to just let the developer control the moveable ranges within the position selection and by using WeaponMoveTank’s own setting and ignoring the item count altogether. To me, when you set usefuel=false, you are saying that item is NOT fuel, its just a movement, and should be treated as such, just part of the weapon. After all, the name of the primitive is WeaponMoveTank, not WeaponFuel. 😉

    #38285

    imported_gcamp
    Participant

    Hmm, think I am going to have to re-think the fuel interaction for the next patch. Can it wait till then?

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic.