Welcome to the Builder Academy

Question Hey christmas present question.

More
06 Aug 2022 16:39 #10123 by Errigour
hey the code for christmas present is:
Code:
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
06 Aug 2022 20:41 #10124 by thomas
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
07 Aug 2022 05:55 #10125 by Rumble
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
rumble@tbamud.com

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

Time to create page: 0.218 seconds