Results 1 to 10 of 10

Thread: Some scripting questions

  
  1. #1

    Default Some scripting questions

    I created a level last year, nothing fancy, just something simple akin to the original Deeper Dungeons levels. It is playable from start to finish but I was never able to iron out the last few finishing touches in order to get it to play exactly how I intended. Without going into too many details, this is how the level plays out:

    You're up against heroes and an enemy keeper. You play through the level in a semi-linear fashion, killing heroes and finding a few secrets until you eventually make it to the hero dungeon heart, which a few parties will then drop in to defend it. Upon destroying the heart, you can then attack and kill the enemy keeper. A short length of time after this, several parties including the Lord of the Land show up. Once you've killed them all and any remaining heroes on the map, two final really strong parties will then appear and killing these ends the level.

    So my problems are:

    1) Because this is my first serious attempt at making a proper map, I'm not too knowledgeable about scripting in general, let alone any new ones introduced with KeeperFX patches. The only way I was able to get everything to work exactly how I want was to use flags. The main reason I did this was a failsafe to prevent the player from sequence breaking the level, as you could in many of the official levels. The flags and map design go hand in hand. For example, it is completely impossible to reach the enemy keeper without first destroying the hero heart, which means you should not be able to trigger the Lord to show up before you've accomplished both of these. The flags make all of this possible for the most part but I now feel that there has to be a more efficient method to pull this off, the script otherwise doesn't look so great even if this doesn't matter.

    2) I'm probably just doing something wrong here with the flags but, as mentioned above, the level is supposed to be completed upon the defeat of the final two parties, yet the game considers you've won the level as soon as they spawn and I can't find a way to make it not do so.

    3) Is there any way I can set the enemy keeper AI or prevent it from being overly expansionist and not making a total mess of it's starting dungeon? I know the AI usually ends up doing this often in many maps, but the problem is that the moment you destroy the hero heart the walls all turn to earth and the AI immediately digs through it to start claiming territory. I want it to be the other way around, it's the player who has to go knocking on his door.

    I think I had a couple of other points I thought of previously but I haven't really played the level since it was created so I've forgotten what they were, if there were any. I'll add them if I think of any more.

    Any help or insight into these would be appreciated.

    Cheers.

  2. #2

    Default Re: Some scripting questions

    1) Flags are often the way to go

    2) The victory condition spawns right before the units actually spawn, so in the split second before the heroes arrive in the level. Fix this by not setting a 'win_game' there, but a 'set_timer'. Then put the victory condition separate, under the condition that timer is above 40 or something (so you win 2 seconds after you kill all units).

    3) Yes, pick a different computer player. One that fits your needs.

  3. #3

    Default Re: Some scripting questions

    The victory condition was already it's own thing. But I tried your suggestion and it still isn't working. I tried to make the last condition similar to how Sleepiburgh is completed, but even when a timer is added to when the party spawns, the level still completes once the value on the timer is reached and the parties are all still alive. This is now the only remaining issue with the level and it's getting a bit tiresome having to play it over and over just to get to the end and find it's not working correctly.

  4. #4

    Default Re: Some scripting questions

    Share your script with me and I'll have a look.

  5. #5

    Default Re: Some scripting questions


  6. #6

    Default Re: Some scripting questions

    Could you start the level that belongs to this script, then quit the game straight away, and share the keeperfx.log file?

  7. #7

    Default Re: Some scripting questions


  8. #8

    Default Re: Some scripting questions

    A, there it is. You forgot to put in 'level_version(1)', so your if_controls commands aren't recognized.

    Beyond that, you've got a but too many flags, but it should work. You can also update your game, you're still at 0.4.6U, there's already many patches for the 0.4.7U version.

  9. #9

    Default Re: Some scripting questions

    That did the trick, thanks. I also removed the last two flags as I realised they were redundant when I could just make the defeat of the final party as the win objective. I updated to the latest patches and I've noticed that the quick objectives don't show up anymore but I'm not going to bother with that.

    Now that the level is finally in fully working order, how can I go about uploading it?

  10. #10

    Default Re: Some scripting questions

    The thing is, if you use KeeperFX script (which the level_version(1) indicates) some script commands work differently, most importantly the creature_available and quick_objective commands. Just take a quick look at the changed commands here. Also, you can take a quick look at the log file yourself. Simply load the level for a few seconds, exit then look at keeperfx.log and and after 30 lines or so it says 'load_script', the lines before that display all the errors in the script, which makes it easy to fix.

    For uploading, I'd start with simply making a topic here.

Similar Threads

  1. Scripting
    By Edwin in forum DK1 Mapmaking
    Replies: 1
    Last Post: January 31st, 2020, 14:30
  2. scripting problems
    By darkkingkongman in forum DK1 Mapmaking
    Replies: 5
    Last Post: June 2nd, 2014, 21:02
  3. Camera scripting
    By Hades in forum KeeperFX
    Replies: 1
    Last Post: February 8th, 2013, 01:15
  4. Replies: 32
    Last Post: January 17th, 2011, 06:15
  5. Replies: 4
    Last Post: January 9th, 2011, 14:46

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •