Counterstrike Mod Thread:

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

Counterstrike Mod Thread:

Postby bambi » Sat Sep 08, 12 3:27 am

Hi Alphae!

I'm going to restart the counterstrike mod. I deleted it again, and I'm gonna start working on it fresh.

This thread will just be me plugging new updates to it, and stuff.

Update 1: September 7th.

I crealed a mod that allows the user to click on an item in a window, and the player will receive the item: this window pops up at the start of the game, and the player will have the option to buy things, such as weapons, based on how many credits he has.
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby bambi » Tue Sep 25, 12 8:01 pm

Update 2: September 25th

I successfully compiled the actual Team last man standing code. I will begin testing it. It should make it so that once the game has started, anyone who joins, will have to spectate until the match is over.

I still have to:
1. steal Cat's clyzm's weapons
2. integrate the weapon buying mutator somehow.
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby bambi » Sun Jan 13, 13 7:25 pm

I fcking deleted everything. Starting over again. This will hopefully be the most least buggy CS mod yet.

Will get this done. promise
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby clyzm » Sun Jan 13, 13 7:40 pm

Need some help bro?
Image
User avatar
clyzm
Forum Master God
 
Posts: 16023
Joined: Sun Nov 28, 04 2:48 am
Location: Chiraq

Postby bambi » Tue Jan 15, 13 3:16 pm

from the LEGEND heck yes!

CLYZM we gotta do this proper. I was using your 2011 guns originally because they are beautiful, but no one would download it so I'm thinking:

CS Mod Plan:
- CYLZM, I need a copy of your cstrike.u mod. It had counterstrike hands and knife that looked awesome, also a relatively small download.
- I need to implement the store buying guns feature
- than IP checking so people don't reconnect all the time to skirt the spectating

Clyzm what do you want to do?
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby clyzm » Tue Jan 15, 13 5:05 pm

Man I was thinking stuff like

Aim down sights where I'll handle the animation parts of the gun to aim down

(just would need some programming help like to make it a state that can be induced by a standard button like RightMouseClick default)

Sprinting

(I could handle animations as before i.e. AK47SprintStart, AK47SprintLoop, AK47SprintEnd for all the guns and it would again have to be like pressing shift to induce a 1.25x speed in running)

Separate hand textures for NSF/UNATCO

