Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the
ZDoom wiki first. This forum is archived - please use
this set of forums to ask new questions.
The Ultimate DooMer
Posts: 2109 Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone
Post
by The Ultimate DooMer » Fri Jul 08, 2005 1:43 pm
When I use ACS_ExecuteWithResult it doesn't work, what am I doing wrong:
Code: Select all
Use:
PTN2 A 1 ACS_ExecuteWithResult (303, 0, 0, 0)
PTN2 A 0 A_GiveInventory ("HealthBonus", 25)
Stop
Code: Select all
script 303 (void)
{
if(currenthealth < health)
{
SetResultValue (1);
}
if(currenthealth >= health)
{
SetResultValue (0);
}
}
Graf Zahl
Lead GZDoom+Raze Developer
Posts: 49223 Joined: Sat Jul 19, 2003 10:19 am
Location: Germany
Post
by Graf Zahl » Fri Jul 08, 2005 2:19 pm
The result of ACS_ExecuteWithResult isn't used. A_GiveInventory succeeds giving the health bonus and sets the overall result is true.
Apparently there needs to be an A_JumpIfResult code pointer to use this...
The Ultimate DooMer
Posts: 2109 Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone
Post
by The Ultimate DooMer » Fri Jul 08, 2005 2:27 pm
Yay for inventory hacks
btw, is the Fail implemented yet? (it crashes when it goes off)
Graf Zahl
Lead GZDoom+Raze Developer
Posts: 49223 Joined: Sat Jul 19, 2003 10:19 am
Location: Germany
Post
by Graf Zahl » Fri Jul 08, 2005 2:50 pm
Fail should be in.
Regarding the problem here: Why don't you give the HealthBonus inside the script? There you have access to all the data you need.
The Ultimate DooMer
Posts: 2109 Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone
Post
by The Ultimate DooMer » Fri Jul 08, 2005 4:30 pm
Because I don't want the item to be used if the health is at it's limit.
btw, the crash:
Spoiler:
Code: ACCESS_VIOLATION
Flags: 00000000
Address: 00000003
Windows 9x 4.10 Build 67766446 A
GS=0000 FS=86e7 ES=0177 DS=0177
EAX=012ee080 EBX=012ee100 ECX=01dd33c0 EDX=012ee060
ESI=00000001 EDI=01dd33c0
EBP=00000013 EIP=00000003 ESP=008cf960 CS=016f SS=0177
EFlags=00010a07
CF+ PF+ AF- ZF- SF- TF- IF+ DF- OF+ NT- RF+ VM- AC- VI- VP-
FPU State:
ControlWord=027f StatusWord=0122 TagWord=ffff
ErrorOffset=1002b375
ErrorSelector=015d016f
DataOffset=0166ff70
DataSelector=ffff0177
Cr0NpxState=0000000a
MM0=0000000000000000
MM1=00f9fcfd0006a0d3
MM2=bbb98c0000000000
MM3=0000000000000000
MM4=000000000000000a
MM5=0000000101dd33c0
MM6=00000013012ee080
MM7=00000177008cf960
Running threads:
ffe44b03 at 00000003*
ffe44fab
fff9ce2b
fff9d007
ffe5d653
Loaded modules:
baaa0000 - baafefff DDRAW.DLL
77ea0000 - 77f06fff SETUPAPI.DLL
7f810000 - 7f81afff CFGMGR32.DLL
7fe40000 - 7fe48fff WINSPOOL.DRV
bfe60000 - bfe65fff LZ32.DLL
7d060000 - 7d068fff HID.DLL
70000000 - 70037fff DINPUT8.DLL
beaf0000 - beb63fff DSOUND.DLL
bfe70000 - bfe75fff VERSION.DLL
5ef80000 - 5ef83fff KSUSER.DLL
bfee0000 - bfee4fff NTDLL.DLL
7fbf0000 - 7fbfdfff MPR.DLL
00400000 - 0069dfff ZDOOM.EXE
7fe10000 - 7fe3cfff COMDLG32.DLL
7fcb0000 - 7fe05fff SHELL32.DLL
10000000 - 10095fff FMOD.DLL
7b620000 - 7b638fff MSACM32.DLL
bfdf0000 - bfdfffff WINMM.DLL
75fa0000 - 75fa9fff WSOCK32.DLL
794d0000 - 794e4fff MSWSOCK.DLL
76000000 - 76011fff WS2_32.DLL
63000000 - 63095fff WININET.DLL
70a70000 - 70ad5fff SHLWAPI.DLL
65340000 - 653dafff OLEAUT32.DLL
7ff20000 - 7ffe0fff OLE32.DLL
5cf00000 - 5cf5dfff CRYPT32.DLL
7fb90000 - 7fbe1fff RPCRT4.DLL
79e00000 - 79e24fff MSOSS.DLL
75fe0000 - 75fe5fff WS2HELP.DLL
78000000 - 78045fff MSVCRT.DLL
bfb70000 - bfbf7fff COMCTL32.DLL
bff50000 - bff60fff USER32.DLL
bff20000 - bff45fff GDI32.DLL
bfe80000 - bfe8ffff ADVAPI32.DLL
bff70000 - bffe2fff KERNEL32.DLL
Bytes near EIP:
fffffff3: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
00000003: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
00000013: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
ZDoom version 2.0.96x-2 (The Ultimate ZDoom)
Command line:
zdoom.exe -file C:\GAMES\HEXEN\WAUTHOR\SRTEST.WAD C:\GAMES\HEXEN\WAUTHOR\_SERPNTG.WAD _serpnti.wad -warp 01 -nomusic -skill 4
IWAD: hexen.wad
Current map: MAP01
viewx = 2632749
viewy = 19107968
viewz = 2675038
viewangle = 2436890624
Possible call trace:
00000003 BOOM
00499e51 call [eax+0x8]
004b0d95 call 00499e20
004622dd call 004b0d80
0047a785 call 004622c0
0041a455 call [eax+0x98]
00515f6b
0048be78
00419a03 call 0051cc4a
0041ac9d call 00419590
0041d954 call 0041a0a0
0042a3d2 call 0041d8f0
0041bfd2 call 0042a210
00417f9c call 0041bce0
0040b213 call 0040b160
0040b213 call 0040b160
004a7881 call 0040b200
004a7983 call 0051cc4a
004a48d0 call 00417ff0
004a4c05 call 004a44c0
0052017a call 004a4b90
0052000e call 0051d9f0
0051fff6
Stack Contents:
008cf960: 00499e51 01dd33c0 01dd6840 012ee140 Q·I··3··@h··@·.·
008cf970: 004b0d95 01dd6840 012ee140 004622dd ··K·@h··@·.··"F·
008cf980: 00000000 01dd6840 0047a785 01dd6840 ····@h····G·@h··
008cf990: 00000000 008cfaf0 005fff00 0041a455 ··········_·U·A·
008cf9a0: 01dd6840 01df94b5 00000000 005fdc80 @h············_·
008cf9b0: 005fffe8 84807d60 848053b8 bff7b9c5 ··_·`}···S······
008cf9c0: 81cf964c 00000000 baacd9ab 00000013 L···············
008cf9d0: 00515f6b 01130f28 00000000 00000008 k_Q·(···········
008cf9e0: 008cfa70 bff7b9c5 81cf964c bff9b50c p·······L·······
008cf9f0: 008c7000 baab7f2c 84807d1c 01130f28 ·p··,···}··(···
008cfa00: 00000001 84805670 00000000 00000000 ····pV··········
008cfa10: 00000004 b015ea40 00000000 00000000 ····@···········
008cfa20: 00000000 e3010000 8ebae000 e3010000 ················
008cfa30: 8490601c 848053b8 84805598 00000008 ·`···S···U······
008cfa40: 00000000 b00c69e0 00000000 00000000 ·····i··········
008cfa50: 1000c238 00000000 0048be78 94d2fcc1 8·······x·H·····
008cfa60: 00000000 b00c69e0 b00c69e0 8480557c ·····i···i··|U··
008cfa70: 00000003 00000001 84807d1c 00000000 ·········}······
008cfa80: baab7277 00000320 01130f28 00000000 wr·· ···(·······
008cfa90: 00000000 8490601c 848050d0 00000008 ·····`···P······
008cfaa0: 000000f8 00000000 00419a03 00000000 ··········A·····
008cfab0: 848054e4 848053b8 8480557c 008cf9d0 ·T···S··|U······
008cfac0: bff7b9c5 008cfb48 baaec8f8 150aa90d ····H···········
008cfad0: 0041ac9d 00000001 150aa90d 0041d954 ··A·········T·A·
008cfae0: 00000000 00000001 00000000 006020fe ············· `·
008cfaf0: 01df94b5 00000005 0042a3d2 0000008b ··········B·····
008cfb00: 00000001 00000001 00000000 006033fc ·············3`·
008cfb10: 0000001e cf98524f 0041bfd2 000000f8 ····OR····A·····
008cfb20: 01dd0f10 008cfb54 00000001 00417f9c ····T········A·
008cfb30: 000000f8 01dd0f10 00000001 00000001 ················
008cfb40: 0000008a 008cfb30 008cfc7c 0052e455 ····0···|···U·R·
008cfb50: 00000000 00000004 0000026e 008cfce4 ········n·······
008cfb60: 0000017e 177706a7 012314a0 008cfcd8 ~·····w···#·····
008cfb70: bff726c4 65786548 75412e6e 6f6c6f74 ·&··Hexen.Autolo
008cfb80: 57006461 48545541 732f524f 736e696b ad·WAUTHOR/skins
008cfb90: 00000000 0000017e 008cfbd0 7ff4b1cc ····~··········
008cfba0: 00000000 00000000 bff713e2 0000016f ············o···
008cfbb0: bff916bb e2ddb750 bff79480 bff713e2 ····P···········
008cfbc0: 0000016f 00000002 150aa90d 0040b213 o·············@·
008cfbd0: 008cfbdc 00000002 150aa90d 0040b213 ··············@·
008cfbe0: 008cfbec 004a7881 0055e0b8 004a7983 ·····xJ···U··yJ·
008cfbf0: 00000094 00000004 0000000a 040a08ae ················
008cfc00: 00000001 00204120 00000000 00000000 ···· A ·········
008cfc10: 00000000 7ff21768 00000000 0000000c ····h··········
008cfc20: 7ff20000 00000000 00000000 00000002 ···············
008cfc30: 00000000 7ff4ea24 008cfc48 7ff4e8df ····$··H······
008cfc40: 7ff4e218 bff7b9c5 81d30034 00000002 ·······4·······
008cfc50: 7ff4b969 7ffd3318 0000026e 00000000 i···3·n·······
008cfc60: 006a2138 008cfc74 7ff4b8ba 00000000 8!j·t··········
008cfc70: 00000002 000aa90d 150aa90d 008cfcd8 ················
008cfc80: 0052e46a ffffffff 004a48d0 ffffffff j·R······HJ·····
008cfc90: bff96347 007c0000 00000000 00000000 Gc····|·········
008cfca0: 0000026e 0000017e 00000001 0000ffff n···~···········
008cfcb0: bff7b9c5 00000002 00000276 00000000 ········v·······
008cfcc0: 00400000 00400230 00400208 bff70000 ··@·0·@···@·····
008cfcd0: 00400000 008cfc8c 008cfd00 0052faa0 ··@···········R·
008cfce0: 00000000 008cfd10 004a4c05 bff77716 ·········LJ··w··
008cfcf0: 00000000 007c0000 008cfcec 008cf790 ······|·········
008cfd00: 008cfe28 0051fd68 0055d708 00000000 (···h·Q···U·····
008cfd10: 008cfe38 0052017a 00400000 00000000 8···z·R···@·····
008cfd20: 81ce3a62 00000003 00000094 00000004 b:··············
008cfd30: 0000000a 040a08ae 00000001 00204120 ············ A ·
008cfd40: 00000000 00000000 00000000 000000de ················
008cfd50: 00ff0000 8dc23a48 00000001 02820167 ····H:······g···
008cfd60: 9e568d7c 0282014f 01575f77 4cb203e9 |·V·O···w_W····L
008cfd70: 000859af 00008dc1 00000000 516f8d98 ·Y············oQ
008cfd80: 8dc1ffff bfe812cc 00000001 01574ee2 ·············NW·
008cfd90: 81d30bac 00000000 00000000 008cffff ················
008cfda0: 7fcb219b 00000001 bffc05b4 81d30bac ·!·············
008cfdb0: 00000000 00000000 0052000e 00000000 ··········R·····
008cfdc0: 81d28a08 007c0000 00000044 00000000 ······|·D·······
008cfdd0: 00000000 00000000 00000000 00000000 ················
008cfde0: 00000000 00000000 00000000 00000000 ················
008cfdf0: 00000000 00000001 00000003 00000000 ················
008cfe00: 00000000 00000000 00000000 bff741f7 ·············A··
008cfe10: 00000000 bff7ea17 81ce3a62 00000000 ········b:······
008cfe20: 008cfd28 81d28a08 008cff68 0051fd68 (·······h···h·Q·
008cfe30: 005a5d80 00000000 008cff78 bff8b560 ·]Z·····x···`···
008cfe40: 00000000 81d28a08 007c0000 6f6f645a ··········|·Zdoo
008cfe50: 5845006d 00000045 00000000 00000000 m·EXE···········
008cfe60: 00000000 00000000 00000000 00000000 ················
008cfe70: 00000000 00000000 00000000 00000000 ················
008cfe80: 00000000 00000000 00000000 00000000 ················
008cfe90: 00000000 00000000 00000000 00000000 ················
008cfea0: 00000000 00000000 00000000 00000000 ················
008cfeb0: 00000000 00000000 00000000 00000000 ················
008cfec0: 00000000 00000000 00000000 00000000 ················
008cfed0: 00000000 00000000 00000000 00000000 ················
008cfee0: 00000000 00000000 00000000 00000000 ················
008cfef0: 00000000 00000000 00000000 00000000 ················
008cff00: 00000000 00000000 00000000 00000000 ················
008cff10: 00000000 00000000 00000000 00000000 ················
008cff20: 00000000 00000000 00000000 00000000 ················
008cff30: 00000000 00000000 008cff6c 81c86050 ········l···P`··
008cff40: 81d39908 eb759650 008cff6c 0051fff6 ····P·u·l·····Q·
008cff50: bff7b326 00000000 81d28a28 46ce0000 &·······(······F
008cff60: 008cfe40 007c0000 ffffffff bffc05b4 @·····|·········
008cff70: bff79138 00000000 008cfff4 bff8b412 8···············
008cff80: 81d30b68 00000008 81d28a08 00000000 h···············
008cff90: 00000000 00000000 00000000 00000000 ················
008cffa0: 00000000 00000000 00000000 00000000 ················
008cffb0: 00000000 00000000 00000000 00000000 ················
008cffc0: 00000000 00000000 00000000 00000000 ················
008cffd0: 0002ffff 0000f28c 008ce000 008d0000 ················
008cffe0: 00000000 ffffffff 81d2f6e8 00000000 ················
008cfff0: 73c746ce 84cf8fec bff89dd5 00000000 ·F·s············
Graf Zahl
Lead GZDoom+Raze Developer
Posts: 49223 Joined: Sat Jul 19, 2003 10:19 am
Location: Germany
Post
by Graf Zahl » Fri Jul 08, 2005 4:31 pm
The only method to do that right now is to give the health inside the script - but only inside the 'if' that sets the result to 1.
The Ultimate DooMer
Posts: 2109 Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone
Post
by The Ultimate DooMer » Fri Jul 08, 2005 4:34 pm
But if the Fail state works then the inventory hack will work. (see above for the crash log)
The item code is here:
Code: Select all
ACTOR PotionOfLife : Inventory 30041
{
+FLOATBOB
+INVBAR
Inventory.Amount 1
Inventory.MaxAmount 20
+FLOATBOB +PICKUPFLASH +FANCYPICKUPSOUND
Inventory.PickupMessage "potion of life"
Inventory.Icon ARTIPTN2
States
{
Spawn:
PTN2 ABC 4
Loop
Use:
PTN2 A 1 A_JumpIfInventory ("HealthLimit", 1, 2)
PTN2 A 0 A_GiveInventory ("HealthBonus", 25)
Stop
PTN2 A 1
Fail
}
}
The hack itself works because it gives health when you're not at full and only crashes when you are at full.
Graf Zahl
Lead GZDoom+Raze Developer
Posts: 49223 Joined: Sat Jul 19, 2003 10:19 am
Location: Germany
Post
by Graf Zahl » Fri Jul 08, 2005 5:17 pm
Which version are you using. Grubber didn't update the internal version string.
I can't get it to crash. Can you post the entire DECORATE lump or does something in there need some scripts as well?
The Ultimate DooMer
Posts: 2109 Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone
Post
by The Ultimate DooMer » Fri Jul 08, 2005 7:26 pm
I was using the one dated 29.06.05 but I updated to 05.07.05 and still got the crash. I can't find any mention of the Fail state in the changelog. Can you send me your version if it's any different?
Grubber
Posts: 1031 Joined: Wed Oct 15, 2003 12:19 am
Location: Czech Republic
Contact:
Post
by Grubber » Sat Jul 09, 2005 12:06 am