Author Topic: How Do I???  (Read 39301 times)

0 Members and 3 Guests are viewing this topic.

Offline Mordecai

  • Administrator
  • Full Member
  • *****
  • Posts: 107
  • Has delusions of adequacy
    • View Profile
    • Multiplayer Online Game Anyone?
    • Email
Re: How Do I???
« Reply #15 on: December 02, 2008, 02:33:31 pm »
Making someone sleep or awake, or resting can be done using the position variable, whch you won't have known about.

nop %actor.pos(sleeping)%
nop %actor.pos(resting)%
nop %actor.pos(sitting)%
nop %actor.pos(standing)%
nop %actor.pos(stunned)%
nop %actor.pos(dead)%

dg_cast spells are prone to being blocked by the actors spell defenses if they are aggressive, and some spells have a low chance of success in any case, and the dg_cast mob (yes, an actual mob casts the spells), has a chance of failing the spells too.

dg_affect however always works, no chance of failing.
But I would hope you would test out what the affect is going to be.

Such as, the AFFECT sleep, causes people not to wake up.
The SPELL sleep puts them to sleep.

Offline Molly

  • Administrator
  • Hero Member
  • *****
  • Posts: 691
    • View Profile
Re: How Do I???
« Reply #16 on: December 03, 2008, 11:14:30 am »
Hmm, to make sure that I've got this right:

What I want to do is to force a player to sleep and then transfer them to another room, and not being able to wake up on their own, until another script does it in the new room.

So the procedure would be to have the first script do:
dg_affect %actor% sleep

and then the second script could be a greet trigger, doing:
nop %actor.pos(sitting)%

Is that how the forced sleep - wake could work?

As for the other script, the mob is casting heal on itself. That cannot really be blocked by any defensive spells, but the script still doesn't work.
I don't suppose there is a way for a mob to heal itself with dg_affect?

Or should I do this instead?
eval heal %self.maxhitp%
%damage% %self% -%heal%



Offline Diandra

  • Administrator
  • Full Member
  • *****
  • Posts: 143
    • View Profile
    • Email
Re: How Do I???
« Reply #17 on: December 04, 2008, 12:11:07 pm »
And it seems that using the position variable isn't the solution either as the code doesn't even recognize the field.

[ Trigger: Something, VNum xxxx. unknown char field: 'pos' ]

Is all you get when you try

nop %actor.pos(stunned)%

or

nop %actor.pos(sitting)%

in a script.
« Last Edit: December 06, 2008, 01:47:20 am by Diandra »

Offline Molly

  • Administrator
  • Hero Member
  • *****
  • Posts: 691
    • View Profile
Re: How Do I???
« Reply #18 on: December 06, 2008, 12:59:00 pm »
I believe it is %actor.position(stunned)%, not %actor.pos(stunned)%

Offline Diandra

  • Administrator
  • Full Member
  • *****
  • Posts: 143
    • View Profile
    • Email
Re: How Do I???
« Reply #19 on: December 07, 2008, 06:03:50 am »
Nope, doesn't work either.

Using 'position' doesn't give an error but the position of the %actor% doesn't change either.

So either way, it seems that nor %actor.position(stunned)%  nor  %actor.pos(stunned)% is working.

Offline Mordecai

  • Administrator
  • Full Member
  • *****
  • Posts: 107
  • Has delusions of adequacy
    • View Profile
    • Multiplayer Online Game Anyone?
    • Email
Re: How Do I???
« Reply #20 on: December 08, 2008, 05:08:30 am »
You are so right, my appologies.
That code was in the TBA codebase not ours.

I have added it to ours now in all 3 ports, they just need a copyover.

Offline Mordecai

  • Administrator
  • Full Member
  • *****
  • Posts: 107
  • Has delusions of adequacy
    • View Profile
    • Multiplayer Online Game Anyone?
    • Email
Re: How Do I???
« Reply #21 on: December 08, 2008, 05:16:48 am »
Quote
So the procedure would be to have the first script do:
dg_affect %actor% sleep

dg_affect needs :
dg_affect <target> <property> <value> <duration>

So to do SLEEP, where duration is in seconds:
dg_affect %actor% sleep on 300

To remove sleep:
dg_affect %actor% sleep off

Offline Molly

  • Administrator
  • Hero Member
  • *****
  • Posts: 691
    • View Profile
Re: How Do I???
« Reply #22 on: December 10, 2008, 11:17:30 am »
So, will it be %actor.position(stunned)%, or %actor.pos(stunned) after the copyover?

And here's another question on the topic How do I???:

Is there a way to make a script set Award Points on a player?
I have an idea about adding that to the reward of a couple of the quests with an IC plot. (Especially since our RP Leaders aren't exactly active.).
« Last Edit: December 10, 2008, 11:23:47 am by Molly »

Offline Diandra

  • Administrator
  • Full Member
  • *****
  • Posts: 143
    • View Profile
    • Email
Re: How Do I???
« Reply #23 on: December 21, 2008, 05:08:26 am »
So, will it be %actor.position(stunned)%, or %actor.pos(stunned) after the copyover?

Seems both work.

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: How Do I???
« Reply #24 on: March 13, 2009, 08:18:02 pm »
Ok, a new "How do I?"

How do I: make something load inside something else during particular times?

Note: zedit will let me load things inside other things, but it's there on all reboots/what not.
note: I can load containers at particular times, but what about the stuff inside the containers?

How it will be used:
I want a script that loads baskets of bread, plates of cheese and other things, but only during "dining hours" at other times the table should be empty.  Currently I have a script that loads the bread to the table - but that only allows 1 piece of bread to be taken before there is no more, same for the others and it does it during the times I want.  I've created the baskets and plates and what not, but have come to the stumbling block of loading the objects into the containers.  So... how do I do it? 

I do have a solution that I'd rather not do and that is this:

A wizinvis mob that loads the objects and puts them in the containers at said time.  Let me know if there is any other way.

Thanks,
Kvetchy

Offline Diandra

  • Administrator
  • Full Member
  • *****
  • Posts: 143
    • View Profile
    • Email
Re: How Do I???
« Reply #25 on: March 14, 2009, 01:34:49 pm »
If the basket and plates are made as containers, try adding the following to the working script you already have.

Though depending on the scripttype there's a chance it won't load where it should be, so I'm not sure this is what you're looking for.


* load container
%load% obj vnum-basket
* saves the reference of the container in 'cont'
set cont %loaded%
* load each item in the container
%load% obj vnum-bread %cont.name%
%load% obj vnum-bread %cont.name%
%load% obj vnum-bread %cont.name%
%load% obj vnum-bread %cont.name%
* the above will have loaded 4 breads in the basket
* load a new container
%load% obj vnum-plate
* store the reference from the new container in 'cont' (or use something else)
set cont %loaded%
%load% obj vnum-cheese %cont.name%
%load% obj vnum-cheese %cont.name%
%load% obj vnum-cheese %cont.name%
%load% obj vnum-cheese %cont.name%
* the above will have loaded 4 cheeses on the plate

Anyway hope this can help you out.



Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: How Do I???
« Reply #26 on: March 16, 2009, 11:03:56 am »
It works!  Thanks, D.  :)

Kvetchy