Hey christmas present question.

  • Errigour
  • Errigour's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 month 2 weeks ago #10123 by Errigour
Hey christmas present question. was created by Errigour
hey the code for christmas present is:
eval present %random.27%
eval present2 %present% * 1000
eval present3 %present2% + %random.4%
%send% %actor% You begin unwrapping the present.
%echoaround% %actor% %actor.name% begins unwrapping %actor.hisher% present.
wait 1 s
%load% obj %present3% %actor% inv
eval inv %actor.inventory%
%echo% As the wrapping falls apart, it reveals... %inv.shortdesc%.
%purge% %self%

But i want it to keep picking random numbers until it finds an existing object to load, how would i do that? The current code just causes errors when there are no objects.

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #10124 by thomas
Replied by thomas on topic Hey christmas present question.
I'm afraid the code doesn't support this use case. However, it should be possible to add it to dg_variables or the dg_scripts files.

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #10125 by Rumble
Replied by Rumble on topic Hey christmas present question.
You could pick a range of vnums and make sure they all exist. Non-existing ones you could create a generic lump of coal :-)
This is how Detta did it:

Name: 'random obj load', VNum: [ 1973], RNum: [ 618]
Trigger Intended Assignment: Objects
Trigger Type: Command , Numeric Arg: 3, Arg list: unwrap
Commands:
eval present %random.27%
eval present2 %present% * 1000
eval present3 %present2% + %random.4%
%send% %actor% You begin unwrapping the present.
%echoaround% %actor% %actor.name% begins unwrapping %actor.hisher% present.
wait 1 s
%load% obj %present3% %actor% inv
eval inv %actor.inventory%
%echo% As the wrapping falls apart, it reveals... %inv.shortdesc%.
%purge% %self%

Rumble
The Builder Academy
tbamud.com 9091
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

Time to create page: 0.086 seconds