Page 1 of 3
Can Some1 help me with Flak88 in multiplayer??
Posted: Wed Apr 28, 2004 1:25 am
by HotShizzle
OK i did everything that it says in rjukan's tutorial...but i want the flak88 to be manually aimable and also to get the flak88 sound in multiplayer you have to do something with the ubersound workaround....but i dont understand how to use that format.....can some1 gimme some code how to make this stuff work

Posted: Wed Apr 28, 2004 12:17 pm
by bdbodger
I made the flak aimable by changeing the scoutmod a little bit to save the position of the hit when you pressed fire while useing the binoculars . The map I made is called the rescue . Not the greatest map around but has some nice features and scripting you maybe interested in like the flak . You can click on my logo to go to my site and download the map if you wish it has the modded scoutmod in the pak .
Posted: Wed Apr 28, 2004 7:10 pm
by HotShizzle
Thanks for the link...but i need code ....if some1 can provide it...like i said i need the flak to be manually aimable and shootable...some code would be appreciated....thank you.
Posted: Wed Apr 28, 2004 7:27 pm
by Phil
You can have a useable flak88.
Posted: Wed Apr 28, 2004 7:28 pm
by lizardkid
do you have SH?
Posted: Wed Apr 28, 2004 9:40 pm
by HotShizzle
You can have a useable flak88
.....this doesn't help me much....and no i dont have SH...i have MOHAA....someone just answer the question
Posted: Thu Apr 29, 2004 5:06 pm
by Bilko
Couldn't you have something like:
Code: Select all
local.target = parm.other
local.flak88.angles = local.target.angles
to the gun look the same way as the player? Just a thought..
Bilko.[/code]
Posted: Thu Apr 29, 2004 7:06 pm
by HotShizzle
umm...where do i put the code...in the flak88 thread?...oh yea also when the explosion happens there is no crater or watever in the ground....how do i do that?
Posted: Fri Apr 30, 2004 12:00 am
by HotShizzle
OK....i just put in that code u told me...its not good...it just makes the explosion blow up where ever i am at....i want when u go up to the flak and when u press use...a scope or like u get control of the flak happens....then u can aim and shoot the flak whereever u want...thats wat i want....thank you
Posted: Fri Apr 30, 2004 9:02 am
by bdbodger
When you press the fire key while looking though the binoculars the game automatically looks for and runs a thread called clickitem_fail you can use that to aim the gun .
Code: Select all
clickitem_fail:
local.fwd_vec = angles_toforward self.viewangles
local.start = self gettagposition "Bip01 Head"
local.range = 5000
local.hit_location = trace (local.start + local.fwd_vec * 64) (local.start + local.fwd_vec * local.range ) 0
local.ent = spawn script_origin origin (local.hit_location - ( 0 0 32 ))
$gun setaimtarget local.ent
$gun waittill ontarget
$gun anim fire
local.ent immediateremove
end
In this thread $gun is the flak88turret
Posted: Fri Apr 30, 2004 7:07 pm
by HotShizzle
Thanks your the first one with a real answer...but wat part of the code should i take out from my script and where should i put this in??...oh yea i need help with the ubersound workaround too...write now my code looks like this:
Code: Select all
// Flak
// ARCHITECTURE: HotShizzle
// SCRIPTING: HotShizzle
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" ""
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "none"
fire_flak88:
// Just a test target. Set it to what you
// would like to destroy.
local.target = parm.other
local.flak88.angles=local.target.angles
// Start the main gun fire animation.
$flak88 anim fire_scripted
// Wait to give time to the shell to get to the target.
wait 1
// Set the animation back to idle ( else the fire
// animation will not work the next fire )
$flak88 anim idle
// Spawn the explosion animations.
waitthread blow_a_place_up
end
$flak88 setaimtarget local.target
blow_a_place_up:
// Just a test target. Set it to what you
// would like to destroy.
local.target = parm.other
// 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
level waitTill prespawn
//*** Precache Dm Stuff
exec global/DMprecache.scr
level.script = maps/Flak.scr
local.master = spawn ScriptMaster
local.master aliascache flak_snd_fire wavfile1 soundparms numbers channel loaded maps "Flak"
local.master aliascache flak_snd_fire wavfile2 soundparms numbers channel loaded maps "Flak"
local.master aliascache flak_snd_fire wavfile3 soundparms numbers channel loaded maps "Flak"
level waittill spawn
end
Posted: Fri Apr 30, 2004 10:40 pm
by Bjarne BZR
Take a look at the map "Dogville" at
http://planetmedalofhonor.com/rjukanproject/
It contains ascript spawned Flak88 with sunds and stuff.
Posted: Sat May 01, 2004 2:20 am
by HotShizzle
I dont understand the code of the map....remember im a beginner to scripting....just make corrections to the code i gave above...
Posted: Sat May 01, 2004 10:39 am
by Bjarne BZR
OK, to be able to help: we need to now more exactly what it is that you want to do.
I take it you want to:
1) Add a Flak88 via scripting.
2) Make a player aim and fire it in some way.
Part one you seem to have managed, and you have trouble with part 2?
How do you want the player to aim the Flak88?
- Attach the player to the Flak88 and aim by using the wiewport?
- Identify a target via binoculars?
- Control the movement and fire via levers?
- Make the Flak88 search for targets by itself?
Also: as you obviously want to perform some serious scripting; have you read the
scripting tutorial @ The Rjukan project?
Posted: Sat May 01, 2004 11:04 am
by bdbodger
Well for a test make a map and in that map put a flakk88_turret on a base and give the flakk a targetname of gun then use this script
Code: Select all
main:
$gun dmprojectile models/projectiles/tigercannonshell.tik
end
clickitem_fail:
local.fwd_vec = angles_toforward self.viewangles
local.start = self gettagposition "Bip01 Head"
local.range = 5000
local.hit_location = trace (local.start + local.fwd_vec * 64) (local.start + local.fwd_vec *local.range) 0
local.ent = spawn script_origin origin (local.hit_location - ( 0 0 32))
$gun setaimtarget local.ent
$gun waittill ontarget
$gun anim fire
local.ent immediateremove
end
the dmprojectile models/projectiles/tigercannonshell.tik is not needed in spearhead maps and may cause a problem in BT so use it just for mohaa maps . Also don't select the sniper rifle because if you do you won't get the binoculars and so you won't be able to fire the flak . You should also make a trigger mulitple and give it a name like flak_trigger then use it like this so that the player has to be standing in a certain spot to fire the flak
Code: Select all
clickitem_fail:
if(self istouching $flak_trigger) // or maybe ( parm.other is touching $flak_trigger)
{
local.fwd_vec = angles_toforward self.viewangles
local.start = self gettagposition "Bip01 Head"
local.range = 5000
local.hit_location = trace (local.start + local.fwd_vec * 64) (local.start + local.fwd_vec *local.range) 0
local.ent = spawn script_origin origin (local.hit_location - ( 0 0 32))
$gun setaimtarget local.ent
$gun waittill ontarget
$gun anim fire
local.ent immediateremove
}
end