Author Topic: Scripted Quest Rewards you would like to see  (Read 10368 times)

0 Members and 1 Guest are viewing this topic.

Offline erwin

  • Sr. Member
  • ****
  • Posts: 314
    • View Profile
Scripted Quest Rewards you would like to see
« on: October 04, 2015, 05:04:02 pm »
Post scripted quest rewards you would like to see here.

I've three of them:

a) DT detector (tells you if there is a DT in the zone).
b) "Unlimited" usage of ID scrolls - basically an object to store ID scrolls, but casts identify (reason behind this is that ID scrolls are weightless, but there are people who carry over 500+ of them, which used to cause the MUD to lag when they log in / log out)
c) Scriptable games - like Battleship, but more fun


Any others?

Offline Xeriuth

  • Global Moderator
  • Full Member
  • *****
  • Posts: 241
  • Coder
    • View Profile
Re: Scripted Quest Rewards you would like to see
« Reply #1 on: October 05, 2015, 10:20:10 am »
DT detector is a good idea and something pretty easy to script. Would you want the detector to be automatic? Or you have to do something to engage it? Also dependent would you like it to get stronger the closer you get to the DT?

Unlimited ID scrolls would also be pretty easy to script.
This could be further applied to potions, food, water, and other things of that nature?

Scriptable games become a bit more complex dependent on the type of game. Chess I think would be a neat one personally. Poker would be the best though!
What types of mini games would people like to see?
Snazzy Signature Block Goes Here

Offline erwin

  • Sr. Member
  • ****
  • Posts: 314
    • View Profile
Re: Scripted Quest Rewards you would like to see
« Reply #2 on: October 06, 2015, 09:40:30 am »
An automatic DT detector (depending on how 4D is set up, and how the script works) might be taxing on 4D itself (particularly if it's a random script which fires every few seconds). Might be better to hard code this. A DT detector that has a cool down but gives a list of DTs in the zone / adjacent rooms would be better, but I was thinking one a DT detector which you hold (like a diving rod), and overrides the cardinal direction commands.

I'd say unlimited ID scrolls are the only thing that "should" be unlimited, as they are already weightless. There's already unlimited food and drink (or rather, inability to feel hungry / thirsty). I think healing potions have weights for a reason - else you could forego healing classes and focus on combat, so that shouldn't really be unlimited.

Script question: Rynald has already added the mod function to scripts (to make scripted games easier). However, do current scripts have recursive functionality (or rather, can we call the same FUNCTION script within the same FUNCTION script cleanly)?

Better still, would it be possible to change the scripting system to allow FUNCTION type scripts to return a set of outputs?

Offline Parnassus

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Scripted Quest Rewards you would like to see
« Reply #3 on: October 06, 2015, 04:02:33 pm »
a) DT detector (tells you if there is a DT in the zone).

An automatic DT detector (depending on how 4D is set up, and how the script works) might be taxing on 4D itself (particularly if it's a random script which fires every few seconds). Might be better to hard code this. A DT detector that has a cool down but gives a list of DTs in the zone / adjacent rooms would be better, but I was thinking one a DT detector which you hold (like a diving rod), and overrides the cardinal direction commands.

The first one just suggests a detector which tells you: yes, there is or no, there isn't.  For this, all you need is code which searches for room-flags to find all the dt rooms.  Add a zone-flag for any zone with a dt room and then use either a script or a hard code with checks for the zone flag.  I think the zone flag should be accessible no matter which room in the zone you're in.

I see two possible problems with this.  The first is that I (as a non-coder) find it simple to say, "Sure, easy-peasy!  Just get someone to write code that does this!"  The second is if dts here are not hardcoded but are triggers or a mix.  On TBA, I can easily do a search for any triggers that are named dt, deathtrap or whatever and then find out if they're used or not.  The only thing I would have trouble finding is a scenario like so:  You irritate a mob and the mob turns a room into a dt.  I don't think I've ever seen anything like that and I don't expect I ever will.  4D and TBA don't have all the same code so I don't know if it's possible here.

Offline rynald

  • Administrator
  • Newbie
  • *****
  • Posts: 25
    • View Profile
Re: Scripted Quest Rewards you would like to see
« Reply #4 on: October 06, 2015, 04:25:20 pm »
DTs are set in the zones, i can't imagine they will be created on the fly. But to make sure, it's possible to have the code check for all rooms in the zone for any DTs when the detector is used.

When a function is called, it runs as if it's attached to the mob/obj/room that called it. You can then use globals to pass return values:

Trigger Editor [1]

1) Name         : using return value
2) Intended for : Objects
3) Trigger types: Command
4) Numeric Arg  : 7
5) Arguments    : doit
6) Commands:
eval x 1
%echo% x = %x%
function 2 %x%
eval x %self.new_x%
%echo% after func: x = %x%

