Vultr.com - Instant Cloud Server Deployment
=KGC= 20 MEMBERS:
Home
Forum
News
Share on Facebook
Share on Twitter
Share on Google+
Forum Home > All > Modding
willmineforfoodPM
#1
Modding
Jun 20, 2013 3:06 PM
Non-member Joined: May 16, 2013
Posts: 35
So I'm trying to spawn towers as a normal object. Here is my script can anyone (Scooby) tell me why its corrupting

Add under objectspawns.rfa

Object.create USAirTowerSpawner
Object.absolutePosition _________________
Object.rotation _______________
Object.setOSId 0


Will
willmineforfoodPM
#2
Jun 22, 2013 10:28 AM
Non-member Joined: May 16, 2013
Posts: 35
ok so I've managed to spawn towers . It turns out Scoob that I had to add them under the staticobjects.rfa instead of objectspawns.rfa

The only problem I have now is when someone else joins the game or the map restart all the towers despawn . So how can I lock them ?


Object.lockobject 1 ???????
Will
scoobyscoobyPM
#3
Jun 24, 2013 12:45 PM
=KGC= Scooby Member - Joined: Oct 18, 2012
Posts: 177
Hi Will, first you need to use one of your Objectspawntemplates in the objectspawntemplates.con for your tower, so;

ObjectTemplate.create ObjectSpawner Jeepspawner
ObjectTemplate.setObjectTemplate 2 o_airtower_us1
ObjectTemplate.setObjectTemplate 1 o_airtower_us1
ObjectTemplate.SpawnDelay 30
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.TimeToLive 120
ObjectTemplate.Distance 200

Then you need to add the following into your objectspawn.con file;

rem -----------------------------------------
rem --- Jeepspawner ---
rem -----------------------------------------
Object.create Jeepspawner
Object.absolutePosition 399.24/36.28/413.08
Object.rotation 151.57/0.00/0.00
Object.setOSId 1
Object.setTeam 2

So the Jeepspawner spawns a tower, obviously change the absolute position, rotation etc to be where you want the tower to spawn. That's it.

You probably know it but server side you cannot add templates into any of the .con files, you can only modify them. If you try and add templates you get the corrupt data message.

Hope this helps, let me know if you need any more help

Scooby
willmineforfoodPM
#4
Jun 25, 2013 10:09 AM
Non-member Joined: May 16, 2013
Posts: 35
Ok yea I've figured it out by now but thankyou for your reply . The only problem I have now is I don't think this can be done on Dart due to the fact that it already spawns a o_airtower_m(1) , (2) and (3) on the original map . Witch is why it keeps despawning , but I think I've found a way around this simple under the

ObjectTemplate.setObjectTemplate (1) and (2)

Leave it blank and it will not spawn the tower then I will borrow the JeepSpawner . Reply back and let me know what you think and I'll give it a go .

I've modded a couple maps for the SnS server but they really want some towers

Another Question I had is on the menu/init.con you can change the map name under game.setServerBrowserMapName "Example" , Now I can change this to whatever I want and it works client side but for some reason when I test this server side it corrupts any ideas there??????? Thankyou
Will
scoobyscoobyPM
#5
Jun 28, 2013 1:02 PM
=KGC= Scooby Member - Joined: Oct 18, 2012
Posts: 177
OK, but if your modding Dart and you want towers just add tower spawns into the objects.con file;

Object.create UsAirTowerSpawner
Object.absolutePosition 1420/21.207/1619.5
Object.rotation -90/0/0
Object.setteam 2

For the name. So open the map you want to change the name off, go to the 'Menu' file and open it, then open the Init.con file, you will see the following code line;

game.setServerBrowserMapName "OPERATION FLAMING DART" Change the text in the speech marks and your done.

Hope that helps buddy

Let me know if you need any more help

Scooby