<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Getting Coordinates of Spawned Craftable Parts]]></title><description><![CDATA[<p dir="auto">Any idea on how to do this on MOTD?</p>
<p dir="auto">Tried to loop through level.zombies_craftablestubs but that array is empty. I've been looking through the T6 stock scripts for ages and i cant find the logic for where the parts are randomly spawned either. Any help would be great.</p>
]]></description><link>https://forum.plutonium.pw/topic/36025/getting-coordinates-of-spawned-craftable-parts</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 14:02:19 GMT</lastBuildDate><atom:link href="https://forum.plutonium.pw/topic/36025.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 05 May 2024 16:37:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Getting Coordinates of Spawned Craftable Parts on Mon, 06 May 2024 19:34:25 GMT]]></title><description><![CDATA[<p dir="auto">Got it to work! The function I was looking for was get_craftable_piece_model. I also checked if the parts had a delay to being spawned in which turned out to be true so there's a check for that too when the player spawns.</p>
<p dir="auto">Heres the code and a link to the function:</p>
<pre><code>#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\zombies\_zm_utility;
#include maps\mp\gametypes_zm\_hud_util;
#include maps\mp\zombies\_zm_laststand;
#include maps\mp\zombies\_zm_equipment;
#include maps\mp\zombies\_zm_unitrigger;
#include maps\mp\zombies\_zm_craftables;
#include maps\mp\zombies\_zm_stats;
#include maps\mp\zombies\_zm_weapons;
#include maps\mp\_demo;

init()
{
    level thread onplayerconnect();
}

onplayerconnect()
{
    for(;;) {
        level waittill ("connecting", player);
        player thread onplayerspawned();
    }
}

onplayerspawned()
{
    self endon("disconnect");
	level endon("end_game");
    for (;;) {
        self waittill("spawned_player");
        while ( level.a_uts_craftables.size == 0 ){
            wait 1;
        }
        dolly = get_craftable_piece_model("alcatraz_shield_zm", "dolly");
        teleportPlayer(self, dolly.origin, dolly.angles);
        
    }
}

teleportPlayer(player, origin, angles)
{
    player setOrigin(origin);
    player setPlayerAngles(angles);
}
</code></pre>
<p dir="auto"><a href="https://github.com/plutoniummod/t6-scripts/blob/d8e72bcb38d041dcd63a9447ec52dbb8bbeaeb0d/ZM/Maps/Origins/maps/mp/zombies/_zm_craftables.gsc#L2902" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/plutoniummod/t6-scripts/blob/d8e72bcb38d041dcd63a9447ec52dbb8bbeaeb0d/ZM/Maps/Origins/maps/mp/zombies/_zm_craftables.gsc#L2902</a></p>
<p dir="auto">Thanks for your help, i would have been looking about for the function for ages <img src="https://forum.plutonium.pw/assets/plugins/nodebb-plugin-emoji/emoji/android/1f60a.png?v=820c8bfc6a0" class="not-responsive emoji emoji-android emoji--blush" style="height:23px;width:auto;vertical-align:middle" title=":blush:" alt="😊" /></p>
]]></description><link>https://forum.plutonium.pw/post/139204</link><guid isPermaLink="true">https://forum.plutonium.pw/post/139204</guid><dc:creator><![CDATA[Jason_]]></dc:creator><pubDate>Mon, 06 May 2024 19:34:25 GMT</pubDate></item><item><title><![CDATA[Reply to Getting Coordinates of Spawned Craftable Parts on Mon, 06 May 2024 19:32:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jason_" aria-label="Profile: Jason_"><bdi>Jason_</bdi></a> I would wait for initial_blackscreen_passed or a long time or something like you reloading</p>
]]></description><link>https://forum.plutonium.pw/post/139203</link><guid isPermaLink="true">https://forum.plutonium.pw/post/139203</guid><dc:creator><![CDATA[Resxt]]></dc:creator><pubDate>Mon, 06 May 2024 19:32:53 GMT</pubDate></item><item><title><![CDATA[Reply to Getting Coordinates of Spawned Craftable Parts on Mon, 06 May 2024 18:49:00 GMT]]></title><description><![CDATA[<p dir="auto">Hi again, it seems that array is still empty. Could it be because the parts aren't spawned immediately? Still trying this on MOTD. Tried looking for a waittill flag for parts being spawned but i can't seem to find anything. Still very new to GSC so not too sure what's going on here.</p>
<pre><code>#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\zombies\_zm_utility;
#include maps\mp\gametypes_zm\_hud_util;
#include maps\mp\zombies\_zm_laststand;
#include maps\mp\zombies\_zm_equipment;
#include maps\mp\zombies\_zm_unitrigger;
#include maps\mp\zombies\_zm_craftables;
#include maps\mp\zombies\_zm_stats;
#include maps\mp\zombies\_zm_weapons;
#include maps\mp\_demo;

