Scriptproblems in NQ and Jaymod


(kokskeks) #1

Hi Guys,

I posted my problem in several forums, but nowhere i got a helpful answer, i hope you guys can help me.

Ok, Im gonna making a kind of Capture the FLag map, where in the middle of the Map is a Flag, and both, Axis and Allies, can capture it. For capturing they got 5 points, and every second the hold it they got one additional point.

The flag is an wolf_checkpoint

This fires the scriptstriggers allies_capture & axis_capture in the script points

then i got a func_timer and a target_script_trigger for each team. the timers got the targetnames axis_timer_func & allies_timer_func . They are linked to one of the target_script_trigger, which are firing the scripttriggers increase of the scripts axis_timer & allies_timer

So far so good, on ETmain and omnibot the script works, but on NQ and Jaymod, the func_timer will not fire the target_script_trigger, the func_timer is firing nothing, no target_smoke or sth else. A trigger_multiple does his works if i link it to the target_script_trigger

Heres the script

game_manager // scriptname in script_multiplayer entity (this is executed when game starts)
{
    spawn
    {
        wait 400
        
        setautospawn "Allied Spawnpoint" 1
        setautospawn "Axis Spawnpoint" 0
        
            // Objectives
                // 1: just capture the flag in the middle of the map


                // Current main objectives for each team (0=Axis, 1=Allies)
                wm_set_main_objective        1 0
                wm_set_main_objective        1 1
                
                wm_set_defending_team        0
                 
                wm_setwinner        -1

                // Objective overview status indicators
                // wm_objective_status <objective> <team (0=Axis, 1=Allies)> <status (0=neutral 1=complete 2=failed)>
                wm_objective_status 1 1 0
                wm_objective_status 1 0 0

        
               wm_axis_respawntime        10
               wm_allied_respawntime        10
               wm_number_of_objectives 1
               wm_set_round_timelimit        15                

        globalaccum 0 set 0 // Axis points   
        globalaccum 1 set 0 // Allied points


        globalaccum 2 set 0 //check variable if the Axis func_timerr was running one or moretimes  0=no  1=Yes
        globalaccum 3 set 0 //check variable if the Allied func_timer was running one or moretimes 0=no  1=Yes
    
    }



}


points
{

    spawn
    {
        wait 100
    }

    trigger allied_capture
    {
        trigger allied_timer increase
        trigger allied_timer increase
        trigger allied_timer increase
        trigger allied_timer increase
        trigger allied_timer increase
// +5 points
        trigger allied_timer enable_timer_allies    
            

        wm_announce "Allies captured the Flag! +5"
    }

    trigger axis_capture
    {
        trigger axis_timer increase
        trigger axis_timer increase
        trigger axis_timer increase
        trigger axis_timer increase
        trigger axis_timer increase
// +5 points
        trigger axis_timer enable_timer_axis

        wm_announce "Axis captured the Flag! +5"
    }

}

