Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to Decorate with a Screenplay the Easy Way - With Server Mods!
#1
The link to the original post is here,
https://tatwi.wordpress.com/2016/07/03/s...rver-mods/

This is a set of server side mods that allow (full) Admin characters to:

1. Pickup, drop, rotate, and move all tangible objects even outside. EDIT: Now also has a system for decorating with "static objects", such as bridges, walls, pillars, etc. complete with a terminal that generates them.
2. Automatically generate fully formatted spawnMobile and spawnSceneObject screenplay calls to the chat log.
3. Some other handy stuff.


I made these mods to make my life easier. This is about as easy as it gets given the tools we have available today.

List of files:
src/server/zone/objects/scene/components/ObjectMenuComponent.cpp
src/server/zone/objects/creature/commands/RotateFurnitureCommand.h
src/server/zone/objects/creature/commands/MoveFurnitureCommand.h
src/server/zone/objects/creature/commands/GetObjVarsCommand.h
src/server/zone/objects/creature/commands/FindPlayerCommand.h
bin/scripts/object/tangible/terminal/terminal_character_builder.lua
tre/object/tangible/camp/*.iff

New Static Object Features:
bin/scripts/object/allobjects.lua
bin/scripts/object/tangible/beta/donham_terminal.lua
bin/scripts/object/tangible/furniture/static/structure/tatooine/objects.lua
bin/scripts/object/tangible/furniture/static/structure/tatooine/serverobjects.lua
bin/scripts/object/tangible/furniture/static/structure/tatooine/wall_archway_tatooine_large_style_01.lua
bin/scripts/object/tangible/furniture/static/structure/tatooine/wall_archway_tatooine_wide_style_01.lua
bin/scripts/object/tangible/serverobjects.lua
bin/scripts/screenplays/hondo/tests.lua
bin/scripts/screenplays/screenplays.lua
src/server/zone/objects/creature/commands/GetObjVarsCommand.h
tre/misc/object_template_crc_string_table.iff
tre/object/tangible/furniture/static/structure/tatooine/shared_wall_archway_tatooine_large_style_01.iff
tre/object/tangible/furniture/static/structure/tatooine/shared_wall_archway_tatooine_wide_style_01.iff
tre/string/en/frn_d.stf
tre/string/en/frn_n.stf


Command Reference

/getobjvars
Emails a bunch of data about your targeted object as it normally would.

/getobjvars id NUMBER
Emails a bunch of data about the object id provided as it normally would.

/getobjvars spout
Spits out a fully formatted spawnSceneObject screenplay command into the chat box for the targeted object. When used on an NPC, it will spit out a spawnMobile screenplay command instead.

Example Output:
spawnSceneObject("tatooine", "object/tangible/camp/camp_tent_s1.iff",  -2980.62, 5.0, 2528.85, 0,  0.963207, 0, -0.268761, 0)

spawnMobile("dathomir", "singing_mountain_clan_sentry", 360, -4573.5, 34.7, -6556.4, 138, 0)[/i]

/getobjvars static

Spits out a fully formatted spawnSceneObject screenplay command into the chat box for the targeted object, provided that the object is one of the special new "static object as a tangible object" located below objects/tangible/furniture/static/

Example Output:
spawnSceneObject("tatooine", "object/static/structure/tatooine/shared_wall_archway_tatooine_wide_style_01.iff",  -2980.62, 5.0, 2528.85, 0,  0.963207, 0, -0.268761, 0)


getobjvars onme
This spits out a fully formatted spawnMobile screenplay command based on your current position and the direction you are facing. Simply stand where and how you want the NPC and fire off this command. By default the NPC name is "commoner", so you just need to replace it with the name of the NPC mobile template that you want. This workflow might be faster than spawning / placing / rotating and "/getobjvars spout" on the mob itself.

Example Output:
spawnMobile("tatooine", "commoner", 360, -4573.5, 34.7, -6556.4, 138, 0)


getobjvars myparent
Returns the ObjectID of the building you are standing in, unlike CTL+SHIFT+G which shows you the ObjectID of the cell you are standing in. It's sometimes handy to know this quickly when making content.

Step By Step How-To

1. Merge the changes listed above into your development server. No real need to put these into a live server, yet no reason not to have them on a dev sever! Smile

2. Compile/build and boot your server.

3. Log into the game on an admin character and decorate as you normally would in the game, inside or out. When outside you will notice new radial menu options for Admin Drop Outside and Admin Pickup Outside.

4. Type /log to turn on chat logging, so that everything in the chat box gets written to a file on your hard drive. You'll want to turn off the time stamping in the Options > Chat menu in the game as well. To avoid duplicate messages, you need to get rid of System Messages in your Combat chat log by right clicking the combat tab, choosing Modify Tab, and moving System Messages from the right side box to the left side box.

5. Open the command window and make a macro for /getobjvars spout and drop the macro onto your toolbar in the first (or any) slot.

6. Target an object that you placed as a decoration and press the key for the macro you put on your toolbar.

7. Repeat step 6 for every object or mob that you placed.

8. When you're finished step 7 type /log to turn off logging.

9. Alt-Tab out of the game and head to your profiles folder in the game installation folder and open the chatlog text file in Notepad. This will look something like so: C:\SWGEmu\profiles\accountName\serverName\281474993500826_chatlog.txt where the long number is the character's reference number. Smaller number = older character. I made a handy shortcut to the file so I don't have to go rooting around for it.

10. Remove all the [Spatial] text and extra spaces before the commands you want. Copy one instance of [Spatial] and go to Edit > Replace ( or press ctl+h) in Notepad. Paste [Spatial] in the "Find what:" text box (empty spaces included if you'd like) and press the "Replace All" button.

11. Now all you need to do is copy and paste every spawnSceneObject and/or spawnMobile line into your screenplay. SHAAAHH BAM!, YOU'RE DONE!

12. Note: Any object you dropped outside will be deleted when your server reboots, so no need to clean up after yourself.

- - - -

So there you have it, a much more natural and quick way to populate your server with decorations and NPCs. Maybe down the road I'll figure out how to use static objects, such bridges, walls, buildings, etc, in the same way, but this will do for now.

Happy world building! Smile

Ps. On 2016.07.12 I removed the ability to pickup NPCs as they wouldn't always go where you dropped them and I discovered that picking up babies would crash the client.
Legend of Hondo - A Single Player SWGEmu based ... science project? Smile
My SWGs Files - https://mega.nz/#F!nUMwRSAI!S35daVC46CcEX9PQKmWr-g
http://www.tpot.ca - SWG Mods and Information

 
Reply
  



Forum Jump:


Browsing: 1 Guest(s)