it's me again -.- build a func_constructible via trigger_multiple


(isbowhten) #1

problem:
i make a tunnel:
in the tunnel is “the first blockade” destroyable by allies with one dynamit…
the scond blockade should be destroyed only if it had been dynamited from two sides (becaus it is a big blockade).
this doesnt work but i think i can fix it.
the third blockade isn’T a blockade yet.
there are two triggerobjectiveinfo entities:

scriptname stutzetoi(well strange name… i’m german ^^) :track: the dangerous part
scriptname blocktoi :track: the third blockade

in my script is set the first one default, the second one invisible…
BUT is see the track of the second one !
at first there isnt a blockade:
you can built sustainer: now the “the dangerous part” toi is set invisible and the multiple entity, too…

IF the multiple entity is default because you didnt built the sustainer;
the multiple entity should set the third blockade default… i treid it, i see it, but i walk through it.
now there is a third blockade:
you can dynamit it: the “the third blockade” toi is set invisible and the “the dangerous part” toi is set default…
now things begin from new…
if you build the sustainer the multiple entity doesnt set the third blockade default…
(axis could destroy the sustainer)
if you dont build it… you walk a bit and then the 3rd blockade is behind you.

as i have said i walk Through the 3rd blockade and i cant blow it up, no sound “dynamit” planted appears.
so i think the multiple entity cant “construct” the 3rd blockade.

my script is veeery orderless… if you dont want to watch at it just do not watch at this:

game_manager
{
spawn
{
wm_allied_respawntime 1
wm_axis_respawntime 1
wm_set_round_timelimit 60
wm_setwinner 0
wm_set_defending_team 0
wait 150
setstate defaultallieswobj default
setstate defaultaxiswobj default
setstate 2ndaxiswobj invisible
setstate 2ndallieswobj invisible
setstate bunkerallieswobj invisible
setstate bunkeraxiswobj invisible
setstate lastaxiswobj invisible
setstate 2ndaxis invisible
setstate 2ndallies invisible
setstate bunkeraxis invisible
setstate bunkerallies invisible
setstate lastaxis invisible
setstate defaultallies default
setstate defaultaxis default
setautospawn defaultallieswobj 1
setautospawn defaultaxiswobj 0
wait 300
alertentity defaultaxis
alertentity defaultallies
}
}
( do not correct the spawns, thats not my problem yet)

second1 (TOI… 2nd blockade which must be destroyed by two dynamites)
{
spawn
{
globalaccum 0 set 0 ( it shoul solve the problem that one dynamite blows it up but it doesnt)
}
}
second2 (the other TOI of the second blockade… )
{
spawn
{
globalaccum 1 set 0
}
}

