Functional granatwerfer mortar

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

Functional granatwerfer mortar

Post by Cigs »

PEOPLE WHO WANT TO KNOW HOW ... READ THE LAST 10 LINES OFF my LAST REPLY. 8-)

Hi,

I found the granatwerfer-mortar right here; addon_static_props_granatwerfer-mortar

But ingame it's just a non-solid granatwerfer-mortar model.
How can it be made functional?

I read on a post in The Modding Theater it has to be done this way:
You have to put a mortar in the map first (rightclick 2d vieuw: select addon>static>props>granatwerfer-mortar),
with the $targetname "alliedmortar".
Don't put in a "models/statweapons/p_granatwerfer_d.tik" - the "_d" indicates it's the model used when it's destroyed.
I believe it's "models/statweapons/p_granatwerfer_base.tik" that you should be putting in your map.

the script to set the mortar up:

$alliedmortar.collisionent = $granatwerfer_collision
$alliedmortar_turret0.collisionent = $granatwerfer_turret_collision
$alliedmortar thread global/stationaryweapons.scr::MountedStationaryWeaponWithCollision "models/statweapons/p_granatwerfer_base.tik" $granatwerfer_destroyed_collision
$alliedmortar_turret0 maxyawoffset "40"
But actually I don't have enough knowledge to do it so. :s
I mean, I think the layout of the scriptfile will not be ok if I try making the script myself. :?

1)How would the mapname.scr be like if I would just want to have a script for the mortar in it, presuming my map is called "allweaponsroom"?
Can somebody make one for me?
I don't even know how to save a notepad-txt file as an *.scr file

Help me out a bit here :roll:
I know there're some kickass scripters here :)
Thanks
Last edited by Cigs on Fri May 28, 2004 8:58 pm, edited 1 time in total.
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

that is a horrible tut m8, seriously baaaaaaad.
here, i've never made one but it looks easy enough with knowlege of the flak88 etc.


you have your mortar model, now make clipbrushes (common textures, use metalclip) to cover the mortar. that gives it a collision. in other words when you shoot it, it tings off like metal, cool huh?
now it looks as if you have need of two entities, the actual tube and the base, am i right? make two separate collision for them.
okay, now select all the brushes of the clip brush (all of them, don't leave any out.) for the tube, and right click and go to script_object. give it the targetname of $granatwerfer_turret_collision like in the script, it doesn't need to be this, it's just very straightforeward. now do the same process for the base, give it targetname of $granatwerfer_collision.

alright what you should have is clip brushes surrounding two entities, the tube and the base. both of which sould have targetnames. line them up directly how you want them, like exactly. so that it looks realistic.

okay, i think that's it for mapping, no wait. give the mortar itself (the tube) a targetname of alliedmortar_turret0 and the base a targetname of alliedmortar. now put this script in.

$alliedmortar.collisionent = $granatwerfer_collision
$alliedmortar_turret0.collisionent = $granatwerfer_turret_collision
$alliedmortar_turret0 bind alliedmortar //this part is almost essential
$alliedmortar thread global/stationaryweapons.scr::MountedStationaryWeaponWithCollision "models/statweapons/p_granatwerfer_base.tik" $granatwerfer_destroyed_collision
$alliedmortar_turret0 maxyawoffset "40"

okay, now that that's done, everything in place it ought to function perfectly. it won't be destroyed but hopefully it won't come under heavy fire.
this is all from what i see with the tut, if it doesn't work, plz, hold it against me. :wink:
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

I get most off it

Post by Cigs »

lo lizardkid,


First off all, great mate !! :D
This is the place.
Thanks!

But there're still some thing not clear to me:
okay, i think that's it for mapping, no wait. give the mortar itself (the tube) a targetname of alliedmortar_turret0 and the base a targetname of alliedmortar. now put this script in.
1)the addon_static_props_granatwerfer-mortar is 1 entity (tube+base in one), not 2.
I can't give the tube and the base targetnames since they are 1 entity.

2)In the entity propertybox of the scrip_object, do I need to fill in the key/value : like this $targetname/granatwerfer_turret_collision or like this targetname/$granatwerfer_turret_collision ?

3)I still don't have any clue how I make a *.scr file ans save it. :?:
(mapname = allweaponsroom)

----

BUT I found something else: addon_turretweapon_german_granatwerfer
(without scripting envolved)(but I also think there no collisions are included with this entity, though I can make them)

It fires/functions ingame, but when I get off the granatwerfer the tube isn't fitted in the hole of the base (wich holds the tube) anymore.
Unless I get off the granatwerfer when I aimed straight forward. Then the tube looks like it is nicely fitted in the hole off the base.
Maybe this is normal and I never noticed it in dm/Gewitter for example !?
I gues you know it better then me!
If it's normal I will use this, I think.

----

I want to understand how it works in both ways (WITH and WITHOUT scripting).
Tell me some more :P
Making a *.scr file is my bigest concern. How ? How does its layout have to be ?
Thx!


Cheers!
Last edited by Cigs on Fri May 28, 2004 4:42 pm, edited 1 time in total.
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post by blue60007 »

You can make a .scr by putting your script into notepad, and save as allweaponsroom.scr

You may have to rename the file as that, it may save as allweaponsroom.scr.txt
Image
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

