Sorcerer's Place Stores: Games, Books, DVDs, Merchandise (buying via these links & our affiliated stores below helps support the site - thanks!) |
||
Have you liked us yet? |
![]()
![]() |
|
|
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Guest
|
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.
|
|
|
|
#3 |
|
Join Date: Oct 2000
Location: San Pedro, CA, USA
Posts: 9,726
Blog Entries: 18
Like: 20
Liked 45 Times in 32 Posts
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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 |
|
Merchandise Artist
I think therefore I am... I think |
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 |
|
FFG's Baatorian Mate
|
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 |
|
Gems: 9/31
Latest gem: Iol |
This is part of a completed quest dialogue script that removes an item tagged "it_BugHead" from a players inventory.
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 |
|
Gems: 10/31
Latest gem: Zircon |
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,EffectRe surrection(),oRespawner); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHe al(GetMaxHitPoints(oRespawner)), oRespawner); RemoveEffects(oRespawner); location lRespawn = GetLocation(GetObjectByTag(GetLocalString(GetModul e(), "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 |
|
Guest
|
Sorry, haven't replied. It seems to work fine, thanks.
|
|
|
|
#9 |
|
Gems: 1/31
Latest gem: Turquoise |
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);
}
|
|
|
|
![]() |
| Thread Tools | |
|
|