Home » MODDING HQ 1.13 » Flugente's Magika Workshop » Absurdly small code changes
() 1 Vote
|
|
|
Re: Absurdly small code changes[message #324261]
|
Fri, 23 August 2013 13:15
|
|
acqsen |
|
Messages:17
Registered:December 2011 |
|
|
I'd like to ask for three small features, probably too small to make a separate topic
Feature1
Show (enemy) soldiers energy and morale in the tooltip, if it is set to show all information
SOLDIER_TOOLTIP_DETAIL_LEVEL = 4
why i need thisenergy -- to see how much stun/breath dmg some melee weapons are doing, as i feel it is not enough stun and too much hp dmg
morale -- to test if asking last live soldier to surrender will work while his morale is low
morale2 -- to see how the morale for enemies works
more things but these were just the most hot issues
Feature2
Capturing and Sending Police to prison (and other hostile civilians)
more explanation on this in capturing topic here
Feautre3
Slow/reduce Merc dying by introducing negative hp's
How it would work:
-merc hp_max=60, shot for 65, drops down with -5hp.
-looses x each turn (the old way)
-each turn x% of insta death
-drops to -10hp = 50%death
-drops to -20hp = 100%death (15 is max_hp/3)
why i ask thisMerc die too fast, meaning they die instantly (or go around with 2hp). It is unrealistic. People sometimes can take a lot of beating before they die and usually it takes more time rather then instantly. Also it is often possible to save a dying person if proper help is there. JA2 is mostly unforgiving in that matter.
Report message to a moderator
|
Private
|
|
|
Re: Absurdly small code changes[message #324282]
|
Sat, 24 August 2013 00:23
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
AcqsenI'd like to ask for three small features, probably too small to make a separate topic
Feature1
Show (enemy) soldiers energy and morale in the tooltip, if it is set to show all information
SOLDIER_TOOLTIP_DETAIL_LEVEL = 4
why i need thisenergy -- to see how much stun/breath dmg some melee weapons are doing, as i feel it is not enough stun and too much hp dmg
morale -- to test if asking last live soldier to surrender will work while his morale is low
morale2 -- to see how the morale for enemies works
more things but these were just the most hot issues
That seems reasonable. Note that morale isn't as straightforward as one thinks it is (there are 4-5 several values that influence each other for mercs, and AI morale works different again). Morale influences surrender strength, but unless you know the other values of the soldier (and those of your team), morale is not a good indicator of wether the enemy will surrender or not.
AcqsenFeature2
Capturing and Sending Police to prison (and other hostile civilians)
more explanation on this in capturing topic here Answer in that thread.
AcqsenFeautre3
Slow/reduce Merc dying by introducing negative hp's
How it would work:
-merc hp_max=60, shot for 65, drops down with -5hp.
-looses x each turn (the old way)
-each turn x% of insta death
-drops to -10hp = 50%death
-drops to -20hp = 100%death (15 is max_hp/3)
why i ask thisMerc die too fast, meaning they die instantly (or go around with 2hp). It is unrealistic. People sometimes can take a lot of beating before they die and usually it takes more time rather then instantly. Also it is often possible to save a dying person if proper help is there. JA2 is mostly unforgiving in that matter.
The current system already does what you want. If your HPs drop below 15, a merc is dying - he loses consciousness and is helpless. As he'll bleed at that point, he'll bleed to death without assistance.
Instadeath on mercs is a bad idea imho. Your merc is already dying in a few turns. Why the need for a sudden chance of even faster death?
Report message to a moderator
|
|
|
|
|
|
Re: Absurdly small code changes[message #324324]
|
Sun, 25 August 2013 17:57
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
? Now that doesn't make sense... seems like some icons are overwritten... ??? I'm on it.
Edit: Fixed in r6317.
[Updated on: Sun, 25 August 2013 18:29] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Absurdly small code changes[message #326812]
|
Sat, 19 October 2013 06:54
|
|
Moa |
|
Messages:58
Registered:September 2013 |
|
|
Alot of changes, but hopefully nobody will notice the difference
-SGP debugging now works again (corrected some typos and one missing include).
-Memmory debugging works again (wrong types corrected)
-Laptop screen heigth macro and all references is now usable. (was 'C: y + A' 'D: B - C' which translates to 'D: B - y + A' instead of 'D: B - y - A')
-Laptop screens do not need to rerender as often then before as the laptop screen width/heigth macros works now and invalidating screen will do the trick -> almost no render calls neccessary.
-MercProfile.ubMiscFlag was used instead of .ubMiscFlag2 -> enter sector action schedule for soldiers which dont need to be insertered is now canceled as intended.does it solve the long delay on entering sector via tactical? probably not, but something is now working (differently)
http://www.file-upload.net/download-8193881/SGPdebug_Typos_LaptopRegionDefine.patch.html
Toggle Spoiler
Index: Laptop/aim.h
===================================================================
--- Laptop/aim.h (revision 6464)
+++ Laptop/aim.h (working copy)
@@ -78,7 +78,8 @@
#define BOTTOM_BUTTON_START_HEIGHT 18
#define BOTTOM_BUTTON_START_X LAPTOP_SCREEN_UL_X + 25
-#define BOTTOM_BUTTON_START_Y LAPTOP_SCREEN_WEB_LR_Y - BOTTOM_BUTTON_START_HEIGHT - 57
+//#define BOTTOM_BUTTON_START_Y LAPTOP_SCREEN_WEB_LR_Y - BOTTOM_BUTTON_START_HEIGHT - 57
+#define BOTTOM_BUTTON_START_Y (LAPTOP_SCREEN_WEB_LR_Y - BOTTOM_BUTTON_START_HEIGHT - 3)
#define BOTTOM_BUTTON_AMOUNT NUM_AIM_SCREENS
#define BOTTOM_BUTTON_GAP 0
#define BOTTOM_BUTTON_TEXT_Y BOTTOM_BUTTON_START_Y + 6
Index: Laptop/BobbyRAmmo.cpp
===================================================================
--- Laptop/BobbyRAmmo.cpp (revision 6464)
+++ Laptop/BobbyRAmmo.cpp (working copy)
@@ -95,8 +95,9 @@
MarkButtonsDirty( );
RenderWWWProgramTitleBar( );
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
- fReDrawScreenFlag = TRUE;
- fPausedReDrawScreenFlag = TRUE;
+ //Moa removed below. See comment above LAPTOP_SCREEN_UL_X in laptop.h
+ // fReDrawScreenFlag = TRUE;
+ //fPausedReDrawScreenFlag = TRUE;
}
Index: Laptop/BobbyRArmour.cpp
===================================================================
--- Laptop/BobbyRArmour.cpp (revision 6464)
+++ Laptop/BobbyRArmour.cpp (working copy)
@@ -97,8 +97,9 @@
MarkButtonsDirty( );
RenderWWWProgramTitleBar( );
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
- fReDrawScreenFlag = TRUE;
- fPausedReDrawScreenFlag = TRUE;
+ //Moa removed below. See comment above LAPTOP_SCREEN_UL_X in laptop.h
+ // fReDrawScreenFlag = TRUE;
+ //fPausedReDrawScreenFlag = TRUE;
}
Index: Laptop/BobbyRGuns.cpp
===================================================================
--- Laptop/BobbyRGuns.cpp (revision 6464)
+++ Laptop/BobbyRGuns.cpp (working copy)
@@ -467,8 +467,9 @@
RenderWWWProgramTitleBar( );
//InvalidateRegion(0,0,SCREEN_WIDTH, SCREEN_HEIGHT);
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
- fReDrawScreenFlag = TRUE;
- fPausedReDrawScreenFlag = TRUE;
+ //Moa removed below. See comment above LAPTOP_SCREEN_UL_X in laptop.h
+ // fReDrawScreenFlag = TRUE;
+ //fPausedReDrawScreenFlag = TRUE;
}
Index: Laptop/BobbyRMisc.cpp
===================================================================
--- Laptop/BobbyRMisc.cpp (revision 6464)
+++ Laptop/BobbyRMisc.cpp (working copy)
@@ -97,8 +97,9 @@
MarkButtonsDirty( );
RenderWWWProgramTitleBar( );
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
- fReDrawScreenFlag = TRUE;
- fPausedReDrawScreenFlag = TRUE;
+ //Moa removed below. See comment above LAPTOP_SCREEN_UL_X in laptop.h
+ // fReDrawScreenFlag = TRUE;
+ //fPausedReDrawScreenFlag = TRUE;
}
Index: Laptop/BobbyRUsed.cpp
===================================================================
--- Laptop/BobbyRUsed.cpp (revision 6464)
+++ Laptop/BobbyRUsed.cpp (working copy)
@@ -93,8 +93,9 @@
MarkButtonsDirty( );
RenderWWWProgramTitleBar( );
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
- fReDrawScreenFlag = TRUE;
- fPausedReDrawScreenFlag = TRUE;
+ //Moa removed below. See comment above LAPTOP_SCREEN_UL_X in laptop.h
+ // fReDrawScreenFlag = TRUE;
+ //fPausedReDrawScreenFlag = TRUE;
}
Index: Laptop/BrokenLink.cpp
===================================================================
--- Laptop/BrokenLink.cpp (revision 6464)
+++ Laptop/BrokenLink.cpp (working copy)
@@ -61,7 +61,7 @@
void DrawBrokenLinkWhiteBackground()
{
- ColorFillVideoSurfaceArea( FRAME_BUFFER, LAPTOP_SCREEN_UL_X, LAPTOP_SCREEN_WEB_UL_Y, LAPTOP_SCREEN_LR_X, LAPTOP_SCREEN_WEB_LR_Y - 55, Get16BPPColor( FROMRGB( 255, 255, 255) ) );
+ ColorFillVideoSurfaceArea( FRAME_BUFFER, LAPTOP_SCREEN_UL_X, LAPTOP_SCREEN_WEB_UL_Y, LAPTOP_SCREEN_LR_X, LAPTOP_SCREEN_WEB_LR_Y /*- 55*/, Get16BPPColor( FROMRGB( 255, 255, 255) ) );
}
Index: Laptop/laptop.h
===================================================================
--- Laptop/laptop.h (revision 6464)
+++ Laptop/laptop.h (working copy)
@@ -173,22 +173,22 @@
#define LAPTOP_X iScreenWidthOffset
#define LAPTOP_Y iScreenHeightOffset
+//Moa: added brackets around definitions below to make them work. Especialy LAPTOP_SCREEN_HEIGHT and all its references resulted in wrong regions for invalidating screen which in return forced to redraw the screen emidiatly after render as invalidate did not work. Removed those redraw flags from all render functions I found (f.i.RenderBobbyRUsed()), but most likely missed some of them.
+#define LAPTOP_SCREEN_UL_X (iScreenWidthOffset + 111)
+#define LAPTOP_SCREEN_UL_Y (iScreenHeightOffset + 27)
-#define LAPTOP_SCREEN_UL_X iScreenWidthOffset + 111
-#define LAPTOP_SCREEN_UL_Y iScreenHeightOffset + 27
+#define LAPTOP_SCREEN_LR_X (iScreenWidthOffset + 613)
+#define LAPTOP_SCREEN_LR_Y (iScreenHeightOffset + 427)
+#define LAPTOP_UL_X (iScreenWidthOffset + 24)
+#define LAPTOP_UL_Y (iScreenHeightOffset + 27)
-#define LAPTOP_SCREEN_LR_X iScreenWidthOffset + 613
-#define LAPTOP_SCREEN_LR_Y iScreenHeightOffset + 427
-#define LAPTOP_UL_X iScreenWidthOffset + 24
-#define LAPTOP_UL_Y iScreenHeightOffset + 27
+#define LAPTOP_SCREEN_WIDTH (LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X)
+#define LAPTOP_SCREEN_HEIGHT (LAPTOP_SCREEN_LR_Y - LAPTOP_SCREEN_UL_Y)
-#define LAPTOP_SCREEN_WIDTH LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X
-#define LAPTOP_SCREEN_HEIGHT LAPTOP_SCREEN_LR_Y - LAPTOP_SCREEN_UL_Y
-
// new positions for web browser
-#define LAPTOP_SCREEN_WEB_UL_Y LAPTOP_SCREEN_UL_Y + 19
-#define LAPTOP_SCREEN_WEB_LR_Y LAPTOP_SCREEN_WEB_UL_Y + LAPTOP_SCREEN_HEIGHT
+#define LAPTOP_SCREEN_WEB_UL_Y (LAPTOP_SCREEN_UL_Y + 19)
+#define LAPTOP_SCREEN_WEB_LR_Y (LAPTOP_SCREEN_WEB_UL_Y + LAPTOP_SCREEN_HEIGHT)
#define LAPTOP_SCREEN_WEB_DELTA_Y 19 //LAPTOP_SCREEN_WEB_UL_Y - LAPTOP_SCREEN_UL_Y
// the laptop on/off button
Index: MainMenuScreen.cpp
===================================================================
--- MainMenuScreen.cpp (revision 6464)
+++ MainMenuScreen.cpp (working copy)
@@ -28,6 +28,7 @@
#include "Multi Language Graphic Utils.h"
#include "Encrypted File.h"
#include "ja2 splash.h"
+ #include "GameVersion.h"
#endif
#include "gamesettings.h"
Index: Standard Gaming Platform/Button System.cpp
===================================================================
--- Standard Gaming Platform/Button System.cpp (revision 6464)
+++ Standard Gaming Platform/Button System.cpp (working copy)
@@ -152,6 +152,11 @@
return ButtonPictures[ usButtonPicID ].vobj->pETRLEObject[ iSlot ].usWidth;
}
+UINT16 GetHeightOfButtonPic( UINT16 usButtonPicID, INT32 iSlot )
+{
+ return ButtonPictures[ usButtonPicID ].vobj->pETRLEObject[ iSlot ].usHeight;
+}
+
HVOBJECT GenericButtonGrayed[MAX_GENERIC_PICS];
HVOBJECT GenericButtonOffNormal[MAX_GENERIC_PICS];
HVOBJECT GenericButtonOffHilite[MAX_GENERIC_PICS];
Index: Standard Gaming Platform/Button System.h
===================================================================
--- Standard Gaming Platform/Button System.h (revision 6464)
+++ Standard Gaming Platform/Button System.h (working copy)
@@ -360,6 +360,7 @@
void DrawCheckBoxButtonOff( INT32 iButtonID );
extern UINT16 GetWidthOfButtonPic( UINT16 usButtonPicID, INT32 iSlot );
+extern UINT16 GetHeightOfButtonPic( UINT16 usButtonPicID, INT32 iSlot );
#endif
Index: Standard Gaming Platform/MemMan.cpp
===================================================================
--- Standard Gaming Platform/MemMan.cpp (revision 6464)
+++ Standard Gaming Platform/MemMan.cpp (working copy)
@@ -510,8 +510,8 @@
{
PTR ptr;
UINT16 usLength;
- UINT8 str[70];
- UINT8 *pStr;
+ CHAR8 str[70];
+ STR8 pStr;
if( !size )
{
@@ -553,7 +553,7 @@
usLength = strlen( str ) + 1;
gpMemoryTail->pCode = (UINT8*)malloc( usLength );
memset( gpMemoryTail->pCode, 0, usLength );
- strcpy( gpMemoryTail->pCode, str );
+ strcpy( (STR8)gpMemoryTail->pCode, str );
//record the size
gpMemoryTail->uiSize = size;
@@ -617,8 +617,8 @@
MEMORY_NODE *curr;
PTR ptrNew;
UINT16 usLength;
- UINT8 str[70];
- UINT8 *pStr;
+ CHAR8 str[70];
+ STR8 pStr;
if( !ptr && size )
{
@@ -654,7 +654,7 @@
usLength = strlen( str ) + 1;
curr->pCode = (UINT8*)malloc( usLength );
memset( curr->pCode, 0, usLength );
- strcpy( curr->pCode, str );
+ strcpy( (STR8)curr->pCode, str );
}
else
{
@@ -672,13 +672,13 @@
UINT8 str[70];
}DUMPFILENAME;
-void DumpMemoryInfoIntoFile( UINT8 *filename, BOOLEAN fAppend )
+void DumpMemoryInfoIntoFile( CHAR8 *filename, BOOLEAN fAppend )
{
MEMORY_NODE *curr;
FILE *fp;
DUMPFILENAME *pCode;
UINT32 *puiCounter, *puiSize;
- UINT8 tempCode[ 70 ];
+ CHAR8 tempCode[ 70 ];
UINT32 i, uiUniqueID, uiTotalKbWasted = 0, uiBytesRemainder = 0;
BOOLEAN fFound;
@@ -712,11 +712,11 @@
curr = gpMemoryHead;
while( curr )
{
- strcpy( tempCode, curr->pCode );
+ strcpy( tempCode, (CHAR8*)curr->pCode );
fFound = FALSE;
for( i = 0; i < uiUniqueID; i++ )
{
- if( !_stricmp( tempCode, pCode[i].str ) )
+ if( !_stricmp( tempCode, (CHAR8*)pCode[i].str ) )
{ //same string
fFound = TRUE;
(puiCounter[ i ])++;
@@ -726,7 +726,7 @@
}
if( !fFound )
{
- strcpy( pCode[i].str, tempCode );
+ strcpy( (CHAR8*)pCode[i].str, tempCode );
(puiSize[ i ]) += curr->uiSize;
(puiCounter[ i ])++;
uiUniqueID++;
Index: Standard Gaming Platform/MemMan.h
===================================================================
--- Standard Gaming Platform/MemMan.h (revision 6464)
+++ Standard Gaming Platform/MemMan.h (working copy)
@@ -58,7 +58,7 @@
//This is the most effective way to debug memory leaks. Each memory leak will be recorded in a linked
//list containing a string referring to the location in code the memory was allocated in addition to
//the number of occurrences. The shutdown code will report all unhandled memory with exact location allocated.
- void DumpMemoryInfoIntoFile( UINT8 *filename, BOOLEAN fAppend );
+ void DumpMemoryInfoIntoFile( CHAR8 *filename, BOOLEAN fAppend );
BOOLEAN _AddAndRecordMemAlloc( UINT32 size, UINT32 uiLineNum, UINT8 *pSourceFile );
#define MemAlloc( size ) MemAllocXDebug( (size), __FILE__, __LINE__, NULL )
#define MemFree( ptr ) MemFreeXDebug( (ptr), __FILE__, __LINE__, NULL )
Index: Tactical/Overhead.cpp
===================================================================
--- Tactical/Overhead.cpp (revision 6464)
+++ Tactical/Overhead.cpp (working copy)
@@ -2138,7 +2138,7 @@
// CHECK IF THIS TILE IS A GOOD ONE!
if ( !HandleNextTile( pSoldier, (INT8)pSoldier->pathing.usPathingData[ pSoldier->pathing.usPathIndex ], usNewGridNo, pSoldier->pathing.sFinalDestination ) )
{
- DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "HandleGotoNewGridNo() Failed: Tile %d Was blocked", sNewGridNo ) );
+ DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "HandleGotoNewGridNo() Failed: Tile %d Was blocked", usNewGridNo ) );
// ATE: If our own guy and an initial move.. display message
//if ( fInitialMove && pSoldier->bTeam == gbPlayerNum )
Index: Tactical/Points.cpp
===================================================================
--- Tactical/Points.cpp (revision 6464)
+++ Tactical/Points.cpp (working copy)
@@ -188,7 +188,7 @@
default:
- DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("Calc AP: Unrecongnized MP type %d in %d, direction %d", sSwitchValue, sGridno, bDir ) );
+ DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("Calc AP: Unrecongnized MP type %d in %d, direction %d", sSwitchValue, sGridNo, bDir ) );
break;
Index: Tactical/Soldier Tile.cpp
===================================================================
--- Tactical/Soldier Tile.cpp (revision 6464)
+++ Tactical/Soldier Tile.cpp (working copy)
@@ -82,7 +82,7 @@
if ( uiLoop > pSoldier->pathing.usPathIndex )
{
usTemp = NewGridNo( usTemp, DirectionInc( (UINT8)pSoldier->pathing.usPathingData[ uiLoop ] ) );
- DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String(" Soldier path[%d]: %d == gridno %d", uiLoop, pSoldier->pathing.usPathingData[uiLoop], sTemp ) );
+ DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String(" Soldier path[%d]: %d == gridno %d", uiLoop, pSoldier->pathing.usPathingData[uiLoop], usTemp ) );
}
else if ( uiLoop == pSoldier->pathing.usPathIndex )
{
Index: TacticalAI/DecideAction.cpp
===================================================================
--- TacticalAI/DecideAction.cpp (revision 6464)
+++ TacticalAI/DecideAction.cpp (working copy)
@@ -466,7 +466,7 @@
break;
case SCHEDULE_ACTION_ENTERSECTOR:
- if ( pSoldier->ubProfile != NO_PROFILE && gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags & PROFILE_MISC_FLAG2_DONT_ADD_TO_SECTOR )
+ if ( pSoldier->ubProfile != NO_PROFILE && gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags2 & PROFILE_MISC_FLAG2_DONT_ADD_TO_SECTOR )//Moa: changed 'ubMiscFlags' to 'ubMiscFlags2'
{
// ignore.
DoneScheduleAction( pSoldier );
@@ -7007,7 +7007,7 @@
case ATTACKSLAYONLY:bSeekPts += +1; bHelpPts += 0; bWatchPts += 0; break;
}
- DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("decideactionred: hide = %d, seek = %d, watch = %d, help = %d",bHidePts,bSeekPts,bWatchPts,bHelpPts));
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("decideactionred: hide = %d, seek = %d, watch = %d, help = %d",0,bSeekPts,bWatchPts,bHelpPts));
// while one of the three main RED REACTIONS remains viable
while ((bSeekPts > -90) || (bHelpPts > -90) )
{
Index: XML_Layout_MainMenu.cpp
===================================================================
--- XML_Layout_MainMenu.cpp (revision 6464)
+++ XML_Layout_MainMenu.cpp (working copy)
@@ -209,7 +209,7 @@
mainMenuParseData pData;
- DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading Layout\LayoutMainMenu.xml" );
+ DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading Layout:LayoutMainMenu.xml" );
// Open file
hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );
Report message to a moderator
|
Corporal
|
|
|
|
|
|
|
Goto Forum:
Current Time: Tue Jan 21 21:39:29 GMT+2 2025
Total time taken to generate the page: 0.02489 seconds
|