(like in mulitplayer and shit if you're on UNATCO side you get UNATCO hands holding the weapons and same for NSF and MJ12 and JC Denton. would require some minor coding like that switches textures of a specific model part of the 1st person mesh)

But I'm down for whatever
Last edited by clyzm on Tue Jan 15, 13 5:07 pm, edited 1 time in total.
Image
User avatar
clyzm
Forum Master God
 
Posts: 16023
Joined: Sun Nov 28, 04 2:48 am
Location: Chiraq

Postby bambi » Tue Jan 15, 13 5:20 pm

dude yea! i keep reading on this forum people asking for zoom in sights lets do it!

from your 2011 guns, you seemed to know what to do with the coding... more than I do.

anyways, what guns will we use and how can we keep the download relatively small?
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby clyzm » Tue Jan 15, 13 5:22 pm

Same guns as Cstrike.u? I really optimized that mod with the deus ex guns' stats on hitdamage and range.

Unless you had other things in mind
Image
User avatar
clyzm
Forum Master God
 
Posts: 16023
Joined: Sun Nov 28, 04 2:48 am
Location: Chiraq

Postby clyzm » Tue Jan 15, 13 5:27 pm

Image
User avatar
clyzm
Forum Master God
 
Posts: 16023
Joined: Sun Nov 28, 04 2:48 am
Location: Chiraq

Postby bambi » Tue Jan 15, 13 6:01 pm

i'll look into sprinting states, I think I can do it

yea lets use cstrike guns, ok time to codder!

Version 1.0 OTW Problems:
- THE MULTIPLAYER SCORE SCREEN DOESN'T SHOW UP WTF!

TO DO list:
- code gun store
- code states for sprinting
- CLYZM do your magic for awesome zoom in scopes
Last edited by bambi on Tue Jan 15, 13 6:41 pm, edited 1 time in total.
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby CyberP » Tue Jan 15, 13 6:40 pm

Whoa whoa whoa, easy bros, just havin ya a conversation.
I have been wanting aim down sights in Deus Ex for a while, I just got me some programmers to help me code up the mechanics and various others for my mod, then AdamJensen/SpecX brings this thread to my attention.
So, collaboration?

clyzm wrote:Same guns as Cstrike.u? I really optimized that mod with the deus ex guns' stats on hitdamage and range.

Unless you had other things in mind

Hmmn I was thinking HDTP weapons, nevermind, but do you mind if I have a look at your code when your done, or use the code from Enhanced.u?
Last edited by CyberP on Tue Jan 15, 13 6:43 pm, edited 3 times in total.
CyberP
Newbie
 
Posts: 43
Joined: Sat Dec 08, 12 3:31 am

Postby bambi » Tue Jan 15, 13 6:43 pm

oh, CLYZM here is probably the best animation graphics weapons mod person around. he made the 2011 guns, the best looking guns in dx period.
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby CyberP » Tue Jan 15, 13 6:44 pm

bambi wrote:oh, CLYZM here is probably the best animation graphics weapons mod person around. he made the 2011 guns, the best looking guns in dx period.

2011 guns? I'll have a browse.

I like what work of his I have seen so far though.
Last edited by CyberP on Tue Jan 15, 13 6:45 pm, edited 1 time in total.
CyberP
Newbie
 
Posts: 43
Joined: Sat Dec 08, 12 3:31 am

Postby bambi » Tue Jan 15, 13 7:30 pm

yea, I'm kind of in over my head right now, but if I can get these states clyzm it will be dynamite.

Progress on v1.0:
- each person has x amount of lives
- scoreboard shows this
- now codding the buy gun store....

To Do list:
- sprinting states (should we allow person to sprint zoomed in?)
- change skins
- recode suicide vest
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby ~DJ~ » Tue Jan 15, 13 8:22 pm

clyzm down for this? w00t
this be badass 8) 8)

if liek I can do something.. I'm down as well... I HOPE.
GOOD LUCK BAMBI & CLYZM. :D
User avatar
~DJ~
Forum Super Hero
 
Posts: 3766
Joined: Tue May 22, 07 12:23 pm

Postby clyzm » Tue Jan 15, 13 8:27 pm

mmn I was thinking HDTP weapons, nevermind, but do you mind if I have a look at your code when your done, or use the code from Enhanced.u?


I was planning on making a standalone alternative mod that features higher-definition weapons while still remaining truthful to the original design and stuff. I already have a couple models in progress

The basis of this standalone mod I've conceptualized will include the following: all redesigned high-poly weapons that each have sprinting anims, ADS anims, attaching silencer anims (if they have the proper weaponmod upgrade in SP), equipping "true" laser sight with a visible beam anims, toggable flashlight modifications (visible on the weapon itself) so JCD doesn't waste bioelectric energy, and finally a way to switch shooting anims on the assault gun for the 20mm HE grenade launcher.

Of course that's just all conceptual, more of a goal than anything

The code from the Enhanced.u M4A1 is flawed because the aim down button is assigned to ChangeAmmo key (we would want it to be assigned to the scope key) and the animation is far too slow when aiming down.

Basically what I did was modify some of user Allan's code that he scripted for me when [A] labs was working on FLCity. Originally it was code for a pistol to attach a suppressor, but I modified it to work with the ADS animation in the mesh file. So I still have a little more tweaking to do before I perfect the ADS mechanism

Code: Select all
//=============================================================================
// WeaponM4Aimpoint.uc
//=============================================================================
class WeaponM4Aimpoint extends DeusExWeapon;

var bool bSupressorOff;
var() sound FireSoundNoSup;
var Beam b1, b2;
var(Flashlight) float MaxF_LightDist;
var(Flashlight) byte F_LightBrightness,F_LightRadius;