1 entity (tube & base can't be selected seperatly)

Post by Cigs »

How can I select the tube and give it a targetname...
How can I select the base and give it a targetname...
... when they can't be selected seperatly ?
(they are 1 entity together; addon_static_props_granatwerfer-mortar)


Then where can I find the tube entity...?
And where can I find the base entity...?
...that enables me to select them both

:?:
Last edited by Cigs on Fri May 28, 2004 6:02 pm, edited 1 time in total.
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post by blue60007 »

I think it is one entity, but for seperate anims it has two parts, probably something like

$guntargetname.gun0

for the tube

and

$guntargetname.base

for the base :?


I think that's heading in the right direction...
Image
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

Post by Cigs »

So how can I targetname them both, so they won't be unknown to the script?

So how can I targetname them both, so they will be known to the script?

:?
Give the mortar itself (the tube) a targetname of alliedmortar_turret0 and the base a targetname of alliedmortar.
This is the only thing that has to be accomplished!
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

Post by Cigs »

$guntargetname.gun0

for the tube

and

$guntargetname.base

for the base
:shock:

I really don't get it.
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

Blue, if it's one entity you can't do that...

well then try this,


$alliedmortar.collisionent = $granatwerfer_turret_collision
$alliedmortar thread global/stationaryweapons.scr::MountedStationaryWeaponWithCollision "models/statweapons/p_granatwerfer_base.tik" $granatwerfer_destroyed_collision
$alliedmortar_turret0 maxyawoffset "40"

and just forget what i said about the two entities, jsut make them one entitiy, targetname alliedmortar. do the collision, and try it like that... just give it one targetname.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

Post by Cigs »

This is how the scrip looks like:

Code: Select all

// MAPNAME: allweaponsroom
// ARCHITECTURE: Cigs
// SCRIPTING: lizardkid, blue60007

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "allweaponsroom"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" "allweaponsroom"
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" ""


level waitTill prespawn


//*** Precache Dm Stuff
exec global/DMprecache.scr


level.script = maps/dm/allweaponsroom.scr


// prep


level waittill spawn


end

//-----------------------------------------------------------------------------

$alliedmortar.collisionent = $granatwerfer_turret_collision 
$alliedmortar thread global/stationaryweapons.scr::MountedStationaryWeaponWithCollision "models/statweapons/p_granatwerfer_base.tik" $granatwerfer_destroyed_collision 
$alliedmortar_turret0 maxyawoffset "40" 

end

//-----------------------------------------------------------------------------
Doesn't the "end" at the end need to be there?
(Didn't test yet)
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

well, it's not good practice to keep everything in one thread, it won't matter toooo much but still, forthe sake of good scripting do this. and you can't have two ends without two threads, it won't work. try this....

Code: Select all

// MAPNAME: allweaponsroom 
// ARCHITECTURE: Cigs 
// SCRIPTING: lizardkid, blue60007 

main: 

// set scoreboard messages 
setcvar "g_obj_alliedtext1" "allweaponsroom" 
setcvar "g_obj_alliedtext2" "" 
setcvar "g_obj_alliedtext3" "" 
setcvar "g_obj_axistext1" "allweaponsroom" 
setcvar "g_obj_axistext2" "" 
setcvar "g_obj_axistext3" "" 

setcvar "g_scoreboardpic" "" 


level waitTill prespawn 


//*** Precache Dm Stuff 
exec global/DMprecache.scr 


level.script = maps/dm/allweaponsroom.scr 


// prep 


level waittill spawn 

thread granatwerfer
end 

//----------------------------------------------------------------------------- 

granatwerfer:

$alliedmortar.collisionent = $granatwerfer_turret_collision 
$alliedmortar thread global/stationaryweapons.scr::MountedStationaryWeaponWithCollision "models/statweapons/p_granatwerfer_base.tik" $granatwerfer_destroyed_collision 
$alliedmortar_turret0 maxyawoffset "40" 

end 
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

I got it figured out. No scripting needed.

Post by Cigs »

Still doesn't work. but ...

----
The script is totally correct.
The script_objects are like on the picture, they are textured with the common METAL texture & they are targetnamed correctly (checked it!!) like you said.
the addon_static_props_granatwerfer-mortar (bottom off picture) is targetnamed fine too !!

It should work.
But doesn't.

----
The addon_turretweapon_german_granatwerfer (top off picture) on the other hand is NOT scripted and works!!
As you can see there is alittle bug fault in it.
Well ... that's what I thought.
I looked in mp_gewitter_dm and the granatwerfer shows the same "fault" ... it is no fault ... it's just like that! :)
It is the way it should be!

----
Image
----

I want to thank you both for your time and effort, lizardkid & blue60007 !
I got to know alittle scripting today all thanks to you !
:)

---- ----
Summary: functional granatwerfer-mortar:

If you want to add a functional granatwerfer-mortar in your Spearhead map...
It can be done without scripting by just rightclicking any 2d Vieuw, select addon_turretweapon_german_granatwerfer
And you're done.
(maybe it doesn't look like the hole gun but trust me, it's there ingame and works just fine)
Good Luck mapping!
---- ----

Topic closed.
Last edited by Cigs on Tue Jun 01, 2004 10:05 pm, edited 2 times in total.
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

glad to help. :D
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post by blue60007 »

Well I'm glad you got things sorted. :D
Image
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

Post by Cigs »

yeah :)
Image
TS217.172.173.37:9095
Spearhead SDK Q's
Post Reply