Home   Help Search Login Register  

Author Topic: Opening and Closing gates in a stockade  (Read 2205 times)

0 Members and 1 Guest are viewing this topic.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Opening and Closing gates in a stockade
« on: 18 Oct 2004, 19:43:47 »
I was inspired by a gate that macguba uses in his Un-impossible mission to write a general script that will enable objects to be moved so as to simulate the opening and closing of a gate.

I do not know if this has been done before or even if anyone would be interested in it so I would be very glad of any comments on this.

Attached are the scripts, a sample mission and a readmefile.
« Last Edit: 18 Oct 2004, 21:10:03 by THobson »

Cpt. Red Nain

  • Guest
Re:Opening and Closing gates in a stockade
« Reply #1 on: 18 Oct 2004, 23:51:31 »
I remember an mission released in may 2002 (http://www.ofpec.com/missions_depot/index.php?ID=308), where u could open and close gates. the author used a script that made 'em disappeare in the ground (while playing a rogue spear sound, 'wuz great  :D).

Offline Blanco

  • Former Staff
  • ****
Re:Opening and Closing gates in a stockade
« Reply #2 on: 19 Oct 2004, 01:03:27 »
I've wrote a security gate script with a codepad.

The difference with my script is that I use a object that represent a button (with addactions) to activate them and the doors open sideways.
Actually, the math was borrowed from another script (author unknown)

Your script is something I couldn't figure out, they sway open, very nice stuff indeed  ;)





« Last Edit: 19 Oct 2004, 01:03:54 by Blanco »
Search or search or search before you ask.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Opening and Closing gates in a stockade
« Reply #3 on: 19 Oct 2004, 08:26:39 »
Blanco - from you that is praise indeed.  Thank you.

It is just a bit of trigonometry that I seem to have remembered from my school days.  Converting from my formulae to the script got a bit complicated because of the need for abs(..) and  ... % 360.  Strip those out and it looks more simple.  I would be very happy to post the proof of the formulae used if anyone is interested.

I have realised the script will not work with negative input angles.  I will have a look at how best to deal with that.

Bye the way the codepad looks very neat.
« Last Edit: 19 Oct 2004, 09:58:31 by THobson »

Dubieman

  • Guest
Re:Opening and Closing gates in a stockade
« Reply #4 on: 19 Oct 2004, 20:30:10 »
Tryed it and it seemed to work fine. Its good that you included angles and inputs for them. I could see this working wonders for a border mission or something of the like.

Hmm POW camps? Civvi's missions? Nice job. :)
« Last Edit: 19 Oct 2004, 20:30:42 by GuiltyRoachKillar »

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Opening and Closing gates in a stockade
« Reply #5 on: 19 Oct 2004, 20:39:37 »
Thanks.  I am glad you like it.

I have fixed it so that negative angles are converted to positive, and whole rotations are ignored.  

As it seems there is not yet anything like this and it may be of use to some people I will submit this soon then.
« Last Edit: 19 Oct 2004, 22:58:04 by THobson »

Offline Blanco

  • Former Staff
  • ****
Re:Opening and Closing gates in a stockade
« Reply #6 on: 20 Oct 2004, 03:24:40 »
it surely opens new objectives...

Search or search or search before you ask.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Opening and Closing gates in a stockade
« Reply #7 on: 20 Oct 2004, 08:24:13 »
Thanks all.  

I have submitted a revised script that deals with silly gate opening angles (<0; >=360).  If a negative angle is needed then using the boolean 'clockwise' to specify the direction of rotation is the thing to use instead.  I have also added an item to the sample mission showing the script being used for an object other than 'wire'.  

The script in this thread is the old one so if you want the latest version please head on over to the Editor's Dept.

Thanks again for you input and encouragement.
« Last Edit: 21 Oct 2004, 17:12:27 by THobson »