Issues with iterating actors?

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

Moderator: Forum Guards

Issues with iterating actors?

Postby WCCC » Tue Apr 02, 13 11:08 am

Okay gents. Been a while since I've last posted, but I've run into a predicament and can use any help I can get. Summary in short: I am pursuing a lengthy and ambitious mod project, with a lot of goals in mind. I am currently programming a very versatile, open, and user friendly workbench where players can go through any of 7 actions to process materials, parts, and even entire items. I am currently on the 3rd screen, assembly, and recently made a slight tweak that has, for unknown reasons, starting invoking rather annoying crashes whenever the user leaves the window. After MUCH trial and error I've pinpointed the error down to a few things.

My conclusion is that THIS

Code: Select all
function LoadRecipe(int i)
{
 local class<Inventory> Recipe;
 local CraftingPart P, Q, R, S, T;
 local class<HatchetWeapon> W;
 
 local string P1, P2, P3, P4, P5;
 
 Recipe = Recipes[i];
 
 ResetPartCount();
 
 P1 = String(class<HatchetWeapon>(Recipe).Default.Parts[0]);
 P2 = String(class<HatchetWeapon>(Recipe).Default.Parts[1]);
 P3 = String(class<HatchetWeapon>(Recipe).Default.Parts[2]);
 P4 = String(class<HatchetWeapon>(Recipe).Default.Parts[3]);
 P5 = String(class<HatchetWeapon>(Recipe).Default.Parts[4]);
 
 if (Recipe != None)
 {
  if (class<HatchetWeapon>(Recipe) != None)
  {
   W = class<HatchetWeapon>(Recipe);
   
  if (P1 != "" && !(P1 ~= "None"))
  {
   forEach Bench.AllActors(class'CraftingPart', P)
   {
    if (P.Owner == Player && String(P.Class) ~= P1)
    {
     Parts1[NumPart1] = P;
     NumPart1++;
    }
   }
  }
  if (P2 != "" && !(P2 ~= "None"))
  {
   forEach Bench.AllActors(class'CraftingPart', Q)
   {
    if (Q.Owner == Player && String(Q.Class) ~= P2)
    {
     Parts2[NumPart2] = Q;
     NumPart2++;
    }
   }
  }
  if (P3 != "" && !(P3 ~= "None"))
  {
   forEach Bench.AllActors(class'CraftingPart', R)
   {
    if (R.Owner == Player && String(R.Class) ~= P3)
    {
     Parts3[NumPart3] = R;
     NumPart3++;
    }
   }
  }
  if (P4 != "" && !(P4 ~= "None"))
  {
   forEach Bench.AllActors(class'CraftingPart', S)
   {
    if (S.Owner == Player && String(S.Class) ~= P4)
    {
     Parts4[NumPart4] = S;
     NumPart4++;
    }
   }
  }
  if (P5 != "" && !(P5 ~= "None"))
  {
   forEach Bench.AllActors(class'CraftingPart', T)
   {
    if (T.Owner == Player && String(T.Class) ~= P5)
    {
     Parts5[NumPart5] = T;
     NumPart5++;
    }
   }
  }

  }
 }
 
 if (NumPart1 > 0)
 {
  NextPart1.SetBackground(Texture'HatchetWBCycleMicro2');
  PreviousPart1.SetBackground(Texture'HatchetWBCycleMicro1');
 }
 if (NumPart1 <0> 0)
 {
  NextPart2.SetBackground(Texture'HatchetWBCycleMicro2');
  PreviousPart2.SetBackground(Texture'HatchetWBCycleMicro1');
 }
 if (NumPart2 <0> 0)
 {
  NextPart3.SetBackground(Texture'HatchetWBCycleMicro2');
  PreviousPart3.SetBackground(Texture'HatchetWBCycleMicro1');
 }
 if (NumPart3 <0> 0)
 {
  NextPart4.SetBackground(Texture'HatchetWBCycleMicro2');
  PreviousPart4.SetBackground(Texture'HatchetWBCycleMicro1');
 }
 if (NumPart4 <0> 0)
 {
  NextPart5.SetBackground(Texture'HatchetWBCycleMicro2');
  PreviousPart5.SetBackground(Texture'HatchetWBCycleMicro1');
 }
 if (NumPart5 <= 0)
 {
  NextPart5.SetBackground(Texture'HatchetWBCycleMicro2Null');
  PreviousPart5.SetBackground(Texture'HatchetWBCycleMicro1Null');
 }

 CustomNameField.SetText(Recipe.Default.ItemName);
}


