A few questions about Accums
1… accum is a private accum for each SCRIPTBLOCK right? or a accum per trigger.
2nd How many accums/globalaccums do you have?
Greets. sQynor 
A few questions about Accums
1… accum is a private accum for each SCRIPTBLOCK right? or a accum per trigger.
2nd How many accums/globalaccums do you have?
Greets. sQynor 
accum is known in the scriptroutine, globalaccum can be used in every scriptroutine…
accum 0 - 9
but you can use bitset value 0 - 9 i think, too… so it should have some kind of boolean vars (bitset or not bitset 10 times from 0 - 9) and 10 available indexes from 0 - 9 which can have a specific value
Well my Mini game doesn’t work. I’m building a Tic_tac_toe thingy…
here’s my script.
left_buttons
{
trigger left_1_activate
{
accum 1 abort_if_not_equal 0
setstate cross_1 default
accum 1 set 2
trigger self check_for_winner
}
trigger left_2_activate
{
accum 2 abort_if_not_equal 0
setstate cross_2 default
accum 2 set 2
trigger self check_for_winner
}
trigger left_3_activate
{
accum 3 abort_if_not_equal 0
setstate cross_3 default
accum 3 set 2
trigger self check_for_winner
}
trigger left_4_activate
{
accum 4 abort_if_not_equal 0
setstate cross_4 default
accum 4 set 2
trigger self check_for_winner
}
trigger left_5_activate
{
accum 5 abort_if_not_equal 0
setstate cross_5 default
accum 5 set 2
trigger self check_for_winner
}
trigger left_6_activate
{
accum 6 abort_if_not_equal 0
setstate cross_6 default
accum 6 set 2
trigger self check_for_winner
}
trigger left_7_activate
{
accum 7 abort_if_not_equal 0
setstate cross_7 default
accum 7 set 2
trigger self check_for_winner
}
trigger left_8_activate
{
accum 8 abort_if_not_equal 0
setstate cross_8 default
accum 8 set 2
trigger self check_for_winner
}
trigger left_9_activate
{
accum 9 abort_if_not_equal 0
setstate cross_9 default
accum 9 set 2
trigger self check_for_winner
}
trigger check__11
{
accum 7 abort_if_not_equal 2
accum 8 abort_if_not_equal 2
accum 9 abort_if_not_equal 2
wm_announce "Right side WON!"
accum 0 set 1
trigger self resetit
}
trigger check__21
{
accum 4 abort_if_not_equal 2
accum 5 abort_if_not_equal 2
accum 6 abort_if_not_equal 2
wm_announce "Right side WON!"
accum 0 set 1
trigger self resetit
}
trigger check__31
{
accum 1 abort_if_not_equal 2
accum 2 abort_if_not_equal 2
accum 3 abort_if_not_equal 2
wm_announce "Right side WON!"
accum 0 set 1
trigger self resetit
}
trigger check__41
{
accum 7 abort_if_not_equal 2
accum 4 abort_if_not_equal 2
accum 1 abort_if_not_equal 2
wm_announce "Right side WON!"
accum 0 set 1
trigger self resetit
}
trigger check__51
{
accum 8 abort_if_not_equal 2
accum 5 abort_if_not_equal 2
accum 2 abort_if_not_equal 2
wm_announce "Right side WON!"
accum 0 set 1
trigger self resetit
}
trigger check__61
{
accum 9 abort_if_not_equal 2
accum 6 abort_if_not_equal 2
accum 3 abort_if_not_equal 2
wm_announce "Right side WON!"
accum 0 set 1
trigger self resetit
}
trigger check__71
{
accum 1 abort_if_not_equal 2
accum 5 abort_if_not_equal 2
accum 9 abort_if_not_equal 2
wm_announce "Right side WON!"
accum 0 set 1
trigger self resetit
}
trigger check__81
{
accum 7 abort_if_not_equal 2
accum 3 abort_if_not_equal 2
accum 5 abort_if_not_equal 2
wm_announce "Right side WON!"
accum 0 set 1
trigger self resetit
}
trigger right_1_activate
{
accum 1 abort_if_not_equal 0
setstate circle_1 default
accum 1 set 1
trigger self check_for_winner
}
trigger right_2_activate
{
accum 2 abort_if_not_equal 0
setstate circle_2 default
accum 2 set 1
trigger self check_for_winner
}
trigger right_3_activate
{
accum 3 abort_if_not_equal 0
setstate circle_3 default
accum 3 set 1
trigger self check_for_winner
}
trigger right_4_activate
{
accum 4 abort_if_not_equal 0
setstate circle_4 default
accum 4 set 1
trigger self check_for_winner
}
trigger right_5_activate
{
accum 5 abort_if_not_equal 0
setstate circle_5 default
accum 5 set 1
trigger self check_for_winner
}
trigger right_6_activate
{
accum 6 abort_if_not_equal 0
setstate circle_6 default
accum 6 set 1
trigger self check_for_winner
}
trigger right_7_activate
{
accum 7 abort_if_not_equal 0
setstate circle_7 default
accum 7 set 1
trigger self check_for_winner
}
trigger right_8_activate
{
accum 8 abort_if_not_equal 0
setstate circle_8 default
accum 8 set 1
trigger self check_for_winner
}
trigger right_9_activate
{
accum 9 abort_if_not_equal 0
setstate circle_9 default
accum 9 set 1
trigger self check_for_winner
}
trigger check__1
{
wm_announce "check1"
accum 7 abort_if_not_equal 1
accum 8 abort_if_not_equal 1
accum 9 abort_if_not_equal 1
wm_announce "Left side WON!"
accum 0 set 1
trigger self resetit
}
trigger check__2
{
wm_announce "check2"
accum 4 abort_if_not_equal 1
accum 5 abort_if_not_equal 1
accum 6 abort_if_not_equal 1
wm_announce "Left side WON!"
accum 0 set 1
trigger self resetit
}
trigger check__3
{
wm_announce "check3"
accum 1 abort_if_not_equal 1
accum 2 abort_if_not_equal 1
accum 3 abort_if_not_equal 1
wm_announce "Left side WON!"
accum 0 set 1
trigger self resetit
}
trigger check__4
{
wm_announce "check4"
accum 7 abort_if_not_equal 1
accum 4 abort_if_not_equal 1
accum 1 abort_if_not_equal 1
wm_announce "Left side WON!"
accum 0 set 1
trigger self resetit
}
trigger check__5
{
wm_announce "check5"
accum 8 abort_if_not_equal 1
accum 5 abort_if_not_equal 1
accum 2 abort_if_not_equal 1
wm_announce "Left side WON!"
accum 0 set 1
trigger self resetit
}
trigger check__6
{
wm_announce "check6"
accum 9 abort_if_not_equal 1
accum 6 abort_if_not_equal 1
accum 3 abort_if_not_equal 1
wm_announce "Left side WON!"
accum 0 set 1
trigger self resetit
}
trigger check__7
{
wm_announce "check7"
accum 1 abort_if_not_equal 1
accum 5 abort_if_not_equal 1
accum 9 abort_if_not_equal 1
wm_announce "Left side WON!"
accum 0 set 1
trigger self resetit
}
trigger check__8
{
wm_announce "check8"
accum 7 abort_if_not_equal 1
accum 3 abort_if_not_equal 1
accum 5 abort_if_not_equal 1
wm_announce "Left side WON!"
accum 0 set 1
trigger self resetit
}
trigger resetit
{
setstate cross_1 invisible
setstate cross_2 invisible
setstate cross_3 invisible
setstate cross_4 invisible
setstate cross_5 invisible
setstate cross_6 invisible
setstate cross_7 invisible
setstate cross_8 invisible
setstate cross_9 invisible
setstate circle_1 invisible
setstate circle_2 invisible
setstate circle_3 invisible
setstate circle_4 invisible
setstate circle_5 invisible
setstate circle_6 invisible
setstate circle_7 invisible
setstate circle_8 invisible
setstate circle_9 invisible
accum 1 set 0
accum 2 set 0
accum 3 set 0
accum 4 set 0
accum 5 set 0
accum 6 set 0
accum 7 set 0
accum 8 set 0
accum 9 set 0
accum 0 set 0
}
trigger draw
{
globalaccum 9 abort_if_not_equal 9
accum 0 abort_if_not_equal 0
wm_announce "DRAW!"
wait 1000
trigger self resetit
}
trigger draw_counter
{
globalaccum 9 inc 1
}
trigger check_for_winner
{
trigger self check__1
trigger self check__2
trigger self check__3
trigger self check__4
trigger self check__5
trigger self check__6
trigger self check__7
trigger self check__8
trigger self check__11
trigger self check__21
trigger self check__31
trigger self check__41
trigger self check__51
trigger self check__61
trigger self check__71
trigger self check__81
trigger self draw_counter
wait 250
trigger self draw
}
}
When i press 1 button on 1 side… and then go to the other side i can reselect it… while it says Accum <number> abort is not equal 0… but eh… any idea?
And he doesn’t say “left/right side won!” when someone won… o.o
I havent scripted for some time but AFAIK you have 8 accums per script block and 8 global accums
Accums have bitset operations allowing you use them as a series of booleans. This can be pretty useful for your global accums when you have a lot of simple events you want to track globaly. Otherwise if you are a bit talanted in binary you can do some interesting mathamatical operations by bit setting
if you are really desperate for accums its posible to create a script block and treat it just as a place to hold accums. you then traget it from your current script block when you want to effect the accum and teach the script block when and what it should triggetr when the accums reach a certain value. this is tedious and can make your script long and mess so good mangment of the global accums is a much perferd way to work.
Hmm that’s really smart… i’ll try it 
EDIT: i resplaced 2 Accums for GlobalAccums… but still doesn’t work…
hm… e.g. scriptblock is called “left_buttons” but there are trigger for right buttons, too…
well it was a bit difficult to understand ^^ but i understood your script.
it would be helpful to debug if you say which entities those are and not only what doesnt work, but also the things which Do work…
at the moment i don’T have an idea why it doesnt work.
[QUOTE=isbowhten;177736]hm… e.g. scriptblock is called “left_buttons” but there are trigger for right buttons, too…
well it was a bit difficult to understand ^^ but i understood your script.
it would be helpful to debug if you say which entities those are and not only what doesnt work, but also the things which Do work…
at the moment i don’T have an idea why it doesnt work.[/QUOTE]
http://home.deds.nl/~sqynor/Nieuwe%20map/tic_tac_toev2.map
there’s the .map… i cut it out of my TJ map 
EDIT: FIXED the .map this is the right one =]
I’m really confused… i need it to work…
Please someone help me. ( i know it’s sounds pathetic and that i must do more myself, but i tried alot already bleh )
hmm…
the target key of the script_trigger entities have always a “0” at the end.
e.g. left_1_activate0 but in the script it is called left_1_activate ???
did you change something in your script or in your map after your first post?
[QUOTE=isbowhten;177748]hmm…
the target key of the script_trigger entities have always a “0” at the end.
e.g. left_1_activate0 but in the script it is called left_1_activate ???
did you change something in your script or in your map after your first post?[/QUOTE]
First i had 2 scriptblocks one of Right_buttons and one of Left_buttons. but then i had to use Globalaccums,… which i can;t cause my time attack uses those.
I’ll have a look at that. i didn’t noticed it would put a 0 behind it o.o if u copied it.
Heh, i remember doing a tic-tac-toe minigame. I could send you mine and check what errors you might have made.
Edit: Here it is.
You may use it in your map if you can’t figure out the problem.
I also have a prefab of an unfinished slot machine(needs textures)
[QUOTE=murka10;177760]Heh, i remember doing a tic-tac-toe minigame. I could send you mine and check what errors you might have made.
Edit: Here it is.
You may use it in your map if you can’t figure out the problem.
I also have a prefab of an unfinished slot machine(needs textures)[/QUOTE]
I’ll take a look how u made it :>
PS: the .map i uploaded contain alot of errors… since i copied it. and paste into a NEW map… it renames everything because it’s a copy.
i’ll upload it again… with the right things
Well i tried the Command Printaccum <number>
this is what i tried ( It’s a little part of the script cause im not going to put it on AGAIN lol.
left_buttons
{
trigger left_1_activate
{
accum 1 abort_if_not_equal 0
setstate cross_1 default
accum 1 set 2
printaccum 1 <--- here it writes (G_script)left_buttons: Accum[1] = 2
trigger self check_for_winner
}
trigger left2_activate ETC ETC ETC
{
look at the whole script above in this topic
}
trigger right_1_activate
{
printaccum 1 <--- BUT!!! here it says (G_script)left_buttons:Accum[1] = 0
accum 1 abort_if_not_equal 0
setstate circle_1 default
printaccum 1 <-- (G_script)left_buttons:accum[1] = 0
accum 1 set 1 <-- (G_script)left_buttons:accum[1] = 1
printaccum 1
trigger self check_for_winner
}
}
So 1 way to fix it is to use Globalaccums ( which i don’t have since i used it in my time attack ) and the other way… well i don’t know =o
seems like you have to use globalaccums… perhaps a bug of et… usually the accums should be known in every routine of the buttons block but maybe it is a bug because this scriptname only exists in a target_trigger entity ( i had several problems wiht that entity e.g. i had to trigger antoher target_trigger to be able to trigger two different trigger… i dont know how it exactly was…)
so i would just target e.g. a script_mover (unsolid and trigger-texture -> that you cant see it)
and then give it the same scriptname… well… or do something different to prevent that the scriptname is only the value of that bad target_trigger entity.
however you could use globalaccums and put all your routines referring to the time in the game_manager block and use there only accums
if you are out of globalaccums you could use a accum this set that in a trigger block and trigger it from somewhere else…(Yea, i can’t even understand what im saying)
scripblock1
{
trigger accum1set0
{
accum 1 set 0
}
trigger accum1set1
{
accum 1 set 1
}
}
scriptblock2
{
trigger sth
{
trigger scriptblock1 accum1set0
}
}
Also, don’t forget to use bitsets, as they could be used as accums(slightly improvised) and are UNLIMITED(YES, you may have thousands)
Edit:I have also had anomalies from ET and sometimes adding wait might help, other times i just rewrite the script in a different form.
[QUOTE=murka10;177768]if you are out of globalaccums you could use a accum this set that in a trigger block and trigger it from somewhere else…(Yea, i can’t even understand what im saying)
scripblock1
{
trigger accum1set0
{
accum 1 set 0
}
trigger accum1set1
{
accum 1 set 1
}
}
scriptblock2
{
trigger sth
{
trigger scriptblock1 accum1set0
}
}
Also, don’t forget to use bitsets, as they could be used as accums(slightly improvised) and are UNLIMITED(YES, you may have thousands)
Edit:I have also had anomalies from ET and sometimes adding wait might help, other times i just rewrite the script in a different form.[/QUOTE]
Hmm i can rewrite it… but then again i don’t have any idea how to let it check if it’s 3 on a row… i used the obvious part…
when i saw your script. i didn’t really understand what you did.
EDIT: i see that u used a accum INC alot… i’ll give it a try with like what u did maybe… hmm
Yeah, i know that when i try to teach it always comes out confusive and only way to make someone understand is by instant messaging(ex x-fire).
Reading my own script is also confusive ATM :o
edit: Ahh, now i remember, those INC-s increase the winning conditions that need to be met.
[QUOTE=murka10;177771]Yeah, i know that when i try to teach it always comes out confusive and only way to make someone understand is by instant messaging(ex x-fire).
Reading my own script is also confusive ATM :o
edit: Ahh, now i remember, those INC-s increase the winning conditions that need to be met.[/QUOTE]
I maybe know how you made it.
And i’m going to make the buttons with their own scriptname ( so not like 18 buttons in 1 scriptblock )
And i’m going to try the incing 
I’ll give it a try 
Is Bitset something like Boolean ?
i didn’t understnad it in the upper post…
I’m trying :
Globalaccum 7 abort_if_not_bitset 1
setstate <thingy>
Globalaccum 7 bitset 1
Is Bitset -> make 1
and bitreset -> make 0 ?
So let’s say i want the 7th BIT of Globalaccum 7 to be 1 i have to use Bitset
and if i want it to be 0 i need Globalaccum 7 bitreset 7 ???