Page 1 of 1

Two maps in one

Posted: Mon Feb 21, 2005 3:31 pm
by Pollo_Expresss
Hi all guys.

Well, we (http://www.IceClanWeb.net) on our Clan are working in a mod that allow us to play a little internal league with 5 vs 5 teams by making stock maps in Spearhead some addings (sorry about my english hehe).

The idea is to spawn some objects in determined locations of the map and achieve the idea of a player can?t get through this locations and then he has less ways on the map where he can go.

By now I have achieved to Seal Remagen in two different ways that can be selected by a console cvar.

This is the part of the thread that allow us to select wich part (left side or right side) of the map we want to close.

Code: Select all

liga_escuadras:
	
	local.modificacion = getcvar(liguilla)

	switch(local.modificacion)
		{
		case 1:
			thread izquierda
			break
		case 2:
			thread derecha
			break
		}

end
I know this isn?t hard scripting but well, I?m a poor noob and that is very exciting for me, hehe.

I also know that a switch for only 2 cases is waste the power of the scripting language but probably we add some more features in the future.

And these are the threads that close the two sides:

left side:

Code: Select all

izquierda:

//Barrera en el lado del eje	
//C?digo para el alambre de espinos

	local.alambrada1 = spawn models/animate/barbwire_long.tik
	local.alambrada1.origin = ( 2280 -3180 1)
	local.alambrada1.angles = (0 0 0)
	local.alambrada1.scale = 1.0
	local.alambrada1 solid
	//ocultarla es opcional
	//local.alambrada1 hide

//C?digo para los soportes del alambre de espinos
	
	//Soporte 1
	local.soportea11 = spawn models/animate/barbwire_tetra_post.tik
	local.soportea11.origin = ( 2280 -3245 0)
	local.soportea11.angles = (0 0 0)
	local.soportea11.scale = 1.0
	local.soportea11 solid
	//ocultarla es opcional
	//local.soportea11 hide

	//Soporte 2
	local.soportea12 = spawn models/animate/barbwire_tetra_post.tik
	local.soportea12.origin = ( 2280 -2960 0)
	local.soportea12.angles = (0 0 0)
	local.soportea12.scale = 1.0
	local.soportea12 solid
	//ocultarla es opcional
	//local.soportea12 hide

//Barrera en el lado aliado
//C?digo para el tanque

	local.tanque1 = spawn models/vehicles/tigertank.tik
	local.tanque1.origin = ( 1420 -2675 0)
	local.tanque1.angles = (0 130 0)
	local.tanque1.scale = 1.0
	local.tanque1 solid
	//ocultarlo es opcional
	//local.tanque1 hide

end
right side:

Code: Select all

derecha:

//Barrera del lado aliado

//Conjunto de bengalas para hacer una vaya en el acceso de base aliada al tubo

	//Bengala 1
	local.bengala1 = spawn models/animate/bangalore.tik
	local.bengala1.origin = ( 1745 -290 0)
	local.bengala1.angles = ( 0 180 0)
	local.bengala1.scale = 1.0
	local.bengala1 solid
	//ocultarla es opcional
	//local.vengala1 hide

	//Bengala 2
	local.bengala2 = spawn models/animate/bangalore.tik
	local.bengala2.origin = ( 1745 -340 -25)
	local.bengala2.angles = ( 0 180 0)
	local.bengala2.scale = 1.0
	local.bengala2 solid
	//ocultarla es opcional
	//local.vengala2 hide

	//Bengala 3
	local.bengala3 = spawn models/animate/bangalore.tik
	local.bengala3.origin = ( 1745 -240 -25)
	local.bengala3.angles = ( 0 180 0)
	local.bengala3.scale = 1.0
	local.bengala3 solid
	//ocultarla es opcional
	//local.bengala3 hide

	//Bengala 4
	local.bengala4 = spawn models/animate/bangalore.tik
	local.bengala4.origin = ( 1745 -340 25)
	local.bengala4.angles = ( 0 180 0)
	local.bengala4.scale = 1.0
	local.bengala4 solid
	//ocultarla es opcional
	//local.bengala4 hide

	//Bengala 5
	local.bengala5 = spawn models/animate/bangalore.tik
	local.bengala5.origin = ( 1745 -240 25)
	local.bengala5.angles = ( 0 180 0)
	local.bengala5.scale = 1.0
	local.bengala5 solid
	//ocultarla es opcional
	//local.bengala5 hide

//Esta barrera es compartida por el lado aliado y el lado nazi

//Tanque tapando el acceso de museo al tubo y de biblioteca al tubo

	//Tanque
	local.tanque2 = spawn models/animate/vehicle_german_kingtank.tik
	local.tanque2.origin = ( 2803 -598 -87)
	local.tanque2.angles = (0 0 0)
	local.tanque2.scale = 1.0
	local.tanque2 solid
	//ocultarlo es opcional
	//local.tanque2 hide

	//Ca??n del tanque (van por separado)
	local.ctanque2 = spawn models/vehicles/kingcannon.tik
	local.ctanque2.origin = ( 2715 -598 10)
	local.ctanque2.angles = (0 0 0)
	local.ctanque2.scale = 1.0
	local.ctanque2 solid
	//ocultarlo es opcional
	//local.ctanque2 hide

end
Well the coments are in Spanish because I want my Clan partners to understand it but as far as this is very simple scripting I hope you all won?t have problems in understending it.

By now this works for Remagen and we?ve achieved the objective we as we thought. But during the work I had some questions I would like to ask you all.

I was trying to spawn hedgeohs like the omaha beach ones becouse we can spawn them in gropus and close doors that are bigger than a tank or a truck and I can?t never see any hedgeog on the map. Do someone know what is the tik file we have to call or even if it is possible to call these kind of models by scripting?

And another question. The barbwires I?ve got working were all with the angles (0 0 0) because when I tried to spawn one barbwire with (0 90 0) I saw the barbwire but I could pass throuhg it and can?t use it for my purposes. Do someone know how can I change the angles of a barbwire skeledon like I do with the image ones?

Well, thank you all in advance.

I forgot

Posted: Mon Feb 21, 2005 3:35 pm
by Pollo_Expresss
Well, now I?m trying to get Brest working in the same way too but I would like to make some mine camp apearance stuff to close some ways instead of putting more tanks or trucks.

Do anyone know if a thread can be solid? and if it can, do anyone know how can I script that?

Thankyou again.

Posted: Tue Feb 22, 2005 1:06 am
by Elgan
a thread can be solid?

do u really mean that?

Posted: Tue Feb 22, 2005 1:37 am
by Master-Of-Fungus-Foo-D
solid hread? does he mean like a sting of yarn thread? WHats solid mean? How could you 'solidify' a thread :?

Posted: Tue Feb 22, 2005 1:55 am
by Pollo_Expresss
:oops: :oops: :oops: :oops: :oops: :oops:


Sorry, sorry, sorry, hehehe.

I mean a trigger, hehe.

:oops: :cry: :oops: :cry:

Can a trigger hurt for example be solid and get the player away from passing through a door for example?

spawn

Posted: Tue Feb 22, 2005 4:55 am
by tltrude
Spawn a script_object and "setsize" it to block players. It can also be removed with the command "remove". It will be invisible.

Thanks

Posted: Tue Feb 22, 2005 9:47 am
by Pollo_Expresss
You mean that if I spawn a script_object I don?t have to give it a model?

And can these script_object hurt by itself or have I to spawn another object/trigger to hurt players?

Posted: Tue Feb 22, 2005 11:04 am
by Grassy
Yep, just like this.

//------------------------ to add in a kill brush for player hurt
//------------------------ alter damage level to suit
local.killbrush = spawn trigger_hurt
local.killbrush damage 10000
local.killbrush.origin = ( 2012 -4352 -124 )
local.killbrush setsize ( 0 -2816 -228 ) ( 2084 0 0 )


//------------------------ to add in a clip brush for player blocking
local.clipbrush = spawn script_object
local.clipbrush.origin = ( 4080 4128 -16 )
local.clipbrush setsize ( 0 0 0 ) ( 42 152 568 )
local.clipbrush solid

Thnx

Posted: Tue Feb 22, 2005 12:49 pm
by Pollo_Expresss
Thanks a lot guys

Spawning fire and sound for it

Posted: Tue Feb 22, 2005 1:05 pm
by Pollo_Expresss
Well, I don?t know why but I forget many things that I remember by the way always after sending my messages, well, probably I?m getting old before that I should... hehe.

I remember I was trying to spawn fire In the map but I can?t achieve it. I tried a .tik called inferno and some more.

Do someone here know how can I get it? (In casw it could be done...)

Thanks again.

Posted: Tue Feb 22, 2005 1:29 pm
by Pollo_Expresss
And a last question (...what a boring guy am I ) :

Is it possible to make one of these spawned "brushes" visible?

I mean for to have more accuracy while locating it.

Uff, another question

Posted: Tue Feb 22, 2005 2:17 pm
by Pollo_Expresss
Can you explain me what is each () of this thread:

Code: Select all

local.clipbrush setsize ( 0 0 0 ) ( 42 152 568 )
How works the setsize stuff?

Posted: Tue Feb 22, 2005 3:32 pm
by Pollo_Expresss
Me again hehe.

I found out the setsize work method by searching the forum (well, I think I understood it).

U got to give the trigger an origin and then you set:

setsize = (from origin to -16 form origin to -25 from origin to 0) ( 16 25 40)

I think it works like that but I?m not really sure.

I still want to find out how to spawn fire in a stock map, if someone knows something I would apreciate much the help.

Thanks a lot again.

Posted: Tue Feb 22, 2005 7:38 pm
by lizardkid
alright, before i help you with fire, i want to direct your attention to the little "Edit" button on your posts up there ;) we like updates but please keep it in one or two posts ;)

ok, about the fire, it's VERY simple to spawn anything in a stock map, especially fire.

everyone here likes to assign a lot of variable stuff and use script_dummys, i dont, but i'll show you both ways.

Code: Select all

spawn models/fx/fire.tik "origin" "x y z" "$targetname" "flamey"
thats my way, replace x y z in the origin part with the coordinates...

then the popular way:

Code: Select all

local.fire = spawn script_object
local.fire.model = fx/fire.tik
local.fire.origin = ( x y z )
but to each his own.

you can spawn anything these ways, just know the model value ;)