combined with this:

Code: Select all
function UpdatePositioning()
{
 local int TempX, TempY;
 
 local CraftingPart TempPart;
 
 TempPart = Parts1[CurPart1];
 
   if (TempPart != None)
   { 
    TempX = TempPart.WorkbenchOffsetX;
    TempY = TempPart.WorkbenchOffsetY;
   
    Part1Icon.SetPos(TempX, TempY);
   }

 TempPart = Parts2[CurPart2];
 
   if (TempPart != None)
   { 
    TempX = TempPart.WorkbenchOffsetX;
    TempY = TempPart.WorkbenchOffsetY;
   
    Part2Icon.SetPos(TempX, TempY);
   }

 TempPart = Parts3[CurPart3];
 
   if (TempPart != None)
   { 
    TempX = TempPart.WorkbenchOffsetX;
    TempY = TempPart.WorkbenchOffsetY;
   
    Part3Icon.SetPos(TempX, TempY);
   }

 TempPart = Parts4[CurPart4];
 
   if (TempPart != None)
   { 
    TempX = TempPart.WorkbenchOffsetX;
    TempY = TempPart.WorkbenchOffsetY;
   
    Part4Icon.SetPos(TempX, TempY);
   }

 TempPart = Parts5[CurPart5];
 
   if (TempPart != None)
   { 
    TempX = TempPart.WorkbenchOffsetX;
    TempY = TempPart.WorkbenchOffsetY;
   
    Part5Icon.SetPos(TempX, TempY);
   }
}


causes crashing if either the 4th iterator onwards runs from the first bit or ANY of the coordinate getting from the 2nd bit run.

Log Reads:

