Cannot use tank MG42 + Globalaccum value lost [SOLVED]


(Yatta_Yatta-O_o) #1

Two problems …

First one sounds like a classic question yet I didnt find the answer by searching the forum :

I have a tank (jagdpanther), going along his path under certain conditions, it has his body, tracks & turret, everything works fine except for the mounted MG42.
The mg is attached at the right position on the tank and moves with it, but players cant use/enter it.
I’ve read something in the forum about the player not being able to use the mounted mg is the tank is ‘dead’. But I dont know how the game knows if the tank is dead or not (btw this tank is NOT damageable/repairable). Ive trie alertentity in the tank spawn but this doesnt seemed to has any effect. So … how to set the tank ‘alive’ so i can use the mg ?

[GLOBALACCUM ISSUE SOLVED]
[i]Second question, this sounds like a bug :
I have a globalaccum (globalaccum 8 to be precise) to verify the state of a tank barrier.
The initial value is 1 (for destroyed) and will be 0 if the tank barrier is built.
If the barrier has not been built, the tank runs fine. If the barrier has been built, the tank stops. But heres come somthing unexpected :
If the barrier is not built, but the axis (axis are escorting the tank) build their command post, when the tank comes to the barrier it will stop (on globalaccum conditions) altough its not here.
So I’ve checked everything I could think off and here is the report :

  • the “globalaccum 8” (state of the barrier) is only used for this barrier stuff.
  • It is set to 1 at game_manager spawn and on barrier build final event, and set to 0 when on the barrier death event. It is never used elsewhere
  • The commandpost scripts doesnt use any accum/globalaccum
  • The commandpost entites have nothing that could cause interferences with the barrier constructible (targetnames, scriptnames, track …)
  • Checking with script (globalaccum 8 trigger_if_equal), before the command post is built, the globalaccum 8 is correctly set to 0 or 1 depending if the barrier has been built. Once the command post is done, the same check will not work (neither trigger_if_equal 1 or 2 will trigger anything), wich sounds like globalaccum 8 doesnt exists anymore / is Null.

So … how come doing something apparently totally unrelated to globalaccum 8 can have an influence on it ? It is still possible (and most probable actually) that I messed up somewhere in my checks, and I will check again, but Ive been fighting this for quite some time now so I tought about asking here …[/i]
Solved : The world of computers and scripting is mysthical. One minute you have an incomrpehensible bug and you write about it, the next minute the bug has just vanished. Oh well, Im used to it now. I just wish it did earlier @_@ … and that it wont come back, of course.


(Shaderman) #2

I’m not 100% sure but AFAIK there’s a limit of 8 accums / globalaccums counted from 0 to 7. If i’m right, there’s no globalaccum 8 :slight_smile:


(Yatta_Yatta-O_o) #3

I’ve briefly tought of that, but didnt had time to try to change it. However, altough it might explain why it didnt work, it does not explain why it DID work (and works now @_@ …).

Btw, since I’ve got an extra question since the globalaccum autosolved itself, how to get a tank commandmap marker (attached to the tank, of course @_@ …) ? =P


(Shaderman) #4

By setting the “compass” flag for the script_mover?


(Yatta_Yatta-O_o) #5

Am i not supposed to link the mover to a commandmap_marker some way ?


(EB) #6

I have used 1 through 9 and the map worked fine, they still play it on Forward Momentum servers.

You probably could, but why bother ? Use the compass spawn-flag.


(Shaderman) #7

I was wrong again :banghead:

Taken from Chruker’s site:

Each scriptblock has its own private set of 10 registers, numbered 0-9. These are accessed via the accum command.
All scriptblocks shares a single set of 10 registers, numbered 0-9. These are accessed via the globalaccum command.

Amen!


(S14Y3R) #8

Oh yes, there’s more! each register can use bitset 0-9 instead of setting accum 1, you can set accum 1 bitset 1, accum 1 bitset 2…
Global accums too can use bitset. (globalaccum 1 abort_if_not_bitset 1) to your hearts content :slight_smile:


(Yatta_Yatta-O_o) #9

Thank you for the replies. What about the tank mg42?


(Shaderman) #10

From what I see in the Goldrush script, I’d say the alertentity method should do it. Maybe it doesn’t work because you tried to alertentity the entity itself? I’d try that alertentity from another script block.


(Shaderman) #11

Found something else on Chruker’s site:

allowtankenter <yes|no>
Allow player to mount the current entity.

allowtankexit <yes|no>
Allow player to unmount the current entity.

Never seen those commands before (there are some other interesting ones on this site…) :eek2:


(Yatta_Yatta-O_o) #12

Heh, Ive found what the problem was.
To be able to use a mounted gun / mg42 on a tank / script_mover, you have to set the mover a “health” key with a non-null value, else it will consider itself ‘dead’ therefore not allowing the player to use the mg. Solved =)