stutze (sustainer func_constructible)
{
spawn
{
globalaccum 2 set 0
constructible_class 3
setstate block invisible ( block= TOI “third blockade” )
setstate baut default ( baut= TOI “dangerous part”)
}
built
{
globalaccum 2 set 1 ( this does not need to be global i correct it later)
setstate stutzemultiple invisible ( the multiple entity)
}
death
{
globalaccum 2 abort_if_not_equal 1
globalaccum 2 set 0
setstate stutzemultiple default
setstate block default
setstate baut invisible
}
}
blocktoi (Scriptname of the “3rd bloackade” TOI )
{
spawn
{
setstate stutzemultiple default
}
}
stutzemultiple ( multiple entity)
{
activate
{
setstate stutzemultiple invisible
setstate block default
setstate baut invisible
alertentity stutze ( my try to set up the 3rd blockade)
setstate stutze default ( " )
}
}
funcfirst (Func_constructible of the first blockade … this works :slight_smile: )
{
spawn
{
constructible_class 3
}

death
{
wm_announce “first blockade destroyed”
}
}
funcseconda (func_constructible first part … (remember: it needs to dynamites) )
{
spawn
{
constructible_class 3
}
built
{
globalaccum 0 set 1 ( acccum 0 and 1 have the status 0 or 1 = not destroyed, destroyed)
}
death
{
wm_announce “second blockade damaged”
setstate secondb default ( <-- both func constructibles were destroyed => set the otherone default… doesnt work)
globalaccum 1 abort_if_not_equal 1 ( if the other one is “destroyed” (globalaccum!), too than set both invisible,… doesnt work)
wm_announce “second blockade destroyed”
setstate seconda invisible
setstate secondb invisible
}
}
funcsecondb (the same with the second part of the second blaockade to danymite)
{
spawn
{
constructible_class 3
}
built
{
globalaccum 1 set 1
}
death
{
wm_announce “second blockade damaged”
setstate seconda default
globalaccum 0 abort_if_not_equal 1
wm_announce “second blockade destroyed”
setstate seconda invisible
setstate secondb invisible
}
}
db (func_constructible of the third bloackade)
{
spawn
{
constructible_class 3
}
built
{
setstate block default (“the third blockade” shall appear beacaus it isnt a “dangerous part” anymore)
setstate baut invisible
}
death
{
setstate block invisible ( the other way round)
setstate baut default
}
}

it is veeery orderless… if you answer to THIS mess:: THANKS²

súmmary:
1st bloackade: 1 dynamit
2nd blockade: 2 dynamites
3rd bloackde: only if no sustainer built (via multiple entity)

all destroyable things are func constructibles targeted by TOIs
the first blockade works.
i think the reason for the problems is: setstate or alertentity don’T work with func constructibles.
THAAAAANKS


(th0rn3) #2

I havent tried but it should work:
if you want your blocade to be destroyed with 2 sticks of dyna, make it 2 stage constructable (see original documentation).
Another way is to make 2 separate constructables.
It is late at night and my brains are out. But i think i will write a script tomorow


(isbowhten) #3

i have 2 constructibles but the dynamit blows up both… they have different TOIs and targetnames etc…
but the biggest problem… how to built a constructible via script?
AND thaaaaaaaaaaanks for replying


(th0rn3) #4

This just got in mind xD
Now the crazy way:
i have saw there are something like dynamite planted and dynamite defused (triggers or recursions?). Examlple for better understanding:


blocade{
dyna planted
{
      globalaccum 6 inc 1
      globalaccum 6 trigger_if_equal 2 blockade check
}
dyna defused
{
       globalaccum 6 dec 1 (does dec (decrease) works here?)
       trigger blocade reset
}
trigger check
{
       globalaccum 6 trigger_if_equal 2 blocade count
}
trigger count
{
        wait 1000
        globalaccum 7 inc 1
        globalaccum 7 trigger_if_equal 30 blocade death
}
trigger reset
{
        globalaccum 7 set 0
}
}

NOTE: dyna planted and dyna defused is not actual commands, replace em w real (cant remember).
this is a rough and not checked script, but theoricaly it should work


(isbowhten) #5

great :slight_smile:
it should be possible to make two dynamitareas out of it if this works… i try it our tomorrow
very thanks

but still: the problem with the sustainer isnt solved yet.
it isn’t urgent to be solved!
just help if you want. don’t hurry.
i’m even happy if just anybody like th0rn3 answers :slight_smile:


(th0rn3) #6

ok, I just looked at the ETScript and found out the commands
“defused” and “dynamited” should work.
And instead of dec “globalaccum 6 inc -1”
BTW: when saying

i’m even happy if just anybody like th0rn3 answers
you mean you will be happy if someone will anwser my style or you will be happy if someone will like my anwsers?
P.S. Im a c++ programmer :smiley:


(isbowhten) #7

ûh … english language xD
that’s german-english xD
i cant speak it as well i want to


(isbowhten) #8

btw: a too short question to make an thread of it…
allies: the satel charge is shown on the CM
axis: such a sing as if ýou havent a CM yet… black with orange frame is shown
why???
and again… how to “built” a fund_constructible via a trigger_multiple? :slight_smile: it doesnt seem to work


(RayBan) #9

[QUOTE=isbowhten;175099]
and again… how to “built” a fund_constructible via a trigger_multiple? :slight_smile: it doesnt seem to work[/QUOTE]

you can use a trigger multiple if you intend some kind of auto construction thing, where a
specfic team or class steps into it and via the script, you simulate a construction.

baserace is a good example of that, but im not shure specificly what you intend or want to
do…


(isbowhten) #10

i just want a func constructble to be built when walking over the multiple:
if you dont build sustainer the tunnel will break together (dont knof if i could translate it that way) behind you. just a simple invisible and default state…
but setstate doesnt work with this… i can see it but i walk through it.


(RayBan) #11

then its an autoconstruction type of thing…

basicly, you have your trigger_multiple target a target_script_trigger
( im going off the top of my head here… )
and give the trigger_multiple a targetname so you can hide it when its not in use like
my_trigger_multiple (for example)

have a func_constrcutible with a target/scriptname, in the script part have a trigger like…
activate or something


my_func_constructible
{
  spawn
  {
    wait 50
    setstate my_func_constructible invisible // invisible to start with.. just ensure it is
  }

  trigger activate  // somone entered the trigger..
  {
    setstate my_trigger_multiple invisible // dont need ppl using this if the thing is built..
    setstate my_func_constructible underconstruction
    wait 10000 // wait 10 seconds.. or how long you want til it builds final..
    setstate my_func_constructible default // reveal it built
  }
}

or something like that…


(isbowhten) #12

in a older post i said: setstate or alertentity don’T work with func constructibles.
I can WALK THROUGH it


(RayBan) #13

oh right… the gas… =P

well, then you have to fake it somehow…
use a func_static… or maybe a script_mover with explosive damage only or something…


(isbowhten) #14

i tried it with func static … but i couldnt figure it out… i need a help !

to prevent mistakes… i explain my plan again to you guys (i really treid out everything a n00b like me would think of):

A B
A is the place where nothing is …
IF you built in place A the sustainer B is inactive, B is the multiple
=> A -
IF you dont build it …
A turns to the third blockade in the tunnel … the tunnel broke into because of no susatiner.
A B
A: no sustainer
B: ACTIVE multiple C=third blockade;
=> C B
it should stay this way => multiple is invisible again
=> C -
you know what i mean?


(isbowhten) #15

question:
can i blow up a not-targeted func_constructible?
(i don’T hope so becaus i have the problem that both func_constructibles blow up wehn i dynamite only ONE TOI)
if not ( :slight_smile: ) then i would be able to control the deaths of the func_:constructibles via script


(th0rn3) #16

When you have a constructable thing TOI means that if the engineer is in the toi, targeted func_constructable will be constructed. When it is constructed another automatic toi (whitch you never see and can not modify in any way) is created around func_constructable. That auto toi is used for destruction. So generaly if you have 2 func_constructables near each other theyr auto toi’s will be inside each other and dyna (or sachel) will be planted in both auto toi’s. I hope you understand my worst explained sh*t


(isbowhten) #17

i understaood very well BUT now i have no idea to deal with my plans :frowning:
well… anytime a good idea comes on my mind i hope ^^


(th0rn3) #18

I think this ex can help (not tested):


fencing_p1
{
      spawn
      {
            constructable_class 3
            setstate f1 default
      }
      death
      {
            setstate f1 invisible
            globalaccum 7 inc 1
            trigger fencing_con check
      }
}
fencing_p2
{
      spawn
      {
            constructable_class 3
            setstate f2 default
      }
      death
      {
            setstate f2 invisible
            globalaccum 7 inc 1
            trigger fencing_con check
      }
}
fencing_con
{
       spawn
       {
             constructible_class 3
       }
       build start
       {
             setstate f1 underconstruction
             setstate f2 underconstruction
       }
       built
       {
             setstate f1 default
             setstate f2 default
        globalaccum 7 set 0
       }
       decayed
       {
             setstate f1 invisible
             setstate f2 invisible
       }
       death
       {
             setstate f1 invisible
             setstate f2 invisible
             trigger fencing_p1 death
             trigger fencing_p2 death
        }
        trigger check
        {
              globalaccum 7 trigger_if_equal 2 fencing_con death
        }
}

fencing_p1 and p2 are func_explosives and fencing_con is func_constructable.
Ouch, wrote this w my mobile


(isbowhten) #19

well … it shoul completely look like a normal func_constructible… with the “you are near” from the TOI and the dynamite planted sound…
but this script put a shining lamp above my head ^^
i think this should work… i try out it later:
FC = func_cosntructible

FC FC
Toi1 Toi2 i think this area to destruct FCs is like a circle…
=> if i put them in the air as high as area is high then the other one wouldnt be hit… i just have to put small unseeable brushes as a FC and then target F_explosives…
A very Big tanks to your mobile :wink: xD

PS: i wouldnt matter if you wait with replying as long as you want :wink:


(isbowhten) #20

^… i had time to test it earlier as i thought ^^
it works :slight_smile: BUT
what means (in the console many times):
Com_sprintf: overflow of 3 bytes buffer
what did i wrong ?