Code: Select all
<0>33550; refs: 372281
Log: Game class is 'HatchetGameInfo'
Log: Bringing Level DX.MyLevel up for play (0)...
ScriptLog: InitGame: ?Name=[MIRK-CDF]WCCC?Class=Hatchet.HatchetPlayer?Team=0?Skin=?Face=
ScriptLog: Base Mutator is DX.Mutator1
Init: Initialized moving brush tracker for Level DX.MyLevel
ScriptLog: Team 0
ScriptLog: Login: [MIRK-CDF]WCCC
Init: *** DEUS EX VERSION Mon Mar 19 12:06:14 2001 v1.112fm ***
Init: *** Cheats Enabled!  U R l337, d00D!  U r0X0r!
ScriptLog: Team 0
Log: Possessed PlayerPawn: HatchetPlayer DX.HatchetPlayer0
ScriptLog: All inventory from [MIRK-CDF]WCCC is accepted
Init: Input system initialized for WindowsViewport0
Localization: No localization: Hatchet.General.Product (int)
Log: Opened viewport
Localization: No localization: Hatchet.General.Product (int)
Log: Bound to D3DDrv.dll
Init: DirectDraw drivers detected:
Init:    display (Primary Display Driver)
Init: D3D Device: Supports system memory DMA blts
Log: D3D Device 3873904K vram, 3865804K free
Init: Deus Ex Direct3D support - internal revision 1.6.2
Init: D3D Device: szDriver=nvd3dum.dll
Init: D3D Device: szDescription=NVIDIA GeForce 9500 GT
Init: D3D Device: wProduct=0
Init: D3D Device: wVersion=0
Init: D3D Device: wSubVersion=0
Init: D3D Device: wBuild=0
Init: D3D Device: dwVendorId=4318
Init: D3D Device: dwDeviceId=1600
Init: D3D Device: dwSubSysId=105386206
Init: D3D Device: dwRevision=161
Init: Best-match display mode: 1366x768x32 (Error=0)
Init: D3D Driver: wMaxTextureBlendStages=8
Init: D3D Driver: wMaxSimultaneousTextures=8
Log: D3D Driver: Supports FOURCC DXT1
Log: D3D Driver: Supports FOURCC DXT2
Log: D3D Driver: Supports FOURCC DXT3
Log: D3D Driver: Supports FOURCC DXT4
Log: D3D Driver: Supports FOURCC DXT5
Log: D3D Driver: Supports FOURCC NVCS
Log: D3D Driver: Supports FOURCC NVHU
Log: D3D Driver: Supports FOURCC NVHS
Log: D3D Driver: Supports FOURCC NULL
Log: D3D Driver: Supports FOURCC ATI1
Log: D3D Driver: Supports FOURCC ATI2
Log: D3D Driver: Supports FOURCC INTZ
Log: D3D Driver: Supports FOURCC 3x11
Log: D3D Driver: Supports FOURCC 3x16
Init: D3D Detected: NVidia video card
Init: D3D Driver: Supports trilinear
Init: D3D Driver: Supports specular gouraud
Init: D3D Driver: Supports BLENDDIFFUSEALPHA
Init: D3D Driver: Supports alpha palettes
Init: D3D Driver: Supports non-power-of-2 textures
Init: D3D Driver: Supports LOD biasing
Init: D3D Driver: Supports Z biasing
Init: D3D Driver: Supports D3DTOP_ADDSIGNED2X
Init: D3D Driver: Supports D3DTOP_BUMPENVMAP
Init: D3D Driver: Supports D3DTOP_BUMPENVMAPLUMINANCE
Init: D3D Driver: Supports D3DTOP_DOTPRODUCT3
Init: D3D Driver: Supports D3DTOP_MODULATEALPHA_ADDCOLOR
Init: D3D Driver: Supports D3DTOP_MODULATECOLOR_ADDALPHA
Init: D3D Driver: Textures (1x1)-(8192x8192), Max aspect 8192
Log: Bound to Galaxy.dll
Init: Galaxy is using DirectSound
Init: Galaxy initialized
DevAudio: Galaxy SetViewport: WindowsViewport0
Init: Game engine initialized
Log: Startup time: 1.973853 seconds
Localization: No localization: Hatchet.General.Run (int)
DevMusic: Load music: Music HatchetMenu.HatchetMenu
Log: Loading: Package DXFonts
ScriptWarning: HatchetMenuMain DX.HatchetPlayer0.HatchetRootWindow0.HatchetMenuMain0 (Function Hatchet.HatchetMenuMain.UpdateButtonStatus:00B0) Accessed None
ScriptWarning: HatchetMenuMain DX.HatchetPlayer0.HatchetRootWindow0.HatchetMenuMain0 (Function Hatchet.HatchetMenuMain.UpdateButtonStatus:00B0) Accessed None
Log: Assigning Last Button Window to MenuUIMenuButtonWindow DX.HatchetPlayer0.HatchetRootWindow0.HatchetMenuMain0.MenuUIClientWindow0.MenuUIMenuButtonWindow0
Log: Assigning Last Button Window to MenuUIMenuButtonWindow DX.HatchetPlayer0.HatchetRootWindow0.HatchetMenuSelectDifficulty0.MenuUIClientWindow1.MenuUIMenuButtonWindow7
Log: Tried to remove lastbuttonwindow descendant. MenuUIMenuButtonWindow DX.HatchetPlayer0.HatchetRootWindow0.HatchetMenuSelectDifficulty0.MenuUIClientWindow1.MenuUIMenuButtonWindow7
Log: Export travel for: [MIRK-CDF]WCCC
Log: Browse: 01_TrainingGrounds?Name=[MIRK-CDF]WCCC?Class=Hatchet.HatchetPlayer?Team=0?Skin=?Face=
Log: Doing load, not loadgame
Log: Current mission number is -1, next is 1
Log: Attempting to get player
Log: Unloading: Package DX
Log: LoadMap: 01_TrainingGrounds?Name=[MIRK-CDF]WCCC?Class=Hatchet.HatchetPlayer?Team=0?Skin=?Face=
DevAudio: Galaxy SetViewport: WindowsViewport0
Log: Loading: Package 01_TrainingGrounds
Log: Loading: Package UNATCO
Log: Loading: Package CoreTexMetal
Log: Loading: Package CoreTexConcrete
Log: Loading: Package NewYorkCity
Log: Loading: Package MJ12_Lab
Log: Loading: Package CoreTexBrick
Log: Loading: Package HK_Helibase
Log: Loading: Package CoreTexStone
Log: Loading: Package CoreTexSky
Log: Loading: Package CoreTexEarth
Log: Loading: Package CoreTexTiles
Log: Loading: Package HatchetTraining
Init: Shut down moving brush tracker for Level DX.MyLevel
Init: *** Cheats Enabled!  U R l337, d00D!  U r0X0r!
Log: Collecting garbage
Log: Purging garbage
Log: Unloading: Package HatchetMenu
DevMusic: Unregister music: Music HatchetMenu.HatchetMenu
Log: Unloading: Package DXFonts
Log: Garbage: objects: 36214->35780; refs: 406566
Log: Game class is 'HatchetGameInfo'
Log: Bringing Level 01_TrainingGrounds.MyLevel up for play (0)...
ScriptLog: InitGame: ?Name=[MIRK-CDF]WCCC?Class=Hatchet.HatchetPlayer?Team=0?Skin=?Face=
ScriptLog: Base Mutator is 01_TrainingGrounds.Mutator2
Log: Loading: Package HatchetConvText
Log: Spawning new actor for Viewport WindowsViewport0
ScriptLog: Team 0
ScriptLog: Login: [MIRK-CDF]WCCC
ScriptLog: Team 0
Log: Possessed PlayerPawn: HatchetPlayer 01_TrainingGrounds.HatchetPlayer0
ScriptLog: All inventory from [MIRK-CDF]WCCC is accepted
Init: Initialized moving brush tracker for Level 01_TrainingGrounds.MyLevel
DevAudio: Galaxy SetViewport: WindowsViewport0
DevMusic: Load music: Music HatchetTraining.HatchetTraining
Log: Assigning Last Button Window to CraftingPersonaTextWindow 01_TrainingGrounds.HatchetPlayer0.HatchetRootWindow0.WorkBenchMenuRefine0.HatchetPulldownMenu0.CraftingPersonaTextWindow0
Log: Assigning Last Button Window to CraftingPersonaTextWindow 01_TrainingGrounds.HatchetPlayer0.HatchetRootWindow0.WorkBenchMenuRefine0.HatchetPulldownOption2.CraftingPersonaTextWindow8
Log: Tried to remove lastbuttonwindow descendant. CraftingPersonaTextWindow 01_TrainingGrounds.HatchetPlayer0.HatchetRootWindow0.WorkBenchMenuRefine0.HatchetPulldownOption2.CraftingPersonaTextWindow8
Log: Assigning Last Button Window to CraftingPersonaTextWindow 01_TrainingGrounds.HatchetPlayer0.HatchetRootWindow0.WorkBenchMenuAssemble0.HatchetPulldownMenu1.CraftingPersonaTextWindow12
Log: Assigning Last Button Window to CraftingPersonaTextWindow 01_TrainingGrounds.HatchetPlayer0.HatchetRootWindow0.WorkBenchMenuAssemble0.HatchetPulldownOption6.CraftingPersonaTextWindow19
Log: Tried to remove lastbuttonwindow descendant. CraftingPersonaTextWindow 01_TrainingGrounds.HatchetPlayer0.HatchetRootWindow0.WorkBenchMenuAssemble0.HatchetPulldownOption6.CraftingPersonaTextWindow19
Critical: UObject::ProcessEvent
Critical: UObject::GetFullName
Critical: XWindow::ProcessScript
Critical: XButtonWindow::ActivateButton
Critical: XButtonWindow::MouseButtonReleased
Critical: XRootWindow::HandleButtons
Critical: XRootWindow::Process
Critical: XInputExt::Process
Critical: UEngine::InputEvent
Critical: UWindowsViewport::CauseInputEvent
Critical: WM_BUTTONUP
Critical: UWindowsViewport::ViewportWndProc
Critical: WWindow::StaticProc
Critical: DispatchMessage
Critical: 00170320 514
Critical: MessagePump
Critical: MainLoop
Exit: Executing UObject::StaticShutdownAfterError
Exit: Executing UWindowsClient::ShutdownAfterError
Exit: UGalaxyAudioSubsystem::ShutdownAfterError
Exit: UD3DRenderDevice::ShutdownAfterError
Exit: Exiting.
Uninitialized: Name subsystem shut down
Uninitialized: Log file closed, 04/02/13 02:45:22