allied_timer
{
    spawn
    {
        wait 100
    }

    trigger enable_timer_allies
    {
        globalaccum 2 trigger_if_equal 1 allied_timer axis_switch // if axis wasnt run onetime dont switch it
        alertentity allied_timer_func // activate the func_timer of allies
        wm_announce "Allies Timer Switched!" 
    }

    trigger axis_switch
    {
        alertentity axis_timer_func     // activate or deactivate the func_timer of axis
        wm_announce "Axis Timer Switched!"
    }

    trigger increase
    {
        wm_announce "Allies +1" 
        globalaccum 3 set 1
        globalaccum 1 inc 1
        globalaccum 1 trigger_if_equal 1 allied_timer allies_1pts    
        globalaccum 1 trigger_if_equal 10 allied_timer allies_10pts
        globalaccum 1 trigger_if_equal 20 allied_timer allies_20pts
        globalaccum 1 trigger_if_equal 30 allied_timer allies_30pts
        globalaccum 1 trigger_if_equal 40 allied_timer allies_40pts
        globalaccum 1 trigger_if_equal 50 allied_timer allies_50pts
        globalaccum 1 trigger_if_equal 60 allied_timer allies_60pts
        globalaccum 1 trigger_if_equal 70 allied_timer allies_70pts
        globalaccum 1 trigger_if_equal 80 allied_timer allies_80pts
        globalaccum 1 trigger_if_equal 85 allied_timer allies_85pts
        globalaccum 1 trigger_if_equal 90 allied_timer allies_90pts
        globalaccum 1 trigger_if_equal 95 allied_timer allies_95pts
        globalaccum 1 trigger_if_equal 96 allied_timer allies_96pts
        globalaccum 1 trigger_if_equal 97 allied_timer allies_97pts
        globalaccum 1 trigger_if_equal 98 allied_timer allies_98pts
        globalaccum 1 trigger_if_equal 99 allied_timer allies_99pts
        globalaccum 1 abort_if_less_than 100
        trigger allied_timer allies_wins
    }

    trigger allies_1pts
    {
        wm_announce "^4Allies did their first points!"
    }

    trigger allies_10pts
    {
        wm_announce "^4Allies: ^2Reaches 10 points"
    }

    trigger allies_20pts
    {
        wm_announce "^4Allies: ^2Reaches 20 points"

    }

    trigger allies_30pts
    {
        wm_announce "^4Allies: ^2Reaches 30 points"
    }

    trigger allies_40pts
    {
        wm_announce "^4Allies: ^3Reaches 40 points"

    }

    trigger allies_50pts
    {
        wm_announce "^4Allies: ^3Reaches 50 points ^3**Finished half of the way**"

    }

    trigger allies_60pts
    {
        wm_announce "^4Allies: ^3Reaches 60 points"

    }

    trigger allies_70pts
    {

        wm_announce "^4Allies: ^xReaches 70 points"
    }

    trigger allies_80pts
    {
        wm_announce "^4Allies: ^xReaches 80 points"
    }

    trigger allies_85pts
    {
        wm_announce "^4Allies: ^xReaches 85 points"
    }

    trigger allies_90pts
    {
        wm_announce "^4Allies: ^1Reaches 90 points"
    }

    trigger allies_95pts
    {
        wm_announce "^4Allies: ^1Reaches 95 points ^3**Have almost won**"
    }

    trigger allies_96pts
    {
        wm_announce "^4Allies: ^1Reaches 96 points"
    }

    trigger allies_97pts
    {
        wm_announce "^4Allies: ^1Reaches 97 points"
    }

    trigger allies_98pts
    {
        wm_announce "^4Allies: ^1Reaches 98 points"
    }

    trigger allies_99pts
    {
        wm_announce "^4Allies: ^1Reaches 99 points"
    }

    trigger allies_wins
    {
        wm_setwinner 1
        wm_endround
    }

}

