Maximum accums


(Flippy) #1

Hey
just a little question i read a looong time ago when i didnt know what accums were lol… still cant search so i ask…

whats the maximum number of accum values you can have in the script?

Im asking this because i already have 9 (0 - 8) (mainly because of a tank and some script_movers) and im sure i read somewhere that the maximum is 8… (or it could be accum 8)

and im pretty sure im gonna need more, for a CP probably (never done a cp but im reasonably sure that it needs accums)


(Shaderman) #2

I remember that thread. I said there are 8 (global)accums, but IIRC someone told me there are 10 (0-9).


(Chruker) #3

99% correct.

There are 8 globalaccums (0-7)
Each scriptblock has its own set of 10 accums (0-9)

OT: How long can it really take to fix a search function?


(FireFly) #4

Why O why is the search button still broke?

Anyway, The maximum global accums you can use is 8. I learned this the hard way with my v1rocket map: There’s a 1 on 1 topic somewhere with me and NullSkillz about this…


(kamikazee) #5

If I may believe the solution I found (and posted about) : less then 10 minutes.
The only problem is that it may mess up the whole forum.


(FireFly) #6

… Chruker pushed the submit button faster than I did…


(Chruker) #7

and im pretty sure im gonna need more, for a CP probably (never done a cp but im reasonably sure that it needs accums)

You should use local accums for the scriptmovers and other stuff, and only use globalaccum when you need to share a value between two or more scriptblocks.

Edit: And 3 more replies came while I was typing this :slight_smile:


(Flippy) #8

Thnx, but whats the difference between local and global accums?
i guess local is in one scriptblock?

how do i use global and local accums…? i only ever saw/heard about “accum 3 set 1” or something, never global or local…


(carnage) #9

global accums can be used anywhere in the script

local accums can only be used withing an enclosed section of the script



tank
{

spawn
{
...
}

death
{
...
}

}

also. dot forget that you can test and alter individual bits of accums you could hold a 0 - 255 number or 8 yes/no tests… it can be useful to get the most out of your global variables especialy when you only need to store thing that dont need large numbers e.g. tank dead or alive 0/1


(kamikazee) #10

You can see the difference in the command:

globalaccum points to global accums and can be used anywhere, whilst accum only gives a local accum. As carnage said, local accums can not be used to get a value from another script block.


(EB) #11

…I made a map with 10 globalaccum values. 0-9
The map has been on a clan server for a year or so with NO errors.

Map: (-FM-)Chaos (a clan training map I made for my buddy TTBOY)


(Lanz) #12

I posted about this a while back (with code backing it up) and if you use more than 8 global accums it overflows and actually stores the values for global accum 8 and 9 in soldierChargeTime[2]. You might not notice it but it’s a bug and effects the players charge times. You will of course also notice it if you change the solider charge time in the script while using g accum 8 and 9.

EDIT: Nothing beats a manual search eh? :slight_smile:
http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=13848


(EB) #13

…interesting.


(Chruker) #14

I guess the best bugfix would have been to allow 10 globalaccums :slight_smile: Instead of just fixing the sourcecode problems that Lanz listed in the other thread.


(Lanz) #15

Yeah having two defines meaing the same thing is just asking for trouble. That’s what happens when different code monkeys work on the same code sometimes. :slight_smile:


(carnage) #16

so if you maed anough accums then set them to a high value say 100

then in the script deincrement they based on a player delivering an objective etc they could gradualy lower there charge bar times?


(Lanz) #17

Yeah, 8 would effect the axis team and 9 the allied iirc, and only the soldier class.


(sodsm live) #18

forgot to apologize for that post. i was just going by what i read in some document, then testing and not noticing a problem. anyway, sorry for promoting incorrect information.


(SCDS_reyalP) #19

There is another bug in that area. G_ScriptAction_PrintAccum uses the #define for global accums ( 8 ), so it won’t let you print out that last two local accums.