Game Modding | Call of Duty: Black Ops 3 | Scripting
ModmeBot:
Thread By: Abnormal202
So I'm scripting the easter egg for Psh's map, Gulag, and part of it requires a "soul" to appear out of dead Brutus bodies, that can be picked up. I've edited the nsz_brutus.gsc to spawn the Brutus's at a scripted time (which works) but for some reason I cannot get an fx or trigger to spawn on their corpses. Here's what I have for the death function I've changed:
is there something I'm missing? can you actually spawn a trigger use like that?
ModmeBot:
Reply By: ZoekMeMaar
functionnew_death(){selfwaittill("death");self.lightdelete();level.current_brutuses--;PlayFx(SPAWN_FX,self.origin);if(self.alternate_spawn==false){if(level.current_brutuses<1)threadzm_powerups::specific_powerup_drop(undefined,self.origin);}elseif(self.alternate_spawn==true&&level.bruti_dead==2){threadzm_powerups::specific_powerup_drop("full_ammo",self.origin);}selfPlaySound("brutus_helmet");selfPlaySound("brutus_defeated_0"+randomintrange(0,3));selfPlaySound("brutus_death");nsz_iprintlnbold("^2Brutus Died");clone=spawn("script_model",self.origin);clone.angles=self.angles;cloneSetModel("bo2_brutus_fb");selfhide();cloneUseAnimTree(#animtree ); cloneAnimScripted("placeholder",clone.origin,clone.angles,%brutus_death);wait(GetAnimLength(%brutus_death));if(self.alternate_spawn==true){level.bruti_dead++;IPrintLnBold(level.bruti_dead+" down");if(level.bruti_dead==3){levelnotify("all_bruti_dead");}clonethreadsoulspawn();// calls the script on the clone}selfdelete();if(self.alternate_spawn!=true){wait(30);clonedelete();}}functionsoulspawn(){PlayFxOnTag(SOUL_FX,self,"tag_origin");// no need to make an invisble model we can use the origin of the clonetrig=spawn("trigger_use",self.origin);trigSetHintString(level.soul_hintstring);trigSetCursorHint("HINT_NOICON");trigwaittill("trigger",player);selfDelete();// delets clone if trigger is usedtrigDelete();// delets trigger if trigger is used}
So i changed a bit, u were calling stuff on self model as that gets hidden and clone is set in place we need to call script on clone, also i deleted the invisble model no need to use that just use origin of clone
ModmeBot:
Reply By: Abnormal202
ZoekMeMaar
functionnew_death(){selfwaittill("death");self.lightdelete();level.current_brutuses--;PlayFx(SPAWN_FX,self.origin);if(self.alternate_spawn==false){if(level.current_brutuses<1)threadzm_powerups::specific_powerup_drop(undefined,self.origin);}elseif(self.alternate_spawn==true&&level.bruti_dead==2){threadzm_powerups::specific_powerup_drop("full_ammo",self.origin);}selfPlaySound("brutus_helmet");selfPlaySound("brutus_defeated_0"+randomintrange(0,3));selfPlaySound("brutus_death");nsz_iprintlnbold("^2Brutus Died");clone=spawn("script_model",self.origin);clone.angles=self.angles;cloneSetModel("bo2_brutus_fb");selfhide();cloneUseAnimTree(#animtree ); cloneAnimScripted("placeholder",clone.origin,clone.angles,%brutus_death);wait(GetAnimLength(%brutus_death));if(self.alternate_spawn==true){level.bruti_dead++;IPrintLnBold(level.bruti_dead+" down");if(level.bruti_dead==3){levelnotify("all_bruti_dead");}clonethreadsoulspawn();// calls the script on the clone}selfdelete();if(self.alternate_spawn!=true){wait(30);clonedelete();}}functionsoulspawn(){PlayFxOnTag(SOUL_FX,self,"tag_origin");// no need to make an invisble model we can use the origin of the clonetrig=spawn("trigger_use",self.origin);trigSetHintString(level.soul_hintstring);trigSetCursorHint("HINT_NOICON");trigwaittill("trigger",player);selfDelete();// delets clone if trigger is usedtrigDelete();// delets trigger if trigger is used}
So i changed a bit, u were calling stuff on self model as that gets hidden and clone is set in place we need to call script on clone, also i deleted the invisble model no need to use that just use origin of clone
Oh sorry, guess I should've said I figured it out. I had contacted NSZ and he helped me work it out.
ModmeBot:
Reply By: Exofile
Abnormal202
Oh sorry, guess I should've said I figured it out. I had contacted NSZ and he helped me work it out.
Feel free to post the solution here for anyone that might need the same help in the future.