I want to have a cannon which can be controlled by two func_invisible_user entities ( or do buttons better jobs at this?).
one button/invisible_user is for horizontal aiming, the other one for vertical aiming.
so the cannon has to rotate! i tried it with the scriptcommand faceangles.
i couldnt figure it out!
do you have any hints for me how to cope with it?
controllable cannon
theres already a topic like this somewhere on the board, somebody wanted to put a panzer on a mg42, and it could only be done with a new mod, or with buttons for horizontal vertical as you say, so if you use search you may find something
now i have the following script:
(problem: it faces the angles once only)
horizontalright //invisible_user
{
activate
{
accum m inc 1
trigger global movehorizontal
}
}
horizontalleft //invisible_user
{
activate
{
accum m inc -1
trigger global movehorizontal
}
}
cannon //script_mover
{
spawn
{
accum m set 4
}
trigger movehorizontal
{
trigger self eins
trigger self zwei
trigger self drei
trigger self vier
trigger self funf
trigger self sechs
trigger self sieben
}
trigger eins
{
accum m abort_if_not_equal 1
faceangles 0 90 0 1000
resetscript
}
trigger zwei
{
accum m abort_if_not_equal 2
faceangles 0 75 0 1000
resetscript
}
trigger drei
{
accum m abort_if_not_equal 3
faceangles 0 60 0 1000
resetscript
}
trigger vier
{
accum m abort_if_not_equal 4
faceangles 0 45 0 1000
resetscript
}
trigger funf
{
accum m abort_if_not_equal 5
faceangles 0 30 0 1000
resetscript
}
trigger sechs
{
accum m abort_if_not_equal 6
faceangles 0 15 0 1000
resetscript
}
trigger sieben
{
accum m abort_if_not_equal 7
faceangles 0 0 0 1000
resetscript
}
}
accum m?
You can’t use ‘accum m’… you have to use a number as index, like ‘accum 0’.
it stills moves once only 
(btw: can i set faceangles accum(1) accum(2) accum(3) or something like that?..
it would rotate nicer if i could set values of accums instead of numbers)
Because this is a rule of the script language.
In RTCW or W:ET scripts, accums always take an accum number as identification, not a name.
okay…
the accum inc command changes the value of the accum… why does it rotate once only?
are accums only known in the same routine? so the accum inc command has no effect?
i saw something interesting… perhaps it helps…
if i activate the invisible_user again before the rotating has been completed, the script_mover starts rotating again from the same position as it had at the beginning…
cause i dont know if i explained it good enough:
it moves from A to C when i led it complete the rotation.
if it is on the point B between A and B it starts rotating from A again.
Put a wait statement in the script for your func_invisable_user so it can’t be triggered again until it times out.
I use a script very similar to this to prevent triggered sounds from playing again until the first instance is completed.
something
{
spawn
{
accum 1 set 0
}
trigger something_activate
{
accum 1 abort_if_not_equal 0
accum 1 set 1
do_something_here
wait 2500
accum 1 set 0
}
}
if i set accum 0 to 1 in routine a and i use accum 0 in routine b… is accum 0 of routine 1?
what i mean is: my cannon moves once only…accum 0 is decreasesd/increased in a routine of the button…
but the values (accum 0 abiort_if_not_equal x) are used in the script_mover routine.
might that be the reason that the accum of the script_mover routine won’T be changed??
Accum command is local. It means that it affects on the scriptblock it is in only but every scriptblock can have it’s own accum ofc. If you want to make an accum that affects on everywhere in the script file, use globalaccum.
Do your gun work now? I made one too, just for fun, it works with four buttons for up, down, left, right. it has a 120 degree in x (left-right in 20 degree steps) and 30 degree in z(up-down in 10 degree steps) If you, or someone else is interested, just ask
and I upload it
… mayby I make it shootable too (just made movement of the gun, but the rest is easy)
Done! it is possible to shoot now 
i also did something similar but my version was more like a commandmap based shooter like in hl1.
it has 10 x and y steps and it moves a model with tags that i have attached 4 shooters and some timers.
this controllable cannon is more like a time expensive thing, nothing difficult.
well… my gun only moves horizontal… because i was too lazy to add movement for vertical moves ^^
you can shoot with your gun?
tell me how xD i have an idea… e.g. accum 1 abort_if_non_equal 3 followpline… something in that way… there are different targets which depend on the accum…
but there would be many entities after doing this 
well… upload your gun plz xD
http://www.file-upload.net/download-698013/gun.zip.html
for sure there are easier ways to do that, but this one is mine …
lol
i got a funny idea…
instead of target entites… i only “throw” with doors with an wrong origin and make them crusher
xD
good idea or not?