Forum rules


Before adding a bug or feature request please check it is not already in the bug tracker or answered in the FAQ.



Fuel Position Selection Issues

Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Fuel Position Selection Issues
PostPosted: Thu Jan 04, 2007 6:02 am 
User avatar
Obliterated

Current Scorched3D Rank: Unranked



Joined: Sat Apr 24, 2004 6:52 am
Posts: 1393
Location: Florida, USA
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 <usefuel>false</usefuel>, 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?
Undead.

Scorched 3D Documentation & Help


Last edited by Bobirov on Sun Sep 23, 2007 10:55 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: usefuel=false=infinite fuel
PostPosted: Thu Jan 04, 2007 6:23 am 
Crispy

Current Scorched3D Rank: Unranked


Joined: Mon Dec 11, 2006 1:40 pm
Posts: 75
Location: The Fruit Bowl
Bobirov wrote:
<snipped>

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. :twisted:


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 07, 2007 11:52 pm 
User avatar
Obliterated

Current Scorched3D Rank: Unranked



Joined: Sat Apr 24, 2004 6:52 am
Posts: 1393
Location: Florida, USA
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:

Code:
// 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.
Undead.

Scorched 3D Documentation & Help


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 13, 2007 7:52 pm 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked






Joined: Sat Jun 12, 2004 12:53 am
Posts: 2884
Location: _____________________________ Current Scorched3d Rank: 1 _____________________________ *clink*
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.
To be honest, I don't fully understand that page, but it sounds like it provides the answers you need. - Deathstryker

She doesn't stimulate me mentally or physically... I need at least one of those - Anonymous

Who wrote this crap? - G. Camp


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 13, 2007 8:20 pm 
User avatar
Obliterated

Current Scorched3D Rank: Unranked



Joined: Sat Apr 24, 2004 6:52 am
Posts: 1393
Location: Florida, USA
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.
Undead.

Scorched 3D Documentation & Help


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 23, 2007 10:57 pm 
User avatar
Obliterated

Current Scorched3D Rank: Unranked



Joined: Sat Apr 24, 2004 6:52 am
Posts: 1393
Location: Florida, USA
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 <maximumrange> 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. :P
Undead.

Scorched 3D Documentation & Help


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 28, 2007 4:55 pm 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 28, 2007 10:59 pm 
User avatar
Obliterated

Current Scorched3D Rank: Unranked



Joined: Sat Apr 24, 2004 6:52 am
Posts: 1393
Location: Florida, USA
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. ;)
Undead.

Scorched 3D Documentation & Help


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 29, 2007 4:47 am 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked


Joined: Thu Jan 08, 2004 1:32 am
Posts: 2923
Location: Ohio, US
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.
Image
Scorched 3D: Mountaintop Removal at its finest!
Image


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 29, 2007 10:24 pm 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 02, 2007 1:27 am 
User avatar
Obliterated

Current Scorched3D Rank: Unranked



Joined: Sat Apr 24, 2004 6:52 am
Posts: 1393
Location: Florida, USA
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. :)
Undead.

Scorched 3D Documentation & Help


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 06, 2007 4:17 am 
User avatar
Obliterated

Current Scorched3D Rank: Unranked



Joined: Sat Apr 24, 2004 6:52 am
Posts: 1393
Location: Florida, USA
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 <usefuel>false</usefuel>, 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 <usefuel>false</usefuel>, then the movement should not be bound to the amount of the item the player has.

Code:
   <accessory>
      <name>Explosives</name>
      <armslevel>10</armslevel>
      <description>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.</description>
      <icon>fuel.bmp</icon>
      <activationsound>battery/battery.wav</activationsound>
      <bundlesize>2</bundlesize>
      <cost>2000</cost>
      <startingnumber>10</startingnumber>
      <accessoryaction type='WeaponMulti'>
         <subweapon1 type='WeaponSelectPosition'>
            <aimedweapon type='WeaponMulti'>
               <subweapon1 type='WeaponMoveTank'>
                  <steptime>0.05</steptime>
                  <usefuel>false</usefuel>
               </subweapon1>
               <subweapon2 type='WeaponDelay'>
                  <delay>6.0</delay>
                  <delayedweapon type='WeaponDelay'>
                     <delay>5.0</delay>
                     <delayedweapon type='WeaponExplosion'>
                        <hurtamount>0.5</hurtamount>
                        <deform>down</deform>
                        <size>5</size>
                        <explosiontexture>exp00</explosiontexture>
                        <explosionsound>explosions/medium.wav</explosionsound>
                     </delayedweapon>
                  </delayedweapon>
               </subweapon2>
            </aimedweapon>
         </subweapon1>
         <subweapon2 type='WeaponTankPosition'>
            <aimedweapon type='WeaponScatterPosition'>
               <landheight>true</landheight>
               <landonly>true</landonly>
               <scatterpercentage>2</scatterpercentage>
               <aimedweapon type='WeaponDelay'>
                  <delay>6.0</delay>
                  <delayedweapon type='WeaponMoveTank'>
                     <steptime>0.05</steptime>
                     <usefuel>false</usefuel>
                  </delayedweapon>
               </aimedweapon>
            </aimedweapon>
         </subweapon2>
      </accessoryaction>
      <nomuzzleflash/>
      <positionselection>fuellimit</positionselection>
      <positionselectionlimit>25</positionselectionlimit>
   </accessory>


It should be noted that changing the value of <usefuel> 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 <maximumrange> setting, if any is given. Otherwise, it should just move where I tell it to. :P

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. ;)
Undead.

Scorched 3D Documentation & Help


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 06, 2007 2:17 pm 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 06, 2007 4:16 pm 
User avatar
Obliterated

Current Scorched3D Rank: Unranked



Joined: Sat Apr 24, 2004 6:52 am
Posts: 1393
Location: Florida, USA
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 <usefuel>false</useful> for WeaponMoveTank, the player's maximum movable range should be whatever is given in the <maximumrange> tag. The range restriction based on item number shouldn't come into play when <usefuel>false</usefuel>. 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 <maximumrange> 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. ;)
Undead.

Scorched 3D Documentation & Help


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 07, 2007 2:11 am 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
Hmm, think I am going to have to re-think the fuel interaction for the next patch. Can it wait till then?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group