function CycleAmmo()
{
   if(IsInState('Idle')) // If we aren't doing anything flashy.
   {
      GoToState('SupressorToggle');
   }
}

state SupressorToggle
{
   ignores Fire, AltFire, PutDown, ReloadAmmo, DropFrom; // Whee! We can't do sweet F.A. in this state! :D
   Begin:
      If(bSupressorOff)
         PlayAnim('SupressorOn');
      else
         PlayAnim('SuperssorOff');
      bSupressorOff=!bSupressorOff;
      FinishAnim();
      GoToState('Idle');
}

simulated function PlayFiringSound()
{
   if(!bSupressorOff)
      PlaySimSound( FireSound, SLOT_None, TransientSoundVolume,2048);
   else
      PlaySimSound( FireSoundNoSup, SLOT_None, TransientSoundVolume,2048);
}

simulated function PlayIdleAnim()
{
   local float rnd;

   if (bZoomed || bNearWall)
      return;

   rnd = FRand();
   If(!bSupressorOff)
      if (rnd < 0.01)
         PlayAnim('Idle',,0.1);
   else
      if (rnd <0> 0)
   {
      if (( Level.NetMode == NM_DedicatedServer ) || ((Level.NetMode == NM_ListenServer) && Owner.IsA('DeusExPlayer') && !DeusExPlayer(Owner).PlayerIsListenClient()))
      {
         ClientReload();
         Sleep(GetReloadTime());
         ReadyClientToFire( True );
      }
      else
      {
         bWasZoomed = bZoomed;
         if (bWasZoomed)
            ScopeOff();

         Owner.PlaySound(CockingSound, SLOT_None,,, 1024);      // CockingSound is reloadbegin
         if(!bSupressorOff)
            PlayAnim('ReloadBegin');
         else
            PlayAnim('ReloadBegin2');            
         NotifyOwner(True);
         FinishAnim();
         if(!bSupressorOff)
            PlayAnim('Reload');
         else
            PlayAnim('Reload2');
         Sleep(GetReloadTime());
         Owner.PlaySound(AltFireSound, SLOT_None,,, 1024);      // AltFireSound is reloadend
         if(!bSupressorOff)
            PlayAnim('ReloadEnd');
         else
            PlayAnim('ReloadEnd2');
         FinishAnim();
         NotifyOwner(False);

         if (bWasZoomed)
            ScopeOn();

         ClipCount = 0;
      }
   }
   GotoState('Idle');
}

simulated function TweenDown()
{
   if ( (AnimSequence != '') && (GetAnimGroup(AnimSequence) == 'Select') )
      TweenAnim( AnimSequence, AnimFrame * 0.4 );
   else
   {
      // Have the put away animation play twice as fast in multiplayer
      if(!bSupressorOff)
      {
         if ( Level.NetMode != NM_Standalone )
            PlayAnim('Down', 2.0, 0.05);
         else
            PlayAnim('Down', 1.0, 0.05);
      }
      else
      {
         if ( Level.NetMode != NM_Standalone )
            PlayAnim('Down2', 2.0, 0.05);
         else
            PlayAnim('Down2', 1.0, 0.05);
      }
   }
   bSupressorOff=False; // Supresson defaults to off on deselect.
}

function DropFrom(vector StartLocation) // Supressor defaults to off once thrown out.
{
   Super.DropFrom(StartLocation);
   bSupressorOff=False;
}

Function LightOn()
{
   local DeusExPlayer Player;
   Player=DeusExPlayer(Owner);
   if(b1==None)
   {
      b1 = Spawn(class'Beam', Player,'', Player.Location);
      if (b1 != None)
      {
         b1.LightHue = 0;
         b1.LightRadius = F_LightRadius;
         b1.LightSaturation = 255;
         b1.LightBrightness = F_LightBrightness;
         b1.LightType       = LT_Steady;
         SetBeamLocation();
      }
   }
   if(b2==None)
   {
      b2 = Spawn(class'Beam', Player,'', Player.Location);
      if (b2 != None)
      {
         b2.LightHue = 0;
         b2.LightRadius = F_LightRadius;
         b2.LightSaturation = 255;
         b2.LightBrightness = F_LightBrightness;
         b1.LightType       = LT_Steady;
         SetGlowLocation();
      }
   }
}