init()
{
    level thread onplayerconnect();
}

onplayerconnect()
{
    for(;;) {
        level waittill ("connecting", player);
        player thread onplayerspawned();
    }
}

onplayerspawned()
{
    self endon("disconnect");
	level endon("end_game");
    for (;;) {
        self waittill("spawned_player");
        if (isdefined(level.a_uts_craftables)) {
            println(level.a_uts_craftables.size);
        }
    }
}
</code></pre>
]]></description><link>https://forum.plutonium.pw/post/139199</link><guid isPermaLink="true">https://forum.plutonium.pw/post/139199</guid><dc:creator><![CDATA[Jason_]]></dc:creator><pubDate>Mon, 06 May 2024 18:49:00 GMT</pubDate></item><item><title><![CDATA[Reply to Getting Coordinates of Spawned Craftable Parts on Mon, 06 May 2024 17:49:15 GMT]]></title><description><![CDATA[<p dir="auto">You could take a look at the _zm_craftables.gsc script<br />
It has functions (or array) you could try to check (.size and IsDefined(piece))</p>
<p dir="auto">For example this<br />
<a href="https://github.com/plutoniummod/t6-scripts/blob/d8e72bcb38d041dcd63a9447ec52dbb8bbeaeb0d/ZM/Maps/Origins/maps/mp/zombies/_zm_craftables.gsc#L2875" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/plutoniummod/t6-scripts/blob/d8e72bcb38d041dcd63a9447ec52dbb8bbeaeb0d/ZM/Maps/Origins/maps/mp/zombies/_zm_craftables.gsc#L2875</a></p>
]]></description><link>https://forum.plutonium.pw/post/139198</link><guid isPermaLink="true">https://forum.plutonium.pw/post/139198</guid><dc:creator><![CDATA[Resxt]]></dc:creator><pubDate>Mon, 06 May 2024 17:49:15 GMT</pubDate></item><item><title><![CDATA[Reply to Getting Coordinates of Spawned Craftable Parts on Mon, 06 May 2024 17:24:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/resxt" aria-label="Profile: Resxt"><bdi>Resxt</bdi></a> Sure thing, it just doesn't make any sense how the parts can only spawn in certain locations but when you search through the stock scripts there's literally 0 coordinates anywhere for any parts. Very confusing <img src="https://forum.plutonium.pw/assets/plugins/nodebb-plugin-emoji/emoji/android/1f627.png?v=820c8bfc6a0" class="not-responsive emoji emoji-android emoji--anguished" style="height:23px;width:auto;vertical-align:middle" title=":anguished:" alt="😧" /></p>
]]></description><link>https://forum.plutonium.pw/post/139196</link><guid isPermaLink="true">https://forum.plutonium.pw/post/139196</guid><dc:creator><![CDATA[Jason_]]></dc:creator><pubDate>Mon, 06 May 2024 17:24:47 GMT</pubDate></item><item><title><![CDATA[Reply to Getting Coordinates of Spawned Craftable Parts on Mon, 06 May 2024 08:49:56 GMT]]></title><description><![CDATA[<p dir="auto">It seems to do some quite complex work with arrays, I think it duplicates one too + it might use unitrigger dynamically spawned so it's hard to get the right target. I never got to make what I wanted work with parts too.</p>
<p dir="auto">If I ever get it I'll let you know<br />
If you do lmk too</p>
]]></description><link>https://forum.plutonium.pw/post/139163</link><guid isPermaLink="true">https://forum.plutonium.pw/post/139163</guid><dc:creator><![CDATA[Resxt]]></dc:creator><pubDate>Mon, 06 May 2024 08:49:56 GMT</pubDate></item></channel></rss>