Author Topic: WeaponSpawn's like Ut04  (Read 2122 times)

0 Members and 1 Guest are viewing this topic.

Offline Dr.Thrax

  • Major
  • *
  • Posts: 70
    • Lostgalaxy.de
WeaponSpawn's like Ut04
« on: March 22, 2008, 08:32:15 am »
Script Name:WeaponCollecting
Script Description: Weapons spawn in the map at defined places and you can collect them by walking over them
Original Author: Dr.Thrax
Core Version:2.6.3
Code:

This Script is .ini based , that means there is this "Weaponscollecting.ini" where you do all the important stuff:

Code: [Select]
[MAP_N1] // The part you also change in the Weapons-Collect.pas

MapName=Map  // Your Map

Weapon_Limit=0  // Number of Weapon-Spawnpoints
FirstWep=0   // the primary Weapon for default (otherwise it won't function correctly)

Weapon#1=0 // Weapon (by Number (for example 1 fo Deagle)) on Spawn point #1
Weapon#2=0 // Weapon (by Number (for example 1 fo Deagle)) on Spawn point #2
Weapon#3=0 // Weapon (by Number (for example 1 fo Deagle)) on Spawn point #3
Weapon#4=0 ...
Weapon#5=0 ...
Weapon#6=0 ...
...

// I made this script for maximum 20 Weapon Spawnpoints


Weapon#1_Spawn_X= 0 // Spawn_X_coordinate for Weapon #1 (I made a Command "/wep (number of spawnpoint)" for auto save of coordinates. They will be saved in the coordinates.ini)
Weapon#1_Spawn_Y= 0 // Spawn_Y_coordinate for Weapon #1
Weapon#2_Spawn_X= 0 ...
Weapon#2_Spawn_Y= 0 ...
...
...
 // Again maximum 20 SpawnPoints

If you've choosen your map you can simply add it by changing these parts of the Script

Code: [Select]
procedure ActivateServer();
begin
OnMapStart('MAP_N1');
//OnMapStart('MAP_N2');
//OnMapStart('MAP_N3');

end;


procedure AppOnIdle(Ticks: integer);
begin
WeaponSpawn('MAP_N1');
//WeaponSpawn('MAP_N2');
//WeaponSpawn('MAP_N3');
end;


procedure OnJoinTeam(ID, Team: byte);
begin
DisableWeaponsOnJoin('MAP_N1',ID);
//DisableWeaponsOnJoin('MAP_N2',ID);
//DisableWeaponsOnJoin('MAP_N3',ID);
end;


procedure OnMapChange(NewMap: string);
begin
SpawnWeaponsOnNewMap('MAP_N1');
DisableWeaponsOnMapChange('MAP_N1')
//SpawnWeaponsOnNewMap('MAP_N2');
//DisableWeaponsOnMapChange('MAP_N2')
//SpawnWeaponsOnNewMap('MAP_N3');
//DisableWeaponsOnMapChange('MAP_N3')
end;

The functions that go with this Weapons-Collect.Pas are saved in the Core.pas
It's just that its easier to understand , so i put it in a seperate file.

The Weapons will spawn at this Point and if someone takes up the Weapon it will spawn again at the same Point.
I set the secondary weapons active for default , so that you can only collect the primary's

I used it first on my UT04:Bombing Run server (lostgalaxy.de:1100)
and it works quite good!
Have Fun
Dr.Thrax

Edit: The .ini files have to be in the default Soldat Folder
« Last Edit: March 26, 2008, 09:38:36 am by Dr.Thrax »

Offline rumpel

  • Camper
  • ***
  • Posts: 410
Re: WeaponSpawn's like Ut04
« Reply #1 on: March 22, 2008, 10:49:38 am »
cant you make it that the weapons spawns on the spawnpoints? or isnt it possible`?
banned.

Offline Iq Unlimited

  • Flagrunner
  • ****
  • Posts: 864
  • mr. foobar2000
Re: WeaponSpawn's like Ut04
« Reply #2 on: March 22, 2008, 11:12:03 am »
cant you make it that the weapons spawns on the spawnpoints? or isnt it possible`?

Its possible, but its easier if you just set the guns to spawn at the  general area of the spawn instead of going through and messing with the code and adding a whole bunch of GetSpawnStat(1,X); stuff.

Offline pinOi32

  • Camper
  • ***
  • Posts: 339
  • "Bravo kid's bad day"
    • Newgrounds
Re: WeaponSpawn's like Ut04
« Reply #3 on: March 24, 2008, 03:33:22 pm »
err...wouldnt the weapons be hard to see??
Pls use my amazing interface:
http://forums.soldat.pl/index.php?topic=27584


I WIN!!

WHY MY KARMA SUCK??

Offline rhide

  • Major
  • *
  • Posts: 60
  • Coffee-addict
    • Vrastar-Hai soldat clan
Re: WeaponSpawn's like Ut04
« Reply #4 on: March 24, 2008, 03:52:08 pm »
I really like this idea! I was just thinking of scripting my own version... perhaps adding greyish flags where the weapons are, that dissapear when you pick the weapon up
« Last Edit: March 26, 2008, 05:22:17 pm by rhide »
Warning! Division by zero seriously injures yourself and the people in your surroundings.

Proud member of Vrastar-Hai:
http://www.guldheden.com/~erga050/vrastar-hai

Offline Dr.Thrax

  • Major
  • *
  • Posts: 70
    • Lostgalaxy.de
Re: WeaponSpawn's like Ut04
« Reply #5 on: March 26, 2008, 08:16:57 am »
at my map i used a light with the picture of the wapon in it to show where special spawnpoints are

Offline rhide

  • Major
  • *
  • Posts: 60
  • Coffee-addict
    • Vrastar-Hai soldat clan
Re: WeaponSpawn's like Ut04
« Reply #6 on: March 26, 2008, 05:23:03 pm »
cool! I think i'll just try it out :)
Warning! Division by zero seriously injures yourself and the people in your surroundings.

Proud member of Vrastar-Hai:
http://www.guldheden.com/~erga050/vrastar-hai

Offline [eZ]DuckHunter

  • Major(1)
  • Posts: 20
Re: WeaponSpawn's like Ut04
« Reply #7 on: April 14, 2008, 12:54:39 am »
I don't get the commands ! Can you re-explain ? :X