Which isnt really any help whatsoever, and the GPF message dislayed on crash reads:

Code: Select all
General Protection Fault!

History: UObject::ProcessEvent <- UObject::GetFullName <- XWindow::ProcessScript <- XButtonWindow::ActivateButton <- XButtonWindow::MouseButtonReleased <- XRootWindow::HandleButtons <- XRootWindow::Process <- XInputExt::Process <- UEngine::InputEvent <- UWindowsViewport::CauseInputEvent <- WM_BUTTONUP <- UWindowsViewport::ViewportWndProc <- WWindow::StaticProc <- DispatchMessage <- 00050394 514 <- MessagePump <- Main Loop


Thoughts? Crazy Theories? Questions? Doctor House Grade Miracles? Anything of input might help at this point.

EDIT: Copying and pasting somehow trampled over itself on original post, what the hell? Think I fixed it.[/code]
Last edited by WCCC on Tue Apr 02, 13 11:14 am, edited 1 time in total.
F*cking college... you're not my best friend anymore.
User avatar
WCCC
Wannabe
 
Posts: 82
Joined: Sat Sep 19, 09 7:23 pm
Location: California

Postby WCCC » Tue Apr 02, 13 2:36 pm

Well shoot. Now I kinda look stupid, but as it turns out, the reason running the 4th onwards of the iterators causes crashes although they are otherwise identical in makeup is because after running more than 3 of the same iterator per tick, the engine just gets tired of my crap and kinda gives out I guess? In any case I realized I could optimize the hell out of the iterations to make it all one iterator run now, something that wasn't previously possible because I used literal class comparisons and it wouldn't have played nice with nulls, but since I used a string converter in my desperate-to-fix-this-garbage fit, it's now possible to run all 5 checks inside of one iterator using string comparison without accessing any nulls, and lo and behold, having compressed this all into one iterator has stopped the crashes from occurring... for now. These have been on and off recently with all sorts of dumb stuff and makeshift solutions, but hey, I'm not complaining.
F*cking college... you're not my best friend anymore.
User avatar
WCCC
Wannabe
 
Posts: 82
Joined: Sat Sep 19, 09 7:23 pm
Location: California

Postby bambi » Wed Jan 22, 14 5:26 am

good you figured it out, hopefully us codders can try to help eachother out, honestly, that code is beyond my skill level
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 1 guest
cron