![]() |
![]() |
|
#1
|
||||
|
||||
|
Hi there, I want to place a scoped Nagant and a scoped K98 on my map. Anyone who can help me? I don't have any clue of coding
|
|
#2
|
||||
|
||||
|
You don't need code.
Change the weapon which is picked up: Just create a Panzerfaust Pick Up base/actor (look in the SDK manual if you don't know how to place this actor). Then go to the properties and change the picked up weapon into an Sniper rifle (it's in the bottom half in the RO ammo or something category if you find the pull down menu you are close). Change the mesh from a Panzerfaust to a sniper rifle: Then open the Static mesh browser and open the WeaponPick up package (or something like that ) and select the sniper rifle and go to your PickUp properties to Display and change the mesh by clicking on use. This should work if you can understand my hints ![]() But I don't know how to change the text (you will notice it if you try to pick up the rifle)
__________________
Peace has cost you your strength! Victory has defeated you! - Bane |
|
#3
|
||||
|
||||
|
Thanks, I tried this by simply changing the Mesh and the Pickup, but the the Rifle still is named "Pickup: Panzerfaust" in game, and you get a weird reaction if you already have a Panzerfaust or even another rifle/machine gun.
Not that useful but it works at least. Still searching after a professional and clean way. |
|
#4
|
||||
|
||||
|
Well, if you really wanted to you could make a new pickup class that works on the basis of the Panzerfaust one, just replace all instances of it within the code (such as the mesh, the weapon, ammo, etc).
__________________
![]() why even bother |
|
#5
|
||||
|
||||
|
In the properties you can change things like pick up message and the tag from Panzerfaust to whatever but oddly it doesn't seem to work ingame.
Is that a bug or has there to be done something special to change the text message when a player gets close to the weapon?
__________________
Peace has cost you your strength! Victory has defeated you! - Bane |
|
#6
|
||||
|
||||
|
Ok then, I've done this so far. What next?
Code:
//===================================================================
// MyROK98ScopedPickup
//
// A placeable K98 scoped pickup for mappers to put in their map
//===================================================================
class MyROK98ScopedPickup extends ROPlaceableAmmoPickup;
var() class<Inventory> WeaponType;
static function StaticPrecache(LevelInfo L)
{
L.AddPrecacheStaticMesh(StaticMesh'WeaponPickupSM.Weapons.k98scoped');
L.AddPrecacheMaterial(Material'Weapons3rd_tex.German.Kar98_world');
L.AddPrecacheMaterial(Material'Weapons3rd_tex.German.Kars98_scope_world');
L.AddPrecacheMaterial(Material'Weapons1st_tex.Rifles.k98_sniper_s');
}
auto state Pickup
{
function bool ReadyToPickup(float MaxWait)
{
return true;
}
/* ValidTouch()
Validate touch (if valid return true to let other pick me up and trigger event).
*/
function bool ValidTouch( actor Other )
{
// make sure its a live player
if ( (Pawn(Other) == None) || !Pawn(Other).bCanPickupInventory || (Pawn(Other).Health <= 0) || (Pawn(Other).DrivenVehicle == None && Pawn(Other).Controller == None))
return false;
if( ROPawn(Other) != none && ROPawn(Other).AutoTraceActor != none && ROPawn(Other).AutoTraceActor == self )
{
// do nothing
}
// make sure not touching through wall
else if ( !FastTrace(Other.Location, Location) )
return false;
// make sure game will let player pick me up
if( Level.Game.PickupQuery(Pawn(Other), self) )
{
TriggerEvent(Event, self, Pawn(Other));
return true;
}
return false;
}
// When touched by an actor.
function Touch( actor Other )
{
}
function CheckTouching()
{
}
function UsedBy( Pawn user )
{
local Inventory Copy;
local inventory Inv;
local bool bHasWeapon;
if( user == none )
return;
// check if Other has a primary weapon
if( user != none && user.Inventory != none )
{
for ( Inv=user.Inventory; Inv!=None; Inv=Inv.Inventory )
{
if ( Inv != none && Weapon(Inv) != None )
{
if( Inv.class == WeaponType)
{
if( Weapon(Inv).AmmoMaxed(0) )
return;
else
bHasWeapon = true;
}
}
}
}
// valid touch will pickup the object
if( ValidTouch( user ) )
{
if( bHasWeapon )
Copy = SpawnCopy(user);
else
Copy = SpawnWeaponCopy(user);
AnnouncePickup(user);
if ( Copy != None )
Copy.PickupFunction(user);
SetRespawn();
}
}
function Timer()
{
if ( bDropped )
GotoState('FadeOut');
}
function BeginState()
{
UntriggerEvent(Event, self, None);
if ( bDropped )
{
AddToNavigation();
SetTimer(DropLifeTime, false);
}
}
function EndState()
{
if ( bDropped )
RemoveFromNavigation();
}
Begin:
CheckTouching();
}
//
// Set up respawn waiting if desired.
//
function SetRespawn()
{
StartSleeping();
}
function inventory SpawnWeaponCopy( pawn Other )
{
local inventory Copy;
if ( Inventory != None )
{
Copy = Inventory;
Inventory = None;
}
else
Copy = Other.spawn(WeaponType,Other,,,rot(0,0,0));
Copy.GiveTo( Other, self );
return Copy;
}
|
|
#7
|
||||
|
||||
|
Noone willing to help me finishing the RO-AlteZiegelei map?
|
|
#8
|
|||
|
|||
|
Ok Ok let me take a look at it.
brb :/ Kar98 scoped Code:
class ROKar98kScopedPickup extends ROPanzerFaustPickup;
static function StaticPrecache(LevelInfo L)
{
L.AddPrecacheStaticMesh(StaticMesh'WeaponPickupSM.Weapons.k98scoped');
L.AddPrecacheMaterial(Material'Weapons3rd_tex.German.Kar98_world');
L.AddPrecacheMaterial(Material'Weapons3rd_tex.German.Kars98_scope_world');
L.AddPrecacheMaterial(Material'Weapons1st_tex.Rifles.k98_sniper_s');
}
defaultproperties
{
InventoryType=class'ROAmmo.Kar792x57Ammo' // this could be class'ROInventory.Kar98WeaponScoped' whatever works I guess
WeaponType=class'ROInventory.Kar98WeaponScoped'
PickupMessage="You got the Kar98k Scoped."
TouchMessage="Pick Up: Kar98k Scoped"
PickupSound=Sound'Inf_Weapons_Foley.WeaponPickup'
PickupForce="AssaultRiflePickup" // jdf
bAmmoPickupIsWeapon=true
MaxDesireability=+0.78
StaticMesh=StaticMesh'WeaponPickupSM.Weapons.k98scoped'
RespawnTime=3.000000
AmmoAmount = 1
DrawType=DT_StaticMesh
DrawScale=1.0
AmbientGlow=10
CollisionRadius=25.0
CollisionHeight=3.0
PrePivot=(X=0.0,Y=0.0,Z=3.0)
}
Last edited by Deeival; 04-04-2008 at 05:26 PM. |
|
#9
|
|||
|
|||
|
Also: Increase the fog distance on that map.
|
|
#10
|
||||
|
||||
|
Thank you very much!
I will try asap, at the moment there's no chance to start the SDK...
|
|
#11
|
||||
|
||||
|
Do not want to start a new thread for this but is there a way to negate the enemy team/side ( Russians/Germans) from picking up the pick up code wise?
Last edited by TT33; 04-05-2008 at 05:37 AM. |
|
#12
|
||||
|
||||
|
you dont like "yes" as an anwer do you?
![]() A new flag in the pickup which defines the allowed team, and a check for it in the UsedBy function. |
|
#13
|
||||
|
||||
|
Quote:
Quote:
Last edited by TT33; 04-05-2008 at 08:25 AM. |
|
#14
|
||||
|
||||
|
quickly done, and didnt test it. No reason why it shouldnt work as its pretty trivial. subclass the items you need from TeamPickup and you will get a new field which allows you to specify the team that is allowed to pick up the item in the editor.
If another team player tries to pick it up, he gets a msg similar to the one for denied entry on vehicles. Code:
//-----------------------------------------------------------
// Teambased Pickup
// untested
// allows to specify a team which is able to pickup this weapon
// by worluk 2008
//
//-----------------------------------------------------------
class TeamPickup extends ROPanzerFaustPickup
abstract;
var() enum myTeamIndex{
AXIS_TEAM_INDEX,
ALLIES_TEAM_INDEX
} PickupTeam;
function UsedBy( Pawn user )
{
if(user.PlayerReplicationInfo.TeamInfo.TeamIndex!=PickupTeam)
{
user.ReceiveLocalizedMessage(class'ROTeamPickupMsg');
return;
}
super.UsedBy(user);
}
DefaultProperties
{
}
Code:
//-----------------------------------------------------------
// ROTeamPickupMsg
// untested
// a msg sent to a player in case he tries to pickup an item
// set for the other team.
// by worluk 2008
//
//-----------------------------------------------------------
class ROTeamPickupMsg extends LocalMessage;
var(Messages) localized string WrongTeam;
static function string GetString(
optional int Switch,
optional PlayerReplicationInfo RelatedPRI_1,
optional PlayerReplicationInfo RelatedPRI_2,
optional Object OptionalObject
)
{
return default.WrongTeam;
}
//=============================================================================
// defaultproperties
//=============================================================================
defaultproperties
{
WrongTeam="You cannot pick up this item"
bBeep=false
bFadeMessage=true
bIsUnique=false
DrawColor=(R=214,G=28,B=36,A=255)
FontSize=2
LifeTime=3
PosX=0.5
PosY=0.75
}
Last edited by worluk; 04-05-2008 at 08:56 AM. |
|
#15
|
||||
|
||||
|
Ty m8 ! Yeah that sounds cool.
I wanted to use this to restrict some possible(I got alot of models scattered across various Hard drives) future rare but noteworthy weapons from being overly used by the enemy. Last edited by TT33; 04-05-2008 at 11:03 AM. |
|
#16
|
||||
|
||||
|
This is getting interesting now
|
|
#17
|
||||
|
||||
|
Why? What's wrong with the fog?
|
|
#18
|
|||
|
|||
|
I wanna be able to take longer shots
![]() But this is getting too OT. |
|
#19
|
||||
|
||||
|
Quote:
ERROR: unexpected defaultproperties on line 11
|
|
#20
|
|||
|
|||
|
Everything throws together. Tested the Kar98ScopedPickup and it worked, didnt test the same team pickup thing but it compiled... so it should work
![]() Source is included, let me know if there are issues. Updated: http://hashers.ca/redirect/dvscopedpickups.rar Edit: Ignore the vehicle code I pack with it - no idea how that got in there. Last edited by Deeival; 04-12-2008 at 01:22 AM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|