Two quick lua mishaps [Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Two quick lua mishaps [Solved]

Post by Noobasaurus »

Not really lua mishaps, but they both involve it.

Firstly, I've removed a line from one of my functions in my lua that teleports one person to another when something happens. However, when that something happens, the person is still teleported. The line that makes it happen does not exist. I've just done a manual clean and nothing has changed.

Secondly, I'm trying to create an effect on a person. Everything works fine except that I get this error when it happens.

Code: Select all

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(4519)
Effect class "com_sfx_blue" not found
I've loaded that effect through the world's effects folder, the sides' effects folders, and through common's effects folder using ingame.lvl. And it just doesn't want to show up. Here's how I'm spawning it.

Code: Select all

				AttachEffectToMatrix(CreateEffect("com_sfx_blue"), GetEntityMatrix(object))
Help is greatly appreciated.
Last edited by Noobasaurus on Tue Jul 22, 2014 11:42 am, edited 1 time in total.
User avatar
Locutus
1st Lieutenant
1st Lieutenant
Posts: 420
Joined: Fri Jun 04, 2010 10:08 am
Projects :: Stargate Battlefront Pegasus
Location: Germany
Contact:

Re: Two quick lua mishaps

Post by Locutus »

If you want to have help with the first issue I think it is necessary that you provide more information/showing the function.

Regarding your second issue, well, the code looks correct. I've also used this command and got the same error until I noticed that I forgot to add the effect to my MAP.req (was loading the effect in my world1 folder). Now, I don't think theres any difference between loading an effect through the world req or the ingame level but are you sure you added the name of your effect in the config section of your ingame.req?
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Two quick lua mishaps

Post by Noobasaurus »

Thanks. The second problem is solved now, I only had the effects in "texture" and not "config."

Here's the part of the lua where it used to be.

Code: Select all

	scanner = OnObjectDamage(function(object, damager)
		if GetObjectLastHitWeaponClass(object) == "imp_weap_inf_scanner" and GetObjectTeam ~= 0 then
			if GetObjectTeam(object) == 2 then
				AttachEffectToMatrix(CreateEffect("com_sfx_red"), GetEntityMatrix(object))
			end
			if GetObjectTeam(object) == 3 then
				AttachEffectToMatrix(CreateEffect("com_sfx_blue"), GetEntityMatrix(object))
			end
			if GetObjectTeam(object) == 1 then
				AttachEffectToMatrix(CreateEffect("com_sfx_red"), GetEntityMatrix(object))
			end
		end
    end)
So basically when I hit them with a weapon it teleports them to me and makes them float a bit. That's not what I want. I've searched through the entire thing and there aren't any more lines that could make it happen.
User avatar
Locutus
1st Lieutenant
1st Lieutenant
Posts: 420
Joined: Fri Jun 04, 2010 10:08 am
Projects :: Stargate Battlefront Pegasus
Location: Germany
Contact:

Re: Two quick lua mishaps

Post by Locutus »

Hmm, I don't see any teleporting code in that function :p
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Two quick lua mishaps

Post by Noobasaurus »

WAIT. Nevermind, solved. It was the weapon the whole time. It didn't teleport the person anymore but it still choked them, and the choking part was the actual weapon.
Post Reply