Function LightOff()
{
   if (b1 != None)
      b1.Destroy();
   if (b2 != None)
      b2.Destroy();
   b1 = None;
   b2 = None;
}

function SetBeamLocation()
{
   local Vector HitNormal, HitLocation, StartTrace, EndTrace;
   local float dist, size, radius, brightness;
   local DeusExPlayer Player;
   Player=DeusExPlayer(Owner);

   if (b1 != None)
   {
      StartTrace = Player.Location;
      StartTrace.Z += Player.BaseEyeHeight;
      EndTrace = StartTrace + MaxF_LightDist * Vector(Player.ViewRotation);

      Trace(HitLocation, HitNormal, EndTrace, StartTrace, True);
      if (HitLocation == vect(0,0,0))
         HitLocation = EndTrace;

      dist       = VSize(HitLocation - StartTrace);
      size       = fclamp(dist/MaxF_LightDist, 0, 1);
      radius     = size*5.12 + F_LightRadius;
      brightness = fclamp(size-0.5, 0, 1)*2*-F_LightBrightness + F_LightBrightness;
      b1.SetLocation(HitLocation-vector(Player.ViewRotation)*64);
      b1.LightRadius     = byte(radius);
      b1.LightBrightness = byte(brightness);  // someday we should put this back in again
      b1.LightType       = LT_Steady;
   }
}

function vector SetGlowLocation()
{
   local vector pos;
   local DeusExPlayer Player;
   Player=DeusExPlayer(Owner);
   if (b2 != None)
   {
      pos = Player.Location + vect(0,0,1)*Player.BaseEyeHeight +
            vect(1,1,0)*vector(Player.Rotation)*Player.CollisionRadius*1.5;
      b2.SetLocation(pos);
   }
}

Function LaserToggle()
{
   if(bLasing)
      LightOff();
   else
      LightOn();
   
   bLasing=!bLasing;
}

Function LaserOn()
{
   LightOn();
}

Function LaserOff()
{
   LightOff();
}

Function Tick(float Deltatime)
{
   if(bLasing)
   {
      SetBeamLocation();
      SetGlowLocation();
   }
   Super.Tick(Deltatime);
}

