UGX-Mods

Call of Duty: Black Ops 3 => Help Desk => Scripting => Topic started by: Doodles_Inc on July 17, 2018, 12:46:55 am

Title: Moving a perk
Post by: Doodles_Inc on July 17, 2018, 12:46:55 am
So my idea is to have a perk stuck somewhere in my map and when I shoot it, it falls down for instance, the problem is, the perks prefabs are composed of script_structs and lights, wich IDK how to move, I have tried this:
Code Snippet
Plaintext
function staminup() {
trigger = GetEnt("stamintrig", "targetname");
trigger waittill("trigger", player);
trigger Delete();
IPrintLnBold("Staminup");
staminuperk = GetEntArray("stamin", "targetname");
foreach (stamin in staminuperk) {
stamin MoveZ(-235, 1);
IPrintLnBold("Stamin");
}
staminuperkstructs = struct::get_array("stamin", "targetname");
foreach (stamin in staminuperkstructs) {
stamin MoveZ(-235, 1);
IPrintLnBold("Staminstructs");
}
IPrintLnBold("Staminup moved");
}
None of the print statements in the foreach loops execute, neither does the perk move, any ideas?
Title: Re: Moving a perk
Post by: BluntStuffy on July 17, 2018, 07:55:45 pm
a struct is not an entity, you cant move it or do anyhing with it except store some kvps basicly.
Think you can change the origin by just setting it, but using a function like move() or w/e wont work for structs..

You would have to find a way to work around that, spawn a script_origin and/or or replace them in radiant and adapt the scripts to work with those for example.

Not sure why it doesn't print at all, dont have any basic bo3 knowledge to tell if it's kvp's or something.. If i recall correctly using 'getentarray' on a single ent in waw would cause a script-error. Not sure if it would actually prevent the array from being created though, and if that's also the case in bo3..