jager774
THIS IS SPARTAAA!!!
Posts: 358 Joined: 02 Dec 2011, 22:07 Nationality:
|
Hi! I started working on a CS gametype//mod. While im coding, im mapping for this too, as you've seen already i'm done with 35hp_2 Now im TRYING to create de_dust2 but thats not the topic of this post so back on topic: i'll use bambi's 'mutator' to create the Buy Menu i'll use clyzm's weapons with the whole mod(AK47, Shotgun, SawnOff Shotgun, Knife, Glock18, Silenced USP, and a Scout Tactical.) as you may have seen in my KnifeArena gametype, you get a knife on start, thats cool but-> I wanna make the gametype give a glock to the NSF team and give a USP to the Unatco team on spawn. The point of this would be to make it like CS, but keep it deus ex Can anyone help me with the 'if' line that decides if the player is NSF or Unatco and decides which weapon they should get? Atrey? DJ? Nobody?
|
|
|
|
|
~][FGS][Nobody~
Illuminated
Posts: 5359 Joined: 26 Oct 2005, 16:59 Location: Schland! Nationality:
|
- Code: Select all
//unatco check if(player.PlayerReplicationInfo.Team == 0) { //execute code for unatco player }
//nsf check if(player.PlayerReplicationInfo.Team == 1) { //execute code for nsf player }
Player is just a alias I used. You must ensure that it's a proper player reference yet.
Nobody is perfect... ----------------------- ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
Magus wrote:Maybe one day I will understand your arcane rituals of voting
chin.democ. wrote:You can use light bulbs that emit light, and when shot, do not.
synthetic wrote:and while every person is interesting in their own unique ways, there is some degree of uniqueness that a doctor can help with. ~ô¿ô~][FGS][Nobody~ said: THERE IS NO SPOON! ~¤¥ÐJ¥¤~ said: THERE IS NO CAKE!
|
|
|
|
|
jager774
THIS IS SPARTAAA!!!
Posts: 358 Joined: 02 Dec 2011, 22:07 Nationality:
|
Yyyup, that worked, thanks:) Another question, to anyone who can help. How much is the possibility of getting this code to work as a 'class' in the gametype? - 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 }
If its possible, i appreciate any kind of help. I suck at coding, I can only make basic things, so if any of you guys have the time, can you 'correct' this for me? It was written by bambi @ dxalpha its meant to be a buymenu after several trials on compiling i was like DJ MAY KNOW ABOUT THIS When I tried to compile it as it is, it said unknown type 'DXL' :c
|
|
|
|
|
~DJ~
Teh 1337'
Posts: 2647 Joined: 29 Jun 2008, 13:18
|
There should be a class called "DXL.uc", it's missing.. so uh, get it from where you got that class or talk to bambi?
That Resident Evil Mod———— ~][FGS][Nobody~ wrote:DONT SEARCH WORDS ON GOOGLE WITHOUT TINKING
~[FGS]SaSQuATcH~ wrote:you+serious=error
chin.democ. wrote:It's just what you're doing with your right hand that worries me....
|
|
|
|
|
jager774
THIS IS SPARTAAA!!!
Posts: 358 Joined: 02 Dec 2011, 22:07 Nationality:
|
I PM-d bambi on DXAlpha, waiting for his reply. until then look at this:
|
|
|
|
|
|
jager774
THIS IS SPARTAAA!!!
Posts: 358 Joined: 02 Dec 2011, 22:07 Nationality:
|
chin.democ. wrote:The map screenshot looks good, already looks like your mapping has improved since your last map.
Since my last map. Erm. 35hp_2?:D Thanks tho
|
|
|
|
|
jager774
THIS IS SPARTAAA!!!
Posts: 358 Joined: 02 Dec 2011, 22:07 Nationality:
|
Aaand im done! ( Yep its only the long part, but i will finish the other parts too, when i got time. For the last days i didnt play anything, this map took all my time Now, im going to play some dx and take a restD: Anyway here it is: DXCS_Dust2_long.rar THE MAP IS SO *loving* HUGE i oversized it:\ can i downsize it a little bit somehow?:o Otherwise i think its good Whats your opinion guys?
You do not have the required permissions to view the files attached to this post.
|
|
|
|
|
|
jager774
THIS IS SPARTAAA!!!
Posts: 358 Joined: 02 Dec 2011, 22:07 Nationality:
|
You do not have the required permissions to view the files attached to this post.
|
|
|
|
|
~][FGS][Nobody~
Illuminated
Posts: 5359 Joined: 26 Oct 2005, 16:59 Location: Schland! Nationality:
|
You didn't edit/modify an existing old texture package without renaming, did you?
Nobody is perfect... ----------------------- ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
Magus wrote:Maybe one day I will understand your arcane rituals of voting
chin.democ. wrote:You can use light bulbs that emit light, and when shot, do not.
synthetic wrote:and while every person is interesting in their own unique ways, there is some degree of uniqueness that a doctor can help with. ~ô¿ô~][FGS][Nobody~ said: THERE IS NO SPOON! ~¤¥ÐJ¥¤~ said: THERE IS NO CAKE!
|
|
|
|
|
jager774
THIS IS SPARTAAA!!!
Posts: 358 Joined: 02 Dec 2011, 22:07 Nationality:
|
Yea i forgot to rename it before saving:(
|
|
|
|
|
Magus
THIS IS SPARTAAA!!!
Posts: 345 Joined: 27 Aug 2005, 15:41 Location: Manchester, England Nationality:
|
jager774 wrote:Yea i forgot to rename it before saving:(
whywouldyoudothis.jpg
-- Magus "There are 10 kinds of people in the world - those who understand binary, and those who don't"
|
|
|
|
|
jager774
THIS IS SPARTAAA!!!
Posts: 358 Joined: 02 Dec 2011, 22:07 Nationality:
|
Magus wrote:jager774 wrote:Yea i forgot to rename it before saving:(
whywouldyoudothis.jpg
idk.avi
|
|
|
|
|