axis_timer
{
    spawn
    {
        wait 100
    }

    trigger enable_timer_axis
    {
        globalaccum 3 trigger_if_equal 1 axis_timer allied_switch //  if allies wasnt run one or more times dont switch it
        alertentity axis_timer_func // activate the func_timer of axis
        wm_announce "Axis Timer Switched!"
        
    }

    trigger allied_switch
    {
        alertentity allied_timer_func  // activate or deactivate the func_timer of allies
        wm_announce "Allies Timer Switched!"
    }

    trigger increase
    {
        wm_announce "Axis +1"         
        globalaccum 2 set 1
        globalaccum 0 inc 1    
        globalaccum 0 trigger_if_equal 1 axis_timer axis_1pts
        globalaccum 0 trigger_if_equal 10 axis_timer axis_10pts
        globalaccum 0 trigger_if_equal 15 axis_timer axis_15pts
        globalaccum 0 trigger_if_equal 20 axis_timer axis_20pts
        globalaccum 0 trigger_if_equal 25 axis_timer axis_25pts
        globalaccum 0 trigger_if_equal 30 axis_timer axis_30pts
        globalaccum 0 trigger_if_equal 35 axis_timer axis_35pts
        globalaccum 0 trigger_if_equal 40 axis_timer axis_40pts
        globalaccum 0 trigger_if_equal 45 axis_timer axis_45pts
        globalaccum 0 trigger_if_equal 50 axis_timer axis_50pts
        globalaccum 0 trigger_if_equal 55 axis_timer axis_55pts
        globalaccum 0 trigger_if_equal 60 axis_timer axis_60pts
        globalaccum 0 trigger_if_equal 65 axis_timer axis_65pts
        globalaccum 0 trigger_if_equal 70 axis_timer axis_70pts
        globalaccum 0 trigger_if_equal 75 axis_timer axis_75pts
        globalaccum 0 trigger_if_equal 80 axis_timer axis_80pts
        globalaccum 0 trigger_if_equal 85 axis_timer axis_85pts
        globalaccum 0 trigger_if_equal 90 axis_timer axis_90pts
        globalaccum 0 trigger_if_equal 95 axis_timer axis_95pts
        globalaccum 0 trigger_if_equal 96 axis_timer axis_96pts
        globalaccum 0 trigger_if_equal 97 axis_timer axis_97pts
        globalaccum 0 trigger_if_equal 98 axis_timer axis_98pts
        globalaccum 0 trigger_if_equal 99 axis_timer axis_99pts
        globalaccum 0 abort_if_less_than 100
        trigger axis_timer axis_wins
    }


    trigger axis_1pts
    {
        wm_announce "^1Axis did their first points!"
    }

    trigger axis_10pts
    {
        wm_announce "^1Axis: ^2Reaches 10 points"
    }

    trigger axis_15pts
    {
        wm_announce "^1Axis: ^2Reaches 15 points"
    }

    trigger axis_20pts
    {
        wm_announce "^1Axis: ^2Reaches 20 points"
    }

    trigger axis_205pts
    {
        wm_announce "^1Axis: ^2Reaches 25 points"
    }

    trigger axis_30pts
    {
        wm_announce "^1Axis: ^2Reaches 30 points"
    }

    trigger axis_35pts
    {
        wm_announce "^1Axis: ^2Reaches 35 points"
    }

    trigger axis_40pts
    {
        wm_announce "^1Axis: ^3Reaches 40 points"
    }

    trigger axis_45pts
    {
        wm_announce "^1Axis: ^3Reaches 45 points"
    }

    trigger axis_50pts
    {
        wm_announce "^1Axis: ^3Reaches 50 points ^3**Finished half of the way**"
    }

    trigger axis_55pts
    {
        wm_announce "^1Axis: ^3Reaches 55 points"
    }

    trigger axis_60pts
    {
        wm_announce "^1Axis: ^3Reaches 60 points"
    }

    trigger axis_65pts
    {
        wm_announce "^1Axis: ^3Reaches 65 points"
    }

    trigger axis_70pts
    {
        wm_announce "^1Axis: ^xReaches 70 points"
    }

    trigger axis_75pts
    {
        wm_announce "^1Axis: ^xReaches 75 points"
    }

    trigger axis_80pts
    {
        wm_announce "^1Axis: ^xReaches 80 points"
    }


    trigger axis_85pts
    {
        wm_announce "^1Axis: ^xReaches 85 points"
    }

    trigger axis_90pts
    {
        wm_announce "^1Axis: ^1Reaches 90 points"
    }

    trigger axis_95pts
    {
        wm_announce "^1Axis: ^1Reaches 95 points ^3**Have almost won**"
    }

    trigger axis_96pts
    {
        wm_announce "^1Axis: ^1Reaches 96 points"
    }

    trigger axis_97pts
    {
        wm_announce "^1Axis: ^1Reaches 97 points"
    }

    trigger axis_98pts
    {
        wm_announce "^1Axis: ^1Reaches 98 points"
    }

    trigger axis_99pts
    {
        wm_announce "^1Axis: ^1Reaches 99 points"
    }

}