Trigger Editor [2]

1) Name         : func
2) Intended for : Objects
3) Trigger types: FUNCTION
4) Numeric Arg  : 100
5) Arguments    :
6) Commands:
eval new_x %args% + 1
global new_x

It should work as long as the attach types are the same.

Offline erwin

  • Sr. Member
  • ****
  • Posts: 314
    • View Profile
Re: Scripted Quest Rewards you would like to see
« Reply #5 on: October 06, 2015, 06:16:13 pm »
Rynald!

Edit: Actually, I have a list of questions about triggers - if you could help answer them, that will be great!

1) Can triggers be attached to mobs? I dimly recall this being broken, but I'm not sure. If they can, what would the appropriate syntax be?

2) Can we really, really, really set up a wiki for script syntaxes?

Thanks!



« Last Edit: October 06, 2015, 06:49:58 pm by erwin »

Offline rynald

  • Administrator
  • Newbie
  • *****
  • Posts: 25
    • View Profile
Re: Scripted Quest Rewards you would like to see
« Reply #6 on: October 08, 2015, 12:34:03 pm »
1) You can attach a trigger to something from a script with: attach <trigger vnum> <id>. I didn't get any problems when putting one on a mob.

2) I've asked TBA for permission to mirror their old dg script reference pages on our site. If that doesn't work out we can take a stab at a wiki, but i'll need to work with Opie on that.

Offline rynald

  • Administrator
  • Newbie
  • *****
  • Posts: 25
    • View Profile
Re: Scripted Quest Rewards you would like to see
« Reply #7 on: October 08, 2015, 01:03:13 pm »
The pages are online after all: http://old.tbamud.com/Oasis_DG_pages/.

There have been changes to scripting, but most of it still applies to our scripts.

Offline erwin

  • Sr. Member
  • ****
  • Posts: 314
    • View Profile
Re: Scripted Quest Rewards you would like to see
« Reply #8 on: October 08, 2015, 06:20:22 pm »
Great, thanks :)

One more question: What would be needed if I wanted a pointer to a mob, in order to get the mob to do stuff?

Say for example, I created a mob (not necessarily a unique name), with unique ID 12345, and then:

Code: [Select]
set mobPointer %self.id%
remote mobPointer %actor.id%

The variable 12345 is stored on the player. However, if I wanted to do the following:

a) Force the mob to do something
b) Find the room the mob is in

what would the appropriate syntax be? At the moment, I've tried

Code: [Select]
%force% %mobPointer% jump
%echo% %%mobPointer%.room%

which admittedly doesn't work, since the number stored in mobPointer could represent a string / object / room / anything else instead - so I'm not even sure if I'm storing the right variable.

So yeah, what would I need to do to get this to work? Thanks again!




Offline rynald

  • Administrator
  • Newbie
  • *****
  • Posts: 25
    • View Profile
Re: Scripted Quest Rewards you would like to see
« Reply #9 on: October 09, 2015, 02:46:39 pm »
When you have the id of something you can control it with makeuid:

Code: [Select]
makeuid mob %id%
%force% %mob% sit
%echo% %mob.room%

Offline erwin

  • Sr. Member
  • ****
  • Posts: 314
    • View Profile
Re: Scripted Quest Rewards you would like to see
« Reply #10 on: October 09, 2015, 02:51:24 pm »
thanks!