Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented features #924 and #923: ANY_CREATURE and AT_ACTION_POINT script commands #950

Merged
merged 4 commits into from
Mar 8, 2021

Conversation

SimLV
Copy link
Contributor

@SimLV SimLV commented Mar 3, 2021

No description provided.

src/lvl_script.c Show resolved Hide resolved
src/lvl_script.c Outdated Show resolved Hide resolved
src/lvl_script.c Show resolved Hide resolved
@Loobinex
Copy link
Member

Loobinex commented Mar 3, 2021

@SimTheVoid

I tried this code on a map:

IF(PLAYER0,TOTAL_CREATURES > 3)
	NEXT_COMMAND_REUSABLE
	KILL_CREATURE(PLAYER0,ANY_CREATURE,ANYWHERE,1)
ENDIF

Which is how it is described on #923 . Nothing happened, no log messages either. Did I do something wrong, or is it broken?

@Loobinex
Copy link
Member

Loobinex commented Mar 3, 2021

@SimTheVoid
Testing #924 also did not work. In fact, it crashed my game.

I added this script to a map:

ADD_CREATURE_TO_LEVEL(PLAYER0,DRAGON,3,5,5,0)
NEXT_COMMAND_REUSABLE
KILL_CREATURE(PLAYER0,DRAGON,AT_ACTION_POINT[3],1)

Then launched the game and crashed to desktop right away. This was in the log:

Error: Attempt to read from inaccessible memory address.
  in keeperfx.exe at 0023:00596145, base 00400000
  in keeperfx.exe at 0023:0050de5a, base 00400000
  in keeperfx.exe at 0023:00511786, base 00400000
  in keeperfx.exe at 0023:00513a03, base 00400000
  in keeperfx.exe at 0023:005b31b5, base 00400000
  in keeperfx.exe at 0023:005b48ed, base 00400000
  in keeperfx.exe at 0023:005b665e, base 00400000
  in keeperfx.exe at 0023:005b722a, base 00400000
  in keeperfx.exe at 0023:005d7997, base 00400000
  in keeperfx.exe at 0023:00401386, base 00400000
  in KERNEL32.DLL at 0023:7602fa29, base 76010000
  in ntdll.dll at 0023:771376b4, base 770d0000
  in ntdll.dll at 0023:77137684, base 770d0000

src/lvl_script.c Outdated Show resolved Hide resolved
src/lvl_script.c Outdated Show resolved Hide resolved
@Loobinex
Copy link
Member

Loobinex commented Mar 3, 2021

It does not work as it should, see attached testmap: testmap950.zip

It spawns dragons, why do the dragons not die?

@SimLV
Copy link
Contributor Author

SimLV commented Mar 3, 2021

It does not work as it should, see attached testmap: [testmap950.zip](https://github.com/dkfans/keeperfx/files/6078746> It spawns dragons, why do the dragons not die?

You forgot LEVEL_VERSION(1)

@Loobinex
Copy link
Member

Loobinex commented Mar 3, 2021

Sorry, updated version with level_version(1) that still does not work well: testmap950.zip

Eventually dragons wandering towards the center will die, but the dragons spawn within the action point, yet don't die immediately.

@Loobinex
Copy link
Member

Loobinex commented Mar 4, 2021

Updated version of the testmap: testmap950.zip

I tested it, and overall it works great. Tried all the commands. I don't know why not all units are always picked up though.
In the testmap 10 dragons spawn in a room, Action Point 1 is larger than the room they spawn in, and when they spawn there it kills 10 dragons per tick. But it's clear to see that some dragons survive a bit longer.

Also @SimLV on #923 I requested 'ANY_CREATURE, EVIL_CREATURE and GOOD_CREATURE', the latter two to match the EVIL_CREATURES and GOOD_CREATURES variables. I see these two aren't implemented. Are you planning to do these on this pull, or should I split up #923?

@Loobinex Loobinex changed the title #924 #923 Implemented features #924 and #923 Mar 4, 2021
@Loobinex Loobinex changed the title Implemented features #924 and #923 Implemented features #924 and #923: ANY_CREATURE and AT_ACTION_POINT script commands Mar 4, 2021
@Loobinex Loobinex merged commit 3d449c4 into dkfans:master Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants