Spawning an item without socket, possible?

Need help with your JScripts? Got questions concerning the DFNs? Come forward, step inside :)
Post Reply
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Spawning an item without socket, possible?

Post by Xuri »

Is it possible to spawn an item through the JS engine without a socket? Both CreateDFNItem and CreateBlankItem seem to require a socket (or UOX3 will crash :P), but it would be very useful to have another way of creating items (or to allow using those methods without supplying a valid socket).

I'm currently messing around with a script that generates magical items (Indestructible leather tunic of Invulnerability, anyone?), but without a way of creating items without supplying a valid socket, I'm stuck.
-= Ho Eyo He Hum =-
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

I'm actually suprised that it crashes if you attempt to spawn one without it...

I know that our items/npc code allows us to create those objects passing a NULL socket, so I assume the issue is somewhere in the JS overloads.
Scott
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Anything that can be done about this? (ok, so it's a *bump* ;P)
-= Ho Eyo He Hum =-
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

I'm not familiar enough with network protocols to understand the advtages/limitations of creating items with or without sockets,

however your post hinted at magic items, especially armour.

It reminded me that we need to fix the 'tweak and/or 'set commands to properly adjust an items DEF function. This would allow easy creating by a GM of the above mentioned "indestructible leather tunic of invulnerability".
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

Fixed
Scott
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Well, I already have a script written which can pour out random pre-AoS magic armors (quality/power depends on the fame of the creature). Not being able to spawn items without a socket is the only major roadblock remaining, I think.

When used as a global script in UOX3, it will (randomly, depending on fame of creature and some general randomness) spawn a (random) piece of magic armor in the backpacks of newly spawned creatures.

If I can get it working properly, it shouldn't take too much effort to also use it for magic weapons (accurate silver katana of vanquishing, anyone?).
-= Ho Eyo He Hum =-
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

I'm compiling UOX3 now, as long as everything seems to function properly, I'm going to make another commit in about 5 minutes. Including the boat Z fix, house placement fix, and this fix.
Scott
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

That did the trick, thanks :) The script is now producing magic armor! Wee.

Though I'm not sure what to do now that the names are restricted to 30 characters only again :/ I'm getting magic armor which identifies as Indestructible platemail of I, for instance.

Not to mention that several signs in the various towns no longer display their entire names. Example:

The sign outside the conservatory of music in Britain displays, on the official shards, "Lord British's Conservatory Of Music" (36 characters) - while in UOX3 it currently (0.98-3.6f) says "Lord British's Conservatory Of" (30 characters). That's just one of many examples.
-= Ho Eyo He Hum =-
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

Ahh... yes, I forgot that the max name setting would screw up the item name display....


Given the fact that having it at 60 hasn't harmed anything, we can adjust it back up. Simply go to MAX_NAME in typedefs.h and change it to 60.
Scott
Post Reply