- Posts: 26
- Thank you received: 1
Hey christmas present question.
- Errigour
-
Topic Author
- Offline
- Junior Member
-
Less
More
1 year 1 month ago #10123
by Errigour
Hey christmas present question. was created by Errigour
hey the code for christmas present is:
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.
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.
- thomas
-
- Offline
- Administrator
-
Less
More
- Posts: 818
- Thank you received: 159
1 year 1 month 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.
- Rumble
-
- Offline
- Administrator
-
1 year 1 month ago #10125
by Rumble
Rumble
The Builder Academy
tbamud.com 9091
This email address is being protected from spambots. You need JavaScript enabled to view it.
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%
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.096 seconds