1. SPS Accounts:
    Do you find yourself coming back time after time? Do you appreciate the ongoing hard work to keep this community focused and successful in its mission? Please consider supporting us by upgrading to an SPS Account. Besides the warm and fuzzy feeling that comes from supporting a good cause, you'll also get a significant number of ever-expanding perks and benefits on the site and the forums. Click here to find out more.
    Dismiss Notice
Dismiss Notice
You are currently viewing Boards o' Magick as a guest, but you can register an account here. Registration is fast, easy and free. Once registered you will have access to search the forums, create and respond to threads, PM other members, upload screenshots and access many other features unavailable to guests.

BoM cultivates a friendly and welcoming atmosphere. We have been aiming for quality over quantity with our forums from their inception, and believe that this distinction is truly tangible and valued by our members. We'd love to have you join us today!

(If you have any problems with the registration process or your account login, please contact us. If you've forgotten your username or password, click here.)

Respawn thingy

Discussion in 'Neverwinter Nights (Classic)' started by TriLleX The Slayer, Jul 13, 2002.

  1. I'm currently making a dungeon.. a BIG one. But one thing I want to know is: Is it possible to, when you die. To reset every single thingy and make one start all over from the Start Location? Not with a restart of the module but just a restart of the dungeon with encounters, items and stuff.. And oh yes. How do I do so a person drops EVERY single thing from his inventory when he dies? Thanks in advance.
     
  2. 8people

    8people 8 is just another way of looking at infinite ★ SPS Account Holder Adored Veteran

    Joined:
    Apr 20, 2002
    Messages:
    7,141
    Media:
    74
    Likes Received:
    133
    Gender:
    Female
    I don't think it is actually possible, from what we've seen you can't anyway
     
  3. Blackthorne TA

    Blackthorne TA Master in his Own Mind Staff Member ★ SPS Account Holder Adored Veteran Pillars of Eternity SP Immortalizer (for helping immortalize Sorcerer's Place in the game!) New Server Contributor [2012] (for helping Sorcerer's Place lease a new, more powerful server!) Torment: Tides of Numenera SP Immortalizer (for helping immortalize Sorcerer's Place in the game!)

    Joined:
    Oct 19, 2000
    Messages:
    10,415
    Media:
    40
    Likes Received:
    232
    Gender:
    Male
    I would imagine that's not too difficult. The official modules have some routine where all the unnecessary items from the last chapter are removed from your inventory at the start of the new chapter, and I wouldn't think starting the module over would be too difficult either.

    But, as I haven't cracked open the toolset yet, I couldn't tell you if it's possible for sure, or how to do it...
     
  4. Errol Gems: 23/31
    Latest gem: Black Opal


    Joined:
    Oct 23, 2001
    Messages:
    1,547
    Likes Received:
    0
    Gender:
    Male
    [​IMG] Hullo Trillex, yeah ok:
    When you die, you have to set the player's OnDeath script to one which restarts the module. Look up the area transition's, and browse through the scripts, there shoudl be one option that gives you "GoToModule" or something similar. Basically enter the module you're in at the moment, so when the player dies, you will enter the module as if you've never even been there.
    I *think*.
    Not many ideas on the inventory though. Hmm...try it out in a conversation first:
    - (NPC_1)- Hello, would you like your inventory exterminated?
    |___ Yes please
    |___ No thankyou.

    Set the yes please to the ActionGiveItemInSlot script, then set the item to nothing. This should effectively remove what you had in that inventory slot.

    I know i'm not really helping here, but those things should work.
     
  5. Rastor Gems: 30/31
    Latest gem: King's Tears


    Joined:
    Jul 8, 2002
    Messages:
    3,533
    Likes Received:
    0
    What Gopher is saying would likely work, except for it would not recreate the item on the ground where they fell. Perhaps it would be possible to use that command in conjunction with the CreateItemAtLocation command. I haven't tried the script editor yet, so not sure if this would work or not.
     
  6. Capt. Tripps Gems: 9/31
    Latest gem: Iol


    Joined:
    Mar 11, 2001
    Messages:
    341
    Likes Received:
    0
    This is part of a completed quest dialogue script that removes an item tagged "it_BugHead" from a players inventory.

    Code:
    
    
    The problem is that you have to know the item's tag in order to destroy it. If you gave all your items the same unique tag header I think you could use a search string function to get the tags, but this would only destroy items that you have placed and not any that they had on them before entering. Hope this helps.
     
  7. Xaelifer Gems: 10/31
    Latest gem: Zircon


    Joined:
    Nov 17, 2001
    Messages:
    356
    Likes Received:
    0
    Here is what I did for respawning player characters in my module.

    Please give some credit to me in your module description, or inside the scripts if you choose to copy and paste all this into your module.

    With this method, you will activate a series of 'save points' that you'll return to when you die. So you touch one, and after that, when you die you respawn there. The loss of XP and gold is not yet input.

    First, on the OnClientEnter script in Edit:Module Properties, this is the type of script you'll need. This sets it so that if the player begins the module and never touches a save point, he will respawn at the first one designated instead of where he died.

    {
    SetLocalString(GetModule(), "RespawnPoint", "1st Spawn Point");
    }

    be sure to change "1st Spawn Point" to the tag of your initial spawn point that you want the characters to appear at when they haven't touched any save points yet.

    Now just add this to OnPlayerRespawn below that on the scripts list.

    {

    object oRespawner = GetLastRespawnButtonPresser();

    ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
    ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner);
    RemoveEffects(oRespawner);

    location lRespawn = GetLocation(GetObjectByTag(GetLocalString(GetModule(), "RespawnPoint")));

    AssignCommand(oRespawner, JumpToLocation(lRespawn));

    }

    Then add this script to the OnUsed script of the object which the character touches to set the save point. Every save point must have a different tag, but the script never changes.

    {
    object oPC = GetLastUsedBy();

    SetLocalString(GetModule(), "RespawnPoint", GetTag(OBJECT_SELF));

    }

    I think that this is pretty much it...it SHOULD work. It works on mine, but I may have missed something here.
     
  8. Sorry, haven't replied. It seems to work fine, thanks.
     
  9. keaven Gems: 1/31
    Latest gem: Turquoise


    Joined:
    Aug 7, 2002
    Messages:
    18
    Likes Received:
    0
    As far as having the PC drop everything when they die.. would something like this work?

    have some kind of while loop..
    Code:
    object oItem = GetFirstItemInInventory(oPC);
    while oItem != OBJECT_INVALID
      {
        ActionPutDownItem(oItem);
        oItem = GetFirstItemInInventory(oPC);
      }
    something like that? would that work?
     
Sorcerer's Place is a project run entirely by fans and for fans. Maintaining Sorcerer's Place and a stable environment for all our hosted sites requires a substantial amount of our time and funds on a regular basis, so please consider supporting us to keep the site up & running smoothly. Thank you!

Sorcerers.net is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to products on amazon.com, amazon.ca and amazon.co.uk. Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.