Usable static weapons added to existing MOHAA DM maps?

Post your scripting questions / solutions here

Moderator: Moderators

User avatar
IvanTheTerrible
Sergeant
Posts: 55
Joined: Thu Jun 26, 2003 7:35 pm
Location: Upland, CA

Usable static weapons added to existing MOHAA DM maps?

Post by IvanTheTerrible »

Is it possible to add usable static weapons to existing MOHAA DM maps using only scripting? For example: adding a usable flak88 to Southern France. Please understand that I am a scripting noob so detailed responses would be greatly appreciated. I am familiar with editing files to incorporate and modify prewritten script. Also, any suggestions on learning reasources for begining scriptors would be welcome.
Last edited by IvanTheTerrible on Sat Jun 28, 2003 11:25 am, edited 3 times in total.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

i think its possible. you'd have to spawn the weapon, give it an origin, and then spawn a trigger or something. the trigger would have to be axial though. dont really have the time to write out how though, working on a map.
User avatar
IvanTheTerrible
Sergeant
Posts: 55
Joined: Thu Jun 26, 2003 7:35 pm
Location: Upland, CA

Thanks Alki

Post by IvanTheTerrible »

I know how to add static objects to a map so I will attempt to do the same thing with the existing trigger entity.
stuffmess2001
Private
Posts: 6
Joined: Thu Jun 26, 2003 8:04 pm

Post by stuffmess2001 »

when you add the thing to the scrpit what script do you add it too
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

As far as I know yes, you can do it. For that you'll have to modify the original script of the map (I mean, create another script based on the original but w/ your Flakk88). You'll have to save it with the same name of the previous script and make a pk3 file that will "override" the original script. That will make your new map conflict with the original maps, so when playing normal maps, you'll have to remove your pk3 file.

If you want all this, I'm sure someone will help you here (I'm a noob for that).
User avatar
IvanTheTerrible
Sergeant
Posts: 55
Joined: Thu Jun 26, 2003 7:35 pm
Location: Upland, CA

That part I understand...but...

Post by IvanTheTerrible »

I understand how the scripting in the pk3 file overrides the scripting in the original file. The problem is how to spawn a trigger using scripting instead of drawing it into a map like in Radient.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

local.trigger = spawn trigger_multiple
local.trigger.origin = (type in coords of where you want to spawn it)
local.trigger setsize = (specify size) x y z axis.
User avatar
IvanTheTerrible
Sergeant
Posts: 55
Joined: Thu Jun 26, 2003 7:35 pm
Location: Upland, CA

How I hate the Flak 88

Post by IvanTheTerrible »

As always I appreciate the help Alki. Unfortunately, as soon as I add the local.trigger lines the entire pk3 file gets ignored. Here is the script as I entered it for a test:

//Add Usable Flak88
local.flak = spawn script_model
local.flak model "statweapons/flak88turret.tik"
local.flak.origin = ( 225.00 -400.00 30.00)
local.flak.angles = ( 0 90 0 )
local.flak.scale = 1.0
local.trigger = spawn trigger_multiple
local.trigger.origin = ( 170 -560 20)
local.trigger setsize = ( 100 100 100 )
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

copy all the script from the .pk3 into your script

as for the spawning you'll need some more things

local.trigger = spawn trigger_multiple "setthread" "my_thread"
local.trigger.origin = (type in coords of where you want to spawn it)
local.trigger setsize = (specify size) x y z axis.

then have my_thread local.flak.etc... :P
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

maybe save ur pk3 as zzzuser-myflak.pk3
Live to map, not map to live.
-mohaa_rox, .map
moderator
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

How about this instead:

local.flak = spawn turretweapon_german_88mmflakturret

?
Admin .MAP Forums
Image
Head above heels.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Correct me if I'm wrong here:

If we knew how the mg42 can work directly when you spawn it ( how it connects to the mg42.scr ) with triggers and stuff, then: shurely it wont be a problem to make a Flak88 usable in the same way...

Or?
Admin .MAP Forums
Image
Head above heels.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

oh yeah, i got the setsize syntax wrong. :oops:

you have to set the x y z starting vector, then the xyz ending vector. so if you want it to be 100^3, you would type "local.thing setsize (0 0 0) (100 100 100)"
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Muahahaha!

Here you go, a firable flak88, only by scriting...

have the line

Code: Select all

thread spawn_a_flak88
in main ( after level waittill prespawn )

and insert these methods after main:

Code: Select all

spawn_a_flak88:

	local.flak = spawn script_model "targetname" "flak88"
	local.flak model "statweapons/flak88turret.tik"
	local.flak.origin = ( 0.0 -100.0 0.0 )
	local.flak.angles = ( 0.0 0.0 0.0 )
	local.flak.scale = 1.0
	local.trigger = spawn trigger_use "setthread" "fire_flak88"
	local.trigger.origin = ( 0.0 0.0 0.0 ) 
	local.trigger setsize ( -50 -50 -50 ) ( 50 50 50 )
	
end

fire_flak88:
	iprintlnbold_noloc "Bang!"
	local.target = ( 0.0 100.0 0.0 )
	// Start the main gun fire animation.
	$flak88 anim fire_scripted

	// Random wait to give time to the shell to get to the target. 
	wait 1


	// Spawn the explosion animations. 
	local.Exp1 = spawn "fx/scriptbazookaexplosion.tik"
	local.Exp2 = spawn "animate/fx_mortar_dirt.tik"
	local.Exp3 = spawn "animate/fx_mortar_higgins.tik"

	// Shake the ground hard.
	exec global/earthquake.scr .23 4 0 0

	// Get the animations going.
	local.Exp1.origin = local.target
	local.Exp1 anim start

	local.Exp2.origin = local.target
	local.Exp2 anim start

	local.Exp3.origin = local.target
	local.Exp3 anim start

	wait 1

	// Remove the animations.
	local.Exp1 remove
	local.Exp2 remove
	local.Exp3 remove

end
- There is no fire sound when the flak88 fires.
- It is only activateable by the trigger, not really usable as an mg42.
- But that, you can probably work out for your self.

This is just to tell you it can be done. Hope that helps.

This was funny :D
Admin .MAP Forums
Image
Head above heels.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Oops! I did it again...

... a new tutorial: Creating a triggerable Flak88 in a multiplayer map
Admin .MAP Forums
Image
Head above heels.
Post Reply