Author Topic: Questions on Trap Creation with CreateTrapAtLocation  (Read 321 times)

Legacy_Oseryn

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Questions on Trap Creation with CreateTrapAtLocation
« on: September 13, 2012, 04:56:50 am »


               I am looking at the AISS respawning trap code and wonder if someone could explain a few things about traps in general, plus perhaps answer a specific code question.

I'm looking at the CreateTrapAtLocation function.
                 
Checking the Lexicon, I have a general understanding of this function, except for a couple of questions.


If I specify a size of 2.0 in CreateTrapAtLocation, does that mean each side of the square is 2.0, with the square is centered at the specified location?
Or, is the trap actually 4.0 meters per side (2.0 from the center of the trap in all directions)?

If a faction is specified for a trap, does that mean any members of that faction can cross the trap as if it's not there?

Can custom factions be set on traps?

Finally, in the AISS code, there's this snippet:


oAISSTrap = CreateTrapAtLocation(iTrapCostant,
lSpawn,
GetLocalFloat(oTrapWP,"fAISS_trap_covered_area")>1.0?GetLocalFloat(oTrapWP,"fAISS_trap_covered_area"):1.0, //physical_size
"ais_fp_trap"+IntToString(nCounter), //tag
STANDARD_FACTION_HOSTILE, //faction
GetLocalString(oTrapWP, "sAISS_trap_disarm"),
GetLocalString(oTrapWP, "sAISS_trap_triggered"));

I don't understand the usage of the 1.0? and the :1.0. Can anyone explain what is going on in:
GetLocalFloat(oTrapWP,"fAISS_trap_covered_area")>1.0?GetLocalFloat(oTrapWP,"fAISS_trap_covered_area"):1.0,

Thanks!
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Questions on Trap Creation with CreateTrapAtLocation
« Reply #1 on: September 13, 2012, 05:18:11 am »


               For the last Question, From the lexicon: ?: Ternary Conditional


First Question: 2.0 per side.  I think it draws from the lower left corner.

Second question:  Half right, Friendly Factions should be able to walk over the trap.

Third Question:  I do not think you can add custom factions, 
               
               

               


                     Modifié par Lightfoot8, 13 septembre 2012 - 04:25 .
                     
                  


            

Legacy_Oseryn

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Questions on Trap Creation with CreateTrapAtLocation
« Reply #2 on: September 13, 2012, 07:50:13 am »


               Thank you. Much appreciated!