Got anybody of you an idea where is my problem?

If you want i upload the map on my server so you can download it (*.map + compiled pk3 with scripts etc)


(nUllSkillZ) #2

If it works in W:ET etmain and is not working in some mods the mods might have something broken.
But than these entities would also not work in other maps.


(stealth6) #3

yes please, I might be able to help since I made a map that does exactly the same, only difference was that you didn’t get 5 points for capping it.

my version:
http://et.splatterladder.com/?mod=mapinfo&idx=8522

hmm looking at your script I’d say loose the func_timer, and let the script check itself.

I’ve also had problems in NQ and jaymod, but that was with a bobbing entity bobbing more in jaymod and NQ compared to etmain.


(kokskeks) #4

ok here the links

Pk3 File
Map-File

Say if you need more files, but i dont think so


(IRATA) #5

About NQ: Check out g_scriptDebug and g_scriptDebugLevel … could imagine there are similar cvars for jaymod as well …

(This post was done by Der’saidin for real :wink: )


(kokskeks) #6

thanks, didnt noticed that cvar before in NQ … but it only confirmed my suspicion, the func_timer dont fires ~.~


(IRATA) #7

I’m missing a closing bracket for axis_timer at end of file …


(kokskeks) #8

ah sry, the bracket is in the real script there =/, just a posting error


(C) #9

What if You add 2 info_notnull entities with these scriptnames: “allied_timer” & “axis_timer” ?..

You now just write code in mapscript, but there is no entity with a scriptname “allied_timer” nor “axis_timer”…

I see You also use a func_timer and give it 2 targets, “target” & “target2”… i never saw this been done before (allthough i see 2 connecting lines). To my knowledge “target2” does not exist…


(Wezelkrozum) #10

you just make a target_sript_trigger. Add a scriptname to it.
Then you create a script which fires “allies_capture” when the allies capture the spawn:


