Hello everyone! \0
A lot of users have been wondering how to make an usable rope. It's a bit hard to see in the scripts of the main game, but here you can see how you can make a rope.
1: Open the desired level to use the rope. Choose the location where the rope is going to be. Then, put a movable entity (I'm going to use a crank_wheel)
2: Now, go to areas: There are a lot but we are going to use two:
Rope area and PosNode.
The rope area is where the rope begins, so place it wisely. Now, place the Rope area here:
Ok, now copy and paste the following destination:
rope_default_normal.rope
The green area at the bottom of the image is the PosNode. Don't edit anything.
3: As you can see in the image, there is an invisible box mass. That box mass is linked to the rope and pos node, so it will move with it.
BUT: There isn't the most important thing:
THE SCRIPT
void OnStart()
{
InteractConnectPropWithRope("WellRope","crank_wheel_1", "RopeArea_1", false, 3,5,5, false, 0);
AddUseItemCallback("MeatOnRope", "fresh_meat_1", "crank_wheel_1", "UseMeatOnRope", false);
}
void UseMeatOnRope(string &in asItem, string &in asEntity)
{
AddAttachedPropToProp("invisible_box_mass_3", "fresh_meat_onrope_1", "fresh_meat_onrope.ent", 0,0,0, 0,0,0);
This is the script: The ICPWR connects the crank_wheel_1 with the rope area. This will make the rope movable. But, this doesn't finish here. As in the main game, we have to pull down a piece of meat. So, we use an AUIC.
This says that when we use the fresh meat in the crank wheel, the UseMeatOnRope will happen. This UseMeatOnRope attachs the fresh_meat_on_rope_1 (with the internal name fresh_meat_onrope.ent) to the invisible_box_mass_3. Now, to get sure something happens, when the meat touches an area (which is at the final of the rope) an armor will spawn. The armor is called servant_grunt_1.
THE FINAL SCRIPT
void OnStart()
{
InteractConnectPropWithRope("WellRope","crank_wheel_1", "RopeArea_1", false, 3,5,5, false, 0);
AddUseItemCallback("MeatOnRope", "fresh_meat_1", "crank_wheel_1", "UseMeatOnRope", false);
}
void UseMeatOnRope(string &in asItem, string &in asEntity)
{
AddAttachedPropToProp("invisible_box_mass_3", "fresh_meat_onrope_1", "fresh_meat_onrope.ent", 0,0,0, 0,0,0);
AddEntityCollideCallback("fresh_meat_onrope_1", "ScriptArea_1", "BLA", false, 1);
}
void BLA (string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
}
Ropes are a bit tricky but they are cool to use.
Hope you find this tutorial useful!
-The chaser