Game Modding | Call of Duty: Black Ops 3 | Scripting
ModmeBot:
Thread By: To_Be_Honest
Does Anyone Know A Way To Pickup A Item And Place It Down At A Specific Spot?
<hr>Not Into The Coding...
ModmeBot:
Reply By: mathfag
Here's a script a wrote for one of my previous maps. Basically you pick up a gateworm and place it on a podium. What you need to do is make a script model in radiant called in this case ee_gateworm1,2,3,4 (to pick up) and ee_gateworm_place1,2,3,4 (to place down). You need to hide ee_gateworm_place1,2,3,4 with
untill triggered to show.
https://pastebin.com/tucE8GS6
ModmeBot:
Reply By: To_Be_Honest
mathfag
Here's a script a wrote for one of my previous maps. Basically you pick up a gateworm and place it on a podium. What you need to do is make a script model in radiant called in this case ee_gateworm1,2,3,4 (to pick up) and ee_gateworm_place1,2,3,4 (to place down). You need to hide ee_gateworm_place1,2,3,4 with model_1 Hide(); untill triggered to show. https://pastebin.com/tucE8GS6
ModmeBot:
Reply By: mathfag
RADIANT:
First place some models in radiant and turn them into script_models via the entity browser (place them where you need them to be picked up and placed down). Give them custom targetnames. Name them so you know what you're dealing with; the place location should have the model with a targetname with "_place" at the end (to make it easier for later).
Now you should have a number of models that is dividable by 2. The names are "model1", "model1_place", "model2"...
Now you need to add triggers around the models. Name them the same as the models but with "trig_" in front.
SCRIPTING:
First you'll need to hide the models at the location that you need to place them at.
You do it with this script:
Then basically copy this script but change the targetnames and rewards in function done()
If you don't understand this, you should lower your goals untill you get some experience with scripting.
Here's a relatively simple tutorial http://natesmithzombies.com/wiki.html
ModmeBot:
Reply By: To_Be_Honest
mathfag
RADIANT: First place some models in radiant and turn them into script_models via the entity browser (place them where you need them to be picked up and placed down). Give them custom targetnames. Name them so you know what you're dealing with; the place location should have the model with a targetname with "_place" at the end (to make it easier for later). Now you should have a number of models that is dividable by 2. The names are "model1", "model1_place", "model2"... Now you need to add triggers around the models. Name them the same as the models but with "trig_" in front. SCRIPTING: First you'll need to hide the models at the location that you need to place them at. You do it with this script: model_1 = GetEnt("model1_place", "targetname"); model_2 = GetEnt("model2_place", "targetname"); model_1 Hide(); model_2 Hide(); //as many as you have models Then basically copy this script but change the targetnames and rewards in function done() #using scripts\custom\forest\ee_bossfight; function init() { level.wormsCollected = 0; level.wormsPlaced = 0; level thread SDFM_Debug(); level thread redeemer_worms_pickup1(); level thread redeemer_worms_pickup2(); level thread redeemer_worms_pickup3(); level thread redeemer_worms_pickup4(); level thread redeemer_worms_place1(); level thread redeemer_worms_place2(); level thread redeemer_worms_place3(); level thread redeemer_worms_place4(); level thread worms_done(); } function SDFM_Debug( string ) { if( isDefined(level.SDFMdebug) && level.SDFMdebug ) iprintlnbold( "^6Debug:^7 "+string ); } function redeemer_worms_pickup1(player) { trig_1 = GetEnt("trig_ee_gateworm1", "targetname"); model_1 = GetEnt("ee_gateworm1", "targetname"); trig_1 SetHintString(""); trig_1 SetCursorHint("HINT_NOICON"); while(1) { trig_1 waittill("trigger", player); level.wormsCollected++; wait(0.1); SDFM_Debug("Worm 1 picked up"+" you have "+level.wormsCollected+" worms out of 4"); // Not Needed break; } trig_1 Delete(); model_1 Delete(); } function redeemer_worms_pickup2(player) { trig_2 = GetEnt("trig_ee_gateworm2", "targetname"); model_2 = GetEnt("ee_gateworm2", "targetname"); trig_2 SetHintString(""); trig_2 SetCursorHint("HINT_NOICON"); while(1) { trig_2 waittill("trigger", player); level.wormsCollected++; wait(0.1); SDFM_Debug("Worm 2 picked up"+" you have "+level.wormsCollected+" worms out of 4"); // Not Needed break; } trig_2 Delete(); model_2 Delete(); } function redeemer_worms_pickup3(player) { trig_3 = GetEnt("trig_ee_gateworm3", "targetname"); model_3 = GetEnt("ee_gateworm3", "targetname"); trig_3 SetHintString(""); trig_3 SetCursorHint("HINT_NOICON"); while(1) { trig_3 waittill("trigger", player); level.wormsCollected++; wait(0.1); SDFM_Debug("Worm 3 picked up"+" you have "+level.wormsCollected+" worms out of 4"); // Not Needed break; } trig_3 Delete(); model_3 Delete(); } function redeemer_worms_pickup4(player) { trig_4 = GetEnt("trig_ee_gateworm4", "targetname"); model_4 = GetEnt("ee_gateworm4", "targetname"); trig_4 SetHintString(""); trig_4 SetCursorHint("HINT_NOICON"); while(1) { trig_4 waittill("trigger", player); level.wormsCollected++; wait(0.1); SDFM_Debug("Worm 4 picked up"+" you have "+level.wormsCollected+" worms out of 4"); // Not Needed break; } trig_4 Delete(); model_4 Delete(); } //###########################################################// // Place worm // //###########################################################// function redeemer_worms_place1(player) { trig_1 = GetEnt("trig_ee_gateworm_place1", "targetname"); model_1 = GetEnt("ee_gateworm_place1", "targetname"); trig_1 SetHintString("Place worm"); trig_1 SetCursorHint("HINT_NOICON"); while(1) { trig_1 waittill("trigger", player); if(level.wormsCollected > 0 && level.wormsPlaced <= 4) { level.wormsCollected--; level.wormsPlaced++; wait(0.1); trig_1 Delete(); model_1 Show(); SDFM_Debug("Worm 1 placed"+" you have "+level.wormsCollected+" worms left"); // Not Needed thread worms_done(); } break; } } function redeemer_worms_place2(player) { trig_2 = GetEnt("trig_ee_gateworm_place2", "targetname"); model_2 = GetEnt("ee_gateworm_place2", "targetname"); trig_2 SetHintString("Place worm"); trig_2 SetCursorHint("HINT_NOICON"); while(1) { trig_2 waittill("trigger", player); if(level.wormsCollected > 0 && level.wormsPlaced <= 4) { level.wormsCollected--; level.wormsPlaced++; wait(0.1); trig_2 Delete(); model_2 Show(); SDFM_Debug("Worm 2 placed"+" you have "+level.wormsCollected+" worms left"); // Not Needed thread worms_done(); } break; } } function redeemer_worms_place3(player) { trig_3 = GetEnt("trig_ee_gateworm_place3", "targetname"); model_3 = GetEnt("ee_gateworm_place3", "targetname"); trig_3 SetHintString("Place worm"); trig_3 SetCursorHint("HINT_NOICON"); while(1) { trig_3 waittill("trigger", player); if(level.wormsCollected > 0 && level.wormsPlaced <= 4) { level.wormsCollected--; level.wormsPlaced++; wait(0.1); trig_3 Delete(); model_3 Show(); SDFM_Debug("Worm 3 placed"+" you have "+level.wormsCollected+" worms left"); // Not Needed thread worms_done(); } break; } } function redeemer_worms_place4(player) { trig_4 = GetEnt("trig_ee_gateworm_place4", "targetname"); model_4 = GetEnt("ee_gateworm_place4", "targetname"); trig_4 SetHintString("Place worm"); trig_4 SetCursorHint("HINT_NOICON"); while(1) { trig_4 waittill("trigger", player); if(level.wormsCollected > 0 && level.wormsPlaced <= 4) { level.wormsCollected--; level.wormsPlaced++; wait(0.1); trig_4 Delete(); model_4 Show(); SDFM_Debug("Worm 4 placed"+" you have "+level.wormsCollected+" worms left"); // Not Needed thread worms_done(); } break; } } function worms_done() { model_0 = GetEnt("ee_gateworm_big", "targetname"); redeemer1 = GetEnt("boss_vines3","targetname"); redeemer2 = GetEnt("boss_vines4","targetname"); redeemer_clip = GetEnt("boss_vines_clip2","targetname"); while(1) { self waittill(level.wormsPlaced >= 4); if(level.wormsPlaced == 4) { SDFM_Debug("All Worms placed"+" you have "+level.wormsCollected+" worms left"); //REWARDS GO HERE } break; } } If you don't understand this, you should lower your goals untill you get some experience with scripting. Here's a relatively simple tutorial http://natesmithzombies.com/wiki.html
blink-420:
This is perfect was having trouble getting this to work on my own thank you very much <3
panzersoldat:
This is perfect was having trouble getting this to work on my own thank you very much <3