I want a script that will allow the player to find an object in game hold 'F' on it, then go to a point in the game that they can hold 'F' again and place it there, but it needs to allow the player to mix and match different objects, say there are 3 gate worms, each one can then go into any of the others' place. Thanks
There exists an unspoken law in coding: Thou shall not beg for mercy if thy has not done his due diligence. Basically it is a generally accepted etiquette to educate yourself to a finger-bleeding degree in the subject of your interest before calling "write me a script plz"
The mod tools come with a folder labled docs_modtools, look in there and read the gsc help file for basic scripting guidelines. Also read the other documents when you have time, you'll learn a lot from the developers. With that being said I don't mind helping, but just remember most people will either ignore you, or scold you for not taking the basic steps to learn the ropes - reading beginner tutorials, watching youtube videos, trial & error etc. Not to be a dick or anything, I'm just trying to help you.
For each item you want to pick up, put down a script_model, and a trigger_use. Select the trigger first, then select the model, and hit W. Next select only the trigger, hit N to bring up entity_info pane, add these KVP's:
targetname - part script_noteworthy - name_of_part's_xmodel
You can get the name of the xmodel by selecting the script_model, hit N, then copy the text from the ''model" KVP.
Make sure every pick-up trigger has the targetname - part, but a script_noteworthy value unique to the item's xmodel name for the following script to work. This way in script you can collect all pick-up triggers by the 'part' targetname, store them all in a single array variable, then sort them individually or uniquely identify them based on their script_noteworthy value, which you set to be the name of the xmodel, so this string can be stored and re-used later to spawn the model back at a different trigger.
Next, for each part you have, drop down an equal number of trigger_use brushes for the locations to place the items after the player picks them up. Give them all this KVP: targetname - end_location
Now open your mapname.gsc and navigate to function main() then follow the instructions below.
I would also advise you to download my custom buildables script here https://ugx-mods.com/forum/index.php/topic,15031.0.html and study the main gsc file, a lot of functions I wrote already do some of what you want. There are many other examples and addons on ugx which have helped me tremendously in learning the codscript system in general as well as mapping and other subjects. Read some of the WAW tutorials here too, the format is nearly identical as far as the scripting part. It's amazing realizing the potential of what you can do with script and a little mapping experience. Good luck.
Last Edit: April 29, 2017, 07:54:13 pm by Archaicvirus