Grappling Hook Code research
Posted: Sat Feb 28, 2009 5:23 pm
We all know, I'm sure, about Mav's clever workaround to the no-grapple problem. He wrote up a code that, I think, went something like this: upon hitting a certain type of object with a certain weapon, teleport the player to the object's location.
After pinning down a few basics of LUA, I tried to compose a code that would duplicate this effect. After all, I'm sure we'd all love to use a grappling hook in our maps!
Here's the code (so far), where "grapple_target" is the name of the object's ODF. The object is, for now, a destructable prop placed in ZE. "rep_inf_grapple" is the ODF name of the grappling hook weapon. For the purpose of testing, I just copied the republic stock EMP launcher, toned down it's damage, and renamed it (odf, ord, and exp).
This is under ScriptPostLoad. I'm rather sure some of it is incorrect (not sure how to get the matrix and cite it) but the thing is that it munged perfectly without any mungelog complaints.
Still, I get a CTD right after loading the map. The only Severity: 3, shown below, apparently has nothing to do with the LUA or the weapon.
This confuses me because I don't use lightsabers. Why would this happen?
After pinning down a few basics of LUA, I tried to compose a code that would duplicate this effect. After all, I'm sure we'd all love to use a grappling hook in our maps!
Here's the code (so far), where "grapple_target" is the name of the object's ODF. The object is, for now, a destructable prop placed in ZE. "rep_inf_grapple" is the ODF name of the grappling hook weapon. For the purpose of testing, I just copied the republic stock EMP launcher, toned down it's damage, and renamed it (odf, ord, and exp).
Hidden/Spoiler:
Still, I get a CTD right after loading the map. The only Severity: 3, shown below, apparently has nothing to do with the LUA or the weapon.
Hidden/Spoiler: