Item Scope

greatguys1

Epic Adventurer
MSC Developer
Warriors of the North
MSC Archivist
Joined
Apr 20, 2013
Messages
339
Reaction score
61
Age
26
Location
Yes
As far as I know, items mostly need to be shared in their scope. In what cases, however, should the scope be client or server side only? I would think that information like name, desc, setmodel 'n stuff that would be in game_spawn would have to be shared.
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Items are shared scope by default. It's a bit of a gray area, since most of the commands are server side, and send data to the client - but if you've looked at my item mod script (where you see insanity like "name $get(ent_me,name)", stuff does get weird sometimes. Unless you're certain you want to client only or server only, best to leave it shared on items. (Unlike Monsters which you want to be server side scoped nearly all the time.)

This is also what lead to the "syncitem <item_id> <player_id>" crap, though you shouldn't have to worry about that, provided you don't do anything crazy, like trying to change the name/desc of items post-spawn or through an applyeffect.

Items are also really funky with how they go about using their client side scripts - it doesn't quite work like an CLFX script, where there's a unique instance of it, but rather it responds to various client hard events from the owner (such as game_+attack, and <attack_data_callback>_start). So if you do want a CLFX script, best to clientevent it up separately and update it in the usual fashion, rather than attempting to integrate it into the item script's native client side.

Best to start with modifying an existing item script, as making items from scratch is a royal pain. If you insist, however, base_weapon_new probably has the least number of odd base scripts to comb through, being largely self contained, aside from base_item and base_item_extras. Last bit of advice for making weapons from scratch would be: Don't fight against the weapon registration system - as much as I hate it, trying to work around it will cause endless headaches. Don't use game_attack unless you have no other choice.
 
Top