Author Topic: Rooms  (Read 2794 times)

0 Members and 1 Guest are viewing this topic.

Offline CarlHamilton

  • Major(1)
  • Posts: 29
Rooms
« on: September 13, 2007, 12:09:44 pm »
Script Name: Rooms
Script Description: Adds the possibility to define static teleporters in maps
Original Author(s): CarlHamilton
Core Version: 2.6.2
Code: The move procedure
Code: [Select]
//checks player locations and moves when needed
procedure move();
begin
if (active) then begin
//player
for i:= 1 to 32 do begin
   getplayerxy(i,x,y);
   if (getplayerstat(i,'active')) then
   //pair
   for j:= 1 to nrpairs do
      //location
      for k:= 1 to 2 do
            //it is a set coordinate {=not (0,0)}                       
         if ((paira[j][k][1]<>0) or (paira[j][k][2]<>0)) then
            //long enough since last move
         if ((paused[i] = 0)
            //shorter distance than radius
            and (distance(x,y,paira[j][k][1],paira[j][k][2]) < paira[j][k][3])
            //it isnt a oneway
            and (paira[j][k][4] <> 1))
            //right team, or any team allowed
            and ((getplayerstat(i,'team') = paira[j][k][5]) or (paira[j][k][5] = 0))
            //clear to move
            then
         begin
            //destination is opposite from starting point
            l:= iif(k=1,2,1);
            moveplayer(i,paira[j][l][1],paira[j][l][2]);
            //stop the player from warping again too soon
            paused[i]:= pause;
         end;
end;
end;
end;

Comments:
Go ahead and test it on ctf_laos which already has set coordinates (check the .ini file in coords)
Please go ahead and use this script if you're a mapper, I'm hoping it would add a new aspect to
maps in soldat
You might want to mark the warp zones on your map some way (doors, shiny ray, sign etc) since otherwise it's kind of hard to know where they are

Notes:
First map on server activation doesn't load its coordinates, after that it's done automatically
Use the /loadco command to manually load coordinates
Dont use the coordinate (0,0)
The script doesn't work on bots
The minimum time (in whole seconds) between warps is set with the 'pause' constant
The max number of pairs is set with the 'nrpairs' constant - this should be higher or equal to the highest number of pairs in a map
Saved maps and compiled maps have coordinates that differ (in PW at least) so use ones from the compiled map
Check the text file in the coords folder for more info on setting coords

Offline Corvis

  • Major(1)
  • Posts: 1
Re: Rooms
« Reply #1 on: September 13, 2007, 01:39:58 pm »
thanks script but
 for j:= 1 to nrpairs do
?

Offline Ride

  • Soldier
  • **
  • Posts: 199
    • NA Soldat Clan Website
Re: Rooms
« Reply #2 on: September 13, 2007, 02:31:08 pm »
and can u place it in a zip file.. not rar please
Ingame Name: TC ~ Ryde.Lf ~
Past Clans: ^Re/ ~ -eO:

Offline miketh2005

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 668
  • What's the URL for www.microsoft.com?
Re: Rooms
« Reply #3 on: September 13, 2007, 02:49:13 pm »
ZIP SUX! RAR ROCKS!
Quote from: 'Ando.' pid='12999178' dateline='1309046898'
My new password is secure as shit :)
Mate, I am not sure Shit is even secured nowadays.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Rooms
« Reply #4 on: September 13, 2007, 03:37:00 pm »
I prefer zip so I can not have that annoying window coming up with I open a file with winrar.

Offline KeFear

  • Soldier
  • **
  • Posts: 181
  • ARSSE Creator
Re: Rooms
« Reply #5 on: September 14, 2007, 10:30:40 am »
just use wincommander.. you don't have to use winrar then.

By the way: nice script, hope to see some cool maps with it :)

Offline Dusty

  • Veteran
  • *****
  • Posts: 1015
Re: Rooms
« Reply #6 on: September 20, 2007, 10:20:27 am »
WinRAR rules.
Sounds very nice, but I'm kinda not-into-scripting-thingies so I'm too lazy to try it out.
« Last Edit: September 20, 2007, 10:22:17 am by Dusty »

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Rooms
« Reply #7 on: September 20, 2007, 09:49:52 pm »
So why post? Sheeesh.

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Rooms
« Reply #8 on: September 25, 2007, 02:10:10 pm »
I'm not really getting the scortcuts you use to do if GetPlayerStat(**,'Active') etc... if (active) then begin???

and I didn't find paira as a variable anywhere... and j k and i weren't there either, and I never figured out how to make my own procedures or functions...

I dunno, maybe I'm just out of date, I could use some scripting help...

why does everyone else stuff that I can't figure out how to use T_T
« Last Edit: September 25, 2007, 02:12:18 pm by Kavukamari »
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline Master Chief43

  • Soldier
  • **
  • Posts: 223
  • When life gives you lemons, eat them :D
Re: Rooms
« Reply #9 on: September 30, 2007, 03:16:44 pm »
This is a nice script for a Halo map... (you know... the teleporters...)
In-Game Name: "Master Chief43"
Favorite Map: ctf_Ash
Favorite Mods: Special Operation 2.0, Original Soldier 1.9
Favorite Guns: [MP5][AK74][socom][Barret]