+=
- morbydvisns
- Posts: 1889
- Joined: Sun Jan 30, 2005 12:51 am
+=
Software:Registered Server
Version Number:
________________________________________________________________________
Location
planet
________________________________________________________________________
Description:
$gbuildingvar[$vBranchesHarvested] += 1
doesn't work. must do
$gbuildingvar[$vBranchesHarvested] = $gbuildingvar[$vBranchesHarvested ]+ 1
________________________________________________________________________
Steps to Replicate:
Version Number:
________________________________________________________________________
Location
planet
________________________________________________________________________
Description:
$gbuildingvar[$vBranchesHarvested] += 1
doesn't work. must do
$gbuildingvar[$vBranchesHarvested] = $gbuildingvar[$vBranchesHarvested ]+ 1
________________________________________________________________________
Steps to Replicate:
mm... support for += was added a few versions back and seems to work fine for me. (I've been using it for a while now without any problems that i've noticed)
This is my test code..
Which outputs 0 then 1 as expected. Could you recheck please?
This is my test code..
Code: Select all
Event( "AccessBuilding", "4" )
{
$vVarNum = 3
$gBuildingVar[$vVarNum] = 0
*say $gBuildingVar[$vVarNum]
$gBuildingVar[$vVarNum] += 1
*say $gBuildingVar[$vVarNum]
}
- morbydvisns
- Posts: 1889
- Joined: Sun Jan 30, 2005 12:51 am
- morbydvisns
- Posts: 1889
- Joined: Sun Jan 30, 2005 12:51 am
perhaps was a typo you didn't notice?
I'd be lying if I said it didn't happen to me.
Sometimes to the point where I had to copy/paste the two instances of a var and put them one above the other to compare letter by letter to find I was missing an 'i' or something like that after doing a long stretch of scripting..
I'd be lying if I said it didn't happen to me.
Sometimes to the point where I had to copy/paste the two instances of a var and put them one above the other to compare letter by letter to find I was missing an 'i' or something like that after doing a long stretch of scripting..
- morbydvisns
- Posts: 1889
- Joined: Sun Jan 30, 2005 12:51 am
O that's happened, but it's also happened just as i said. I will literally type a line in one below and it be exactly the same and work vs the pasted in. Here's an example of another oddity....
the top is copy/pasted out of the world owners manual. the bottom is my own typed in.. see the difference? The top one will not work and the bottom will. I can only assume mit used the same key to type his quotation as I did (the one left of the enter, while holding shift).
That is
Code: Select all
OsdAddItem(OSDIMAGE,””, “http://myweb.com/image.jpg” )
OsdAddItem(OSDIMAGE,"", "http://myweb.com/image.jpg" )
That is
- morbydvisns
- Posts: 1889
- Joined: Sun Jan 30, 2005 12:51 am
- morbydvisns
- Posts: 1889
- Joined: Sun Jan 30, 2005 12:51 am
if ($gBuildingVar[$vNextCycle]-1 > $gBuildingTimeVar[$tvNextCycle])
{
$gBuildingTimeVar[$tvNextCycle] += 1
//$gBuildingTimeVar[$tvNextCycle] = $gBuildingTimeVar[$tvNextCycle] + 1
*say tick $gBuildingTimeVar[$tvNextCycle]
}
if i go with the += i get a tick 1 scrolling eternally
if i go with the one currently commented out, it works properly.
All i did was copy the $gBuildingTimeVar[$tvNextCycle] paste it a couple times and put = + and 1 in their proper spots.
I've also typed in the top one a couple times with no diff.
{
$gBuildingTimeVar[$tvNextCycle] += 1
//$gBuildingTimeVar[$tvNextCycle] = $gBuildingTimeVar[$tvNextCycle] + 1
*say tick $gBuildingTimeVar[$tvNextCycle]
}
if i go with the += i get a tick 1 scrolling eternally
if i go with the one currently commented out, it works properly.
All i did was copy the $gBuildingTimeVar[$tvNextCycle] paste it a couple times and put = + and 1 in their proper spots.
I've also typed in the top one a couple times with no diff.
- morbydvisns
- Posts: 1889
- Joined: Sun Jan 30, 2005 12:51 am