Language: 
To browser these website, it's necessary to store cookies on your computer.
The cookies contain no personal information, they are required for program control.
  the storage of cookies while browsing this website, on Login and Register.

Author Topic:  Instant reset map on enter/exit  (Read 5080 times)

0 Members and 0 Guests are viewing this topic.

Joe

« on: 26, March 2014, 22:58:43 »
I've got a map that needs to be reset on enter and exit, how would I go about doing this.  It's a puzzle map where a player can push certain items to progress though the map, but he can also get stuck and may need to exit and re-enter to start over.

Possibly also may need an inventory item to teleport back out if the player blocks himself in.  Is there a setting I can change or does this need some fancy lua script?
Whoever said "Out of sight, out of mind" never had a spider disappear in their bedroom.

Cutintwo

« Reply #1 on: 27, March 2014, 09:19:20 »
Doesn't the mine in guild hall do this for it's puzzles?

Cut

smacky

« Reply #2 on: 27, March 2014, 12:16:40 »
Yes I think Deserted Mine does do this.

One way is by making the map an instance and setting certain flags on the exit(s).

From types.xml:

Code: [Select]
  <attribute arch="is_male" editor="instance: no reenter" type="bool">
    If set the server will always create a new instance instead of trying to
    use an old one.
  </attribute>
  <attribute arch="is_female" editor="instance: reset instance" type="bool">
    If set AND when the map is loaded as instance the players instance reseted
    so he can't reenter this map without restarting the instance.
    This setting is used for instances which can be reentered. By marking the
    final exit with it when the instance is done the player will have an real
    end of the instance.
  </attribute>

Interpreting the Denglish, I l think this means you can set no renter on exits TO the instance and whenever a player enters it is reset.

And/or you can set reset instance on exits FROM the instance and whenever a player leaves it is reset (effectively when he comes back).

You also COULD do the reset via a script if you don't want to rely on players using exits.

Same also with (effectively) a local /stuck (but scripts on inv items is a bit naughty so you would have, say a SAY or TALK Script in range of the puzzle so when the player says 'i'm a useless noob' it resets.

Shroud

« Reply #3 on: 27, March 2014, 12:52:47 »
Just one thing I'll point out is that setting flags on exit and entrance would have different behaviour if a player died thus leaving without using a conventional exit.

I guess other problem that needs to be taken into account is if someone logs off halfway through a puzzle and server resets then I'd assume instance would be reset.

I guess brutal and inelegant solution is just to have poison pits players can use to kill themselves
Doesn't matter, you'd die anyway. ;D Shroud's a hacker. After many hours of deep thought I have came to that conclusion.

Joe

« Reply #4 on: 28, March 2014, 08:35:20 »
Excellent thank you, I used the instance map and set the exits accordingly, works great, also added a way out if a player did get stuck.

Now on a completely different subject, I just need to figure out how to kill a mob and not have it say "too low for exp".  I feel like such a noob there must be something I'm missing.  Map difficulty set to 100, mob lvl 110, experience 25,000.... Still says was too low and no corpse.

Here is everything in the text editor:
Code: [Select]
direction 2
level 110
exp 25000
item_quality 6
dam 99
maxhp 500
wis 2
attack_slow 60
can_reflect_spell 1
type 83
name Troll
face troll.151
race troll
randomitems loot;wealth_normal&D65;loot_base&D17;loot_magic&d27;loot_melee&d22
layer 6
identified 1
is_named 1
item_race 255
item_level 255
corpse 1
alive 1
monster 1
is_male 1
is_evil 1
terrain_flag 1
can_open_door 1
can_see_in_dark 1
can_use_weapon 1
can_use_armour 1
can_use_ring 1
run_away 5
int 10
dex 3
con 15
magic 1
pow 10
sp -1
maxsp 20
hp -1
ac 28
wc 15
thac0 85
thacm 5
item_condition 10
weapon_speed 3.5
resist_cold 75
resist_pierce 25
resist_slash 25
resist_impact 25
resist_cleave 25
resist_fear 100
resist_fire -30
attack_impact 100
speed -0.061
weight 365000
animation troll
is_animated 1
anim_speed 5
no_pick 1
« Last Edit: 28, March 2014, 08:37:26 by joeshmo »
Whoever said "Out of sight, out of mind" never had a spider disappear in their bedroom.

smacky

« Reply #5 on: 28, March 2014, 15:42:58 »
Map reset: Note that even if you did this via script, the map should be instanced as other players hardly want the map reset under them for (for them) no reason and at  random times.

Too low for exp: Sounds like a bug. Please quote your post to the 0.10.6 bugs thread.

Tags:
 

Related Topics

  Subject / Started by Replies Last post
3 Replies
921 Views
Last post 21, October 2006, 20:07:45
by grommit
17 Replies
2110 Views
Last post 15, November 2006, 13:17:33
by grommit
32 Replies
8884 Views
Last post 03, August 2007, 15:18:52
by smacky
32 Replies
5161 Views
Last post 18, July 2009, 23:51:23
by ThePlaneskeeper
3 Replies
1431 Views
Last post 01, September 2010, 23:29:50
by longir