simulated function PreBeginPlay()
{


In the import codes for the mesh, I retained the Suppressor On/Off animation titles, but the actual animation corresponding to those keyframes is the aiming down/away sight.

You may notice there is a Light function in the code, this is a preview of the upcoming flashlight functionality. In the future it will be accompanied by distinct animations

Almost all of that code is Allan's handiwork, he will be significantly credited if the mod comes to fruition

But yeah I'm down for a collabo
Last edited by clyzm on Wed Jan 16, 13 11:25 am, edited 5 times in total.
Image
User avatar
clyzm
Forum Master God
 
Posts: 16023
Joined: Sun Nov 28, 04 2:48 am
Location: Chiraq

Postby CyberP » Wed Jan 16, 13 4:30 am

Thanks for the detailed response. Will be in touch shortly.
CyberP
Newbie
 
Posts: 43
Joined: Sat Dec 08, 12 3:31 am

Postby bambi » Thu Jan 17, 13 7:33 pm

^ gosh, Allan is a beast codder!

Anyways first Update!

I need some help!

Code: Select all
inv = player.Spawn(Class'CStrike.CSWeaponAssaultGun');
               player.AddObjectToBelt(inv, 2, true);
               //player.SetInHand(inv);
               //inv.Frob(player, none);
               //inv.Frob(player, None);
               //inv.GiveTo(player);
               //inventory.SetBase(player);
               //inv =player.Spawn(Class'DeusEx.Ammo762mm');
               //inv.GiveTo(player);
               //inv.bInObjectBelt = True;


basically, I need help giving the player the weapon. Some of the above methods will work if I'm hosting as non-dedicated. But in a dedicated serve, if I join it, these methods do not work. Poor!!! help.

As soon as I get this method sorted, I'll release the first version of the CS mod. Its not great. but it will get better. Plus, I don't wait years before releasing mods.

Also, I need someone to host it.
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby Poor » Fri Jan 18, 13 12:45 am

Take a look at GiveInitialInventory() in DeusExPlayer.
Poor
Poster
 
Posts: 190
Joined: Tue Jan 04, 11 7:42 pm

Postby bambi » Fri Jan 18, 13 5:55 pm

I'm adding these weapons through a window class so that doesn't help.

I can't frob(self, none) because self is a window, not a deusexplayer.
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby bambi » Fri Jan 18, 13 8:32 pm

lol,

I got it to spawn an AK47 on my waist. so I've been walking around with an ak47 sticking out, but I can't pick it up or fire it...
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby bambi » Fri Jan 18, 13 11:03 pm

Update 1.40023:

I can get the player to hold the weapon and fire it. But its not replicated???? IN other words, I see the gun firing, but its really not firing.
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby ~DJ~ » Sat Jan 19, 13 4:43 am

How did you find about this? You hosted a dedicated server and tested with your friends?

I guess no one can say anything unless they look at the code! :oops:
User avatar
~DJ~
Forum Super Hero
 
Posts: 3766
Joined: Tue May 22, 07 12:23 pm

Postby bambi » Sat Jan 19, 13 4:51 pm

Code: Select all
class DXCSGunShopMenu extends MenuUIScreenWindow;

var localized string l_help1, l_cpoint, l_lgun;
var MenuUIScrollAreaWindow winScroll;
var MenuUIListWindow lstGuns, lstPoints;
var MenuUISmallLabelWindow CurrentPoints, LeadingGun;
var DXL dxl;
var float RepTime;
var bool bStacking, blstGunsDone;
var DeusExPlayer player, p;
//var inventory inv;
var class<DeusExWeapon> weapon1;

replication
{

reliable if ( Role < ROLE_Authority)
   GiveWeapon, player;
}



event InitWindow()
{
local Window W;

Super.InitWindow();

if (actionButtons[2].btn != None)
 if ((Player == None) || (Player.PlayerReplicationInfo == None) || !Player.PlayerReplicationInfo.bAdmin)
  actionButtons[2].btn.SetSensitivity(false);

   winClient.SetBackground(Texture'DeusExUI.MaskTexture');
   winClient.SetBackgroundStyle(DSTY_Modulated);
   
   W = winClient.NewChild(Class'Window');
   W.SetSize(ClientWidth, ClientHeight);
   W.SetBackground(Texture'DeusExUI.MaskTexture');
   //W.SetBackground(Texture'UWindow.Background');
   W.SetBackgroundStyle(DSTY_Modulated);
   W.Lower();
   
   CreateLabel(8, 7, l_lmap);
   LeadingGun = CreateLabel(16, 20, "");
   LeadingGun.SetWidth(180);
   
   lstPoints = MenuUIListWindow(winClient.NewChild(Class'MenuUIListWindow'));
   lstPoints.SetPos(8, 40);
   lstPoints.SetSize(208, 192);
   lstPoints.SetSensitivity(false);
   lstPoints.EnableAutoExpandColumns(false);
   lstPoints.EnableAutoSort(true);
   lstPoints.SetNumColumns(2);
   lstPoints.SetColumnType(0, COLTYPE_Float, "%.0f");
   lstPoints.SetColumnType(1, COLTYPE_String);
   lstPoints.SetSortColumn(0, true, false);  //reverse order
   lstPoints.SetColumnWidth(0, 28);
   lstPoints.SetColumnWidth(1, 180);
   
   CreateLabel(236, 7, l_cvote);
   CurrentPoints = CreateLabel(244, 20, "");
   CurrentPoints.SetWidth(180);
   
   winScroll = CreateScrollAreaWindow(winClient);
   winScroll.SetPos(236, 40);
   winScroll.SetSize(196, 192);
   
   lstGuns = MenuUIListWindow(winScroll.clipWindow.NewChild(Class'MenuUIListWindow'));
   lstGuns.EnableMultiSelect(false);
   lstGuns.EnableAutoExpandColumns(false);
   lstGuns.EnableAutoSort(false);
   lstGuns.SetNumColumns(2);
   lstGuns.SetColumnType(0, COLTYPE_String);
   lstGuns.SetColumnType(1, COLTYPE_String);
   lstGuns.SetSortColumn(0, false, false);  //case insensitive
   lstGuns.SetColumnWidth(0, 180);
   lstGuns.HideColumn(1);
   //lstGuns.DeleteAllRows();
   lstGuns.AddRow("AK47 $400");
   lstGuns.AddRow("XM1014 $200");
   lstGuns.AddRow("Knife $200");
   lstGuns.AddRow("Glock $100");
   lstGuns.AddRow("Steyr Scout $500");
   lstGuns.AddRow("Benelli M3 $200");
   lstGuns.AddRow("USP $400");
   
    bTickEnabled = true;
}

final function MenuUISmallLabelWindow CreateLabel(int X, int Y, string S)
{
   local MenuUISmallLabelWindow W;
   
   W = MenuUISmallLabelWindow(winClient.NewChild(Class'MenuUISmallLabelWindow'));
   W.SetPos(X, Y);
   W.SetText(S);
   W.SetWordWrap(false);

return W;
}

//do not change this cleanup code
event DestroyWindow()
{
bTickEnabled = false;

Player = DeusExPlayer(GetPlayerPawn());
if ((Player != None) && !Player.bDeleteMe)
 {
 if (ViewPort(Player.Player) != None)
  {
  Player.ClientMessage(l_help1);
  }
 foreach Player.allactors(class'DXL', dxl)
  if (dxl.Owner == Player)
   dxl.MVM = None;
 }

dxl = None;
Super.DestroyWindow();
}


//close window when death or end game screen displays
function bool CanPushScreen(class<DeusExBaseWindow> C)
{
if (ClassIsChildOf(C, class'HUDMultiplayer') || ClassIsChildOf(C, class'MultiplayerMessageWin'))
 {
 bStacking = true;
 return true;
 }

return Super.CanPushScreen(C);
}


function bool CanStack()
{
if (bStacking)
 {
 bStacking = false;
 return false;
 }

return Super.CanStack();
}


function Tick(float Delta)
{

   if ((lstGuns == None) || (lstPoints == None) || (dxl == None))
    return;
   
   Player = DeusExPlayer(GetPlayerPawn());   

   if ((Player != None) && !Player.bDeleteMe)
   {
      lstPoints.DeleteAllRows();
      lstPoints.AddRow(Player.SkillPointsAvail $ "$;");
   }
}

final function int MapNumToRow(int N)
{
local int I, R;

if ((lstGuns != None) && (N >= 0))
 for (I = 0; I < lstGuns.GetNumRows(); I++)
  {
  R = lstGuns.IndexToRowId(I);
  if (int(lstGuns.GetField(R, 1)) == N)
   return R;
  }

return 0;
}


event bool ListRowActivated(window W, int R)
{
   //local int weapRowSelection;
   
   if ((W == lstGuns) && blstGunsDone)
    {
       dxl.ClientSetVote(int(lstGuns.GetField(R, 1)));
       CurrentPoints.SetText(lstGuns.GetField(R, 0));
       /*
       weapRowSelection = MapNumToRow(dxl.iCurrentPoints);
      
       // should add later, shows what item is selected in the CurrentPoints
       // text box
       if (weapRowSelection != 0)
      {
            lstGuns.SetFocusRow(weapRowSelection, true, false);
            lstGuns.SelectRow(weapRowSelection);
            CurrentPoints.SetText(lstGuns.GetField(weapRowSelection, 0));      
      }
      */
       return true;
    }

return Super.ListRowActivated(W, R);
}


event bool RawKeyPressed(EInputKey key, EInputState iState, bool bRepeat)
{
if ((key == IK_Enter) && (iState == IST_Release))
 {
 root.PopWindow();
 return True;
 }

return Super.RawKeyPressed(key, iState, bRepeat);
}

           
simulated final function GiveWeapon(Pawn PlayerPawn, string aClassName )
{
   local class<Weapon> WeaponClass;
   local Weapon NewWeapon;

   WeaponClass = class<Weapon>(DynamicLoadObject(aClassName, class'Class'));

   if( PlayerPawn.FindInventoryType(WeaponClass) != None )
      return;
   newWeapon = PlayerPawn.Spawn(WeaponClass);
   if( newWeapon != None )
   {
            newWeapon.RespawnTime = 0.0;
            newWeapon.GiveTo(PlayerPawn);
            newWeapon.bHeldItem = true;
            newWeapon.GiveAmmo(PlayerPawn);
                    
            newWeapon.AmbientGlow = 0;
            newWeapon.SetSwitchPriority(PlayerPawn);
            newWeapon.WeaponSet(PlayerPawn);
      if ( PlayerPawn.IsA('PlayerPawn') )
         newWeapon.SetHand(PlayerPawn(PlayerPawn).Handedness);
   }
}


simulated function ProcessAction(String S)
{   
   local Inventory inv;
   local Weapon newWeapon;
   local DeusExPlayer player1;
      if (S == "BUY")
      {
         player1 = DeusExPlayer(GetPlayerPawn());
      
            // hokay, basically the selectedrow isn't like 0, 1, 2,
            // like you would think. its like 533252143, so we call
            // indextorowid which gives us the RowId of row 0, 1, 2,
            // which we then can check if it equals the users
            // selected row
            
            if(lstGuns.GetSelectedRow() == lstGuns.IndexToRowId(0)){
            
           
               GiveWeapon(player1, "CStrike.CSWeaponAssaultGun");
           
         
               //inv = player1.Spawn(Class'CStrike.CSWeaponAssaultGun');
               //player.GiveInitialInventory(inv, 2, true);
               //player.SetInHand(weapon1);
               //inv.setOwner(player1);
               //inv.Frob(player1, inv);
               //inv.Frob(player, None);
               //inv.GiveTo(player);
               //inventory.SetBase(player);
               //inv = player.Spawn(Class'DeusEx.Ammo762mm');
               //inv.SetBase(player);
               //player.Weapon = DeusExWeapon(inv);
               //inv.bInObjectBelt = True;
               
            }
            if(lstGuns.GetSelectedRow() == lstGuns.IndexToRowId(1)){
               inv = player.Spawn(Class'CStrike.CSWeaponAssaultShotgun');
               inv.GiveTo(player);
               inv.bInObjectBelt = True;
            }
            if(lstGuns.GetSelectedRow() == lstGuns.IndexToRowId(2)){
               inv = player.Spawn(Class'CStrike.CSWeaponCombatKnife');
               inv.GiveTo(player);
               //inv.Frob(player, None);
               //inv.bInObjectBelt = True;
            }
            if(lstGuns.GetSelectedRow() == lstGuns.IndexToRowId(2)){
               inv = player.Spawn(Class'CStrike.CSWeaponPistol');
               inv.GiveTo(player);
               //inv.Frob(player, None);
               //inv.bInObjectBelt = True;
            }
            if(lstGuns.GetSelectedRow() == lstGuns.IndexToRowId(3)){
               inv = player.Spawn(Class'CStrike.CSWeaponRifle');
               inv.GiveTo(player);
               inv.bInObjectBelt = True;
            }
               if(lstGuns.GetSelectedRow() == lstGuns.IndexToRowId(4)){
               inv = player.Spawn(Class'CStrike.CSWeaponSawedOffShotgun');
               inv.GiveTo(player);
               //inv.Frob(player, None);
               //inv.bInObjectBelt = True;
            }
            if(lstGuns.GetSelectedRow() == lstGuns.IndexToRowId(5)){
               inv = player.Spawn(Class'CStrike.CSWeaponStealthPistol');
               inv.GiveTo(player);
               inv.bInObjectBelt = True;
            }
            
         }   
      else if (S == "TRAVEL")
       {
          if (lstGuns.GetSelectedRow() != 0)
           {
           Player.SwitchLevel(lstGuns.GetField(lstGuns.GetSelectedRow(), 0));  //server checks for admin
           actionButtons[2].btn.SetSensitivity(false);
           }
       }
   //Super.ProcessAction(S);
}


defaultproperties
{
RepTime=1.0
l_help1="Type 'Mutate guns' to display the menu."
l_cpoint="Weapon/Materiel Selection:"
l_lgun"Your Money:"
bUsesHelpWindow=False
actionButtons(0)=(Align=HALIGN_Right,Action=AB_OK)
actionButtons(1)=(Action=AB_Other,Text="BUY",Key="BUY")
actionButtons(2)=(Action=AB_Other,Text="AirStrike",Key="TRAVEL")
Title="Blackmarket"
ClientWidth=440
ClientHeight=244
bAlwaysRelevant=True
RemoteRole=ROLE_SimulatedProxy
NetPriority=1.5
}


This is the class that is spawning the guns. But I think I'll have to move the spawning to a player class because it doesn't seem to be replicating to server???
Last edited by bambi on Sat Jan 19, 13 4:51 pm, edited 1 time in total.
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby bambi » Thu Jun 13, 13 7:11 pm

Update: Lost all files again, restarting.

btw, the thejager, contact Poor, he wrote a menu for buying weapons, mine didn't work
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby thejager774 » Fri Jun 14, 13 6:48 pm

Okay, thanks for the reply, Um, im down for this if i can help you with anything.
I 'ported' 35hp_2 from CS to DX, and right now im working on dust2_long.
Just contact me on Facebook,Steam, or here in a PM if you need anything.
I hope clyzm is still down for this too. :oops:
thejager774
Newbie
 
Posts: 2
Joined: Thu Mar 01, 12 4:38 pm

Postby bambi » Sat Jun 15, 13 11:36 pm

Hey thejager, ok I gave up on the project for a while.

But lets do this! From what I gather, you are mostly a mapper? That's fine cuz I always felt the maps were too dx like for cs play. And way too dark. !

To do list:
1. keep making CS style maps [kind of done]
2. Weapons by Clyzm [done]
3. Coding gametypes and weapons buying menu [FCKING DISASTER!]

Any other codders are welcome to help. I'm thinking I'll upload a copy of the sauce to google docs taht way everyone can edit it and make it work. by everyone I mean alex and poor and nobody and clyzm and thatrpgguy and maybe atrey

LETS ROLL!
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby bambi » Thu Jun 20, 13 5:06 pm

Update: 06/20/13

1. I reused the code that I posted earlier and the same problem

Problem:
- Gun doesn't appear to be on the server, only seen by client. I am able to fire the gun once, but it doesn't actually fire in the server, only on the client screen. Then the gun freezes.

UGH! Anyone know??
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby Allan » Thu Jun 20, 13 10:07 pm

If I may make a suggestion: I struggled with a similar problem working with DXSM's window code for class selection. You've really got two choices:

A - Make a new playerclass and call a function from within that.
B - Pray this fix works - as I lack the components from your CS mod package to test it myself for you:

https://dl.dropboxusercontent.com/u/331 ... potFix.txt

You'll be wanting to replace your current ProcessAction and GiveWeapon with the ones included. Let me know how it pans out for 'ya.
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby bambi » Fri Jun 21, 13 2:58 am

Well thanks, it didn't work but thats ok. Imma give up on the menu buying weapons for now, as that's past my skill level right now,

hey jager I saw the map, looks good!
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Next

Return to Editing issues

Who is online

Users browsing this forum: No registered users and 11 guests
cron