target_script_trigger
{

trigger allies_capture
{
globalaccum 3 set 0
trigger target_script_trigger allied_timer
}

trigger allied_timer
{
wait (delay of func_timer)
globalaccum 3 abort_if_equal 1 (globalaccum 3 tells us who owns the spawn (1 = axis, 0 = allies)
globalaccum 1 inc 1
        globalaccum 1 trigger_if_equal 1 target_script_trigger allies_1pts    
        globalaccum 1 trigger_if_equal 10 target_script_trigger allies_10pts
        globalaccum 1 trigger_if_equal 20 target_script_trigger allies_20pts
        globalaccum 1 trigger_if_equal 30 target_script_trigger allies_30pts
        globalaccum 1 trigger_if_equal 40 target_script_trigger allies_40pts
        globalaccum 1 trigger_if_equal 50 target_script_trigger allies_50pts
        globalaccum 1 trigger_if_equal 60 target_script_trigger allies_60pts
        globalaccum 1 trigger_if_equal 70 target_script_trigger allies_70pts
        globalaccum 1 trigger_if_equal 80 target_script_trigger allies_80pts
        globalaccum 1 trigger_if_equal 85 target_script_trigger allies_85pts
        globalaccum 1 trigger_if_equal 90 target_script_trigger allies_90pts
        globalaccum 1 trigger_if_equal 95 target_script_trigger allies_95pts
        globalaccum 1 trigger_if_equal 96 target_script_trigger allies_96pts
        globalaccum 1 trigger_if_equal 97 target_script_trigger allies_97pts
        globalaccum 1 trigger_if_equal 98 target_script_trigger allies_98pts
        globalaccum 1 trigger_if_equal 99 target_script_trigger allies_99pts
        globalaccum 1 abort_if_less_than 100
        trigger target_script_trigger allies_wins

trigger target_script_trigger allied_timer
}
}


And that must do the same trick

You can target a func_timer to more than 100 targets :slight_smile:


(C) #11

And that must do the same trick

Ever tried to use accums in such a script?.. it doesn’t work.
His script uses only globalaccums, and that is the reason it could work…
I mean to say: There is a difference if there is an entity (or not) with the scriptname.

btw: i used a func_timer + target_script_trigger too in my UJE_01 map, and it works perfectly… in NoQuarter.
So it’s not NQ going wrong on the timer…

You can target a func_timer to more than 100 targets
Like this? with all different targetnames… so the func_timer has then these keys set: target2, target3 … target99
Or You mean have 100 targets with all the same name, the normal way of multi-targeting…


(ailmanki) #12

globalaccums should be avoided, everything can be solved with local accums


(Wezelkrozum) #13

Well, I use globalaccums because accums never worked for me:mad: And I still can’t manage them.


(C) #14

Accums need an entity with a scriptname.
If there is no entity at all, and there is just some piece of text only in mapscript, then accums don’t work…
They just need an entity with a scriptname that holds the accum values in memory…
A piece of script (like in the previous posts ^^) is not enough.

Globalaccums always work, and can be accessed from any scriptblock.
But it’s like in any program: global vars vs. local vars,… high- vs low spaghetti-ratio…

When i need a script and some accums, but not really need an entity, i always create an info_notnull… This entity does nothing but hold the accum-values in memory. perfect…
Using accums makes code more readable, and (global) values are not spread over the entire mapscript…


(Qualmi) #15

[QUOTE=C;194429]
They just need an entity with a scriptname that holds the accum values in memory…[/QUOTE]

very cool information here :smiley:

about locality, that should really be no problem. just imagine 2 codeblocks at the mapstart looking like this (they all ofc have an entity with a scriptname called block1 and block2)



block1
{

spawn
{
accum 1 set 100
}
}

block2
{

spawn
{
accum 1 set 200
}
}

so there exist now 2 accums with the same name. how can that be…the answer is locality :slight_smile: even if they have the same name, they only count in their specific blocks. so if you enter block 1 and you ask for the value of accum 1 than you should expect the value 100. if you enter block 2 you get 200 for accum 1. if you now do some stuff like

accum 1 inc 1

while you are executing your script in block1, then only the one of block1 gets increased by 1.

so after that code the value for accum 1 should be 101 in block 1 and 200 in block 2. i hope that makes things clearer. caus if i hear that there are problems with accums, i simply assume you dont know that.


(kamikazee) #16

[QUOTE=C;194429]When i need a script and some accums, but not really need an entity, i always create an info_notnull… This entity does nothing but hold the accum-values in memory. perfect…
Using accums makes code more readable, and (global) values are not spread over the entire mapscript…[/QUOTE]Last time I checked, you always needed a script_multiplayer… If you hook the game_manager script block to it, you always have an entity, no?


(C) #17

you always needed a script_multiplayer
true…

If you hook the game_manager script block to it, you always have an entity, no?
I do not know for other mods, but NoQuarter parses the script_multiplayer, and then always renames the scriptname… Here is the code-snippet:

	ent->scriptName = "game_manager";

So no matter what scriptname You give Your script_multiplayer, it will always be called game_manager by the mod…

You are right that You always have an entity :slight_smile: and this game_manager can also use accums…
But i was refering to a more general way of using accums… Maybe You want to make 15 entities that all use (the same set of) accums, then this one game_manager will not suffice…
I could make 15 info_notnull entities, and use, for example, accum 0 in each of those instances… Like Qualmi explained, locally, each one of the 15 info_notnull’s having its own accum 0 in use…

btw: I never tested if an info_null entity can also hold accums, but i guess not, because this entity has a short life; It is removed when it has served its purpose, just after it has spawned…
To be sure accums work, use an info_notnull…