SWBF CUSTOM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

SWBF CUSTOM

The best way to custom your games.
 
HomeLatest imagesSearchRegisterLog in

Share
 

 How? - Advanced LUA

View previous topic View next topic Go down 
AuthorMessage
Zoyarox Craszen
Sergeant
Sergeant
Zoyarox Craszen

Messages : 41
Registration Date : 2015-07-14

How? - Advanced LUA Empty
PostSubject: How? - Advanced LUA   How? - Advanced LUA I_icon_minitime7/23/2015, 9:22 pm

https://www.youtube.com/watch?v=fQZN5VUy1uQ

I'm curious about how he did that? He said he did some stuff in the LUA.
Anyone some ideas? Maybe just basics or so, for a start?
Back to top Go down
razac920
PFC
PFC
razac920

Messages : 22
Registration Date : 2013-08-05
Age : 32
Location : Philadelphia, Pennsylvania, USA

How? - Advanced LUA Empty
PostSubject: Re: How? - Advanced LUA   How? - Advanced LUA I_icon_minitime8/8/2015, 2:04 am

Well you could just ask him over at Gametoast :P
But as he says in the video title, he is using OnFlagPickup, and I imagine he just checks the class of the unit who picks up the flag, and if it is not the right one, he kills it and respawns it at the same location.

A possible script could be: (minus the checking of class)

OnFlagPickup(function(flag,character)
loc = GetEntityMatrix(GetCharacterUnit(character))
KillObject(GetCharacterUnit(character))
SpawnCharacter(character,loc)
end)
Back to top Go down
Zoyarox Craszen
Sergeant
Sergeant
Zoyarox Craszen

Messages : 41
Registration Date : 2015-07-14

How? - Advanced LUA Empty
PostSubject: Re: How? - Advanced LUA   How? - Advanced LUA I_icon_minitime8/8/2015, 7:52 am

Thanks for your reply!

razac920 wrote:
Well you could just ask him over at Gametoast :P
Oh, I will probably do that Very Happy

razac920 wrote:
But as he says in the video title, he is using OnFlagPickup, and I imagine he just checks the class of the unit who picks up the flag, and if it is not the right one, he kills it and respawns it at the same location.

A possible script could be: (minus the checking of class)

OnFlagPickup(function(flag,character)
loc = GetEntityMatrix(GetCharacterUnit(character))
KillObject(GetCharacterUnit(character))
SpawnCharacter(character,loc)
end)
Sadly, I have never used/seen any of these. I'm not a pro-modder at all yet, but I want to become one and learn all that stuff, because I have no idea where to add these lines and get them to work :/
Back to top Go down
razac920
PFC
PFC
razac920

Messages : 22
Registration Date : 2013-08-05
Age : 32
Location : Philadelphia, Pennsylvania, USA

How? - Advanced LUA Empty
PostSubject: Re: How? - Advanced LUA   How? - Advanced LUA I_icon_minitime8/8/2015, 12:13 pm

Oh, just stick them in your mission script ([mapname][era]_[mode].lua), for example, TSTg_con.lua, found at data_XXX/Common/scripts/XXX, and just copy and paste those lines in function postLoad section, for example, under the conquest:start line.
Back to top Go down
Zoyarox Craszen
Sergeant
Sergeant
Zoyarox Craszen

Messages : 41
Registration Date : 2015-07-14

How? - Advanced LUA Empty
PostSubject: Re: How? - Advanced LUA   How? - Advanced LUA I_icon_minitime8/8/2015, 1:06 pm

Ohh okay, I'm aware of the lua files (at least of con)! So basically everything about the gamefunction happens in there, nowhere else? And do empty lines matter in the LUA and f.ex. a weapon's ODF? It's a thing I'm always afraid of ruining the file xD

Thank you very much! Havn't tried if it works (no CTF map, yet) but I got it and you helped me!
Back to top Go down
razac920
PFC
PFC
razac920

Messages : 22
Registration Date : 2013-08-05
Age : 32
Location : Philadelphia, Pennsylvania, USA

How? - Advanced LUA Empty
PostSubject: Re: How? - Advanced LUA   How? - Advanced LUA I_icon_minitime8/8/2015, 1:27 pm

No, blank lines and empty spaces don't matter to the LUA compiler, they're only there for convenience to help organize/read it. The only thing about blank lines is they don't count to the line count, so debugging can be a bit more tricky if the compiler/game log tells you there is a crash on line 91, for example.
Back to top Go down
Zoyarox Craszen
Sergeant
Sergeant
Zoyarox Craszen

Messages : 41
Registration Date : 2015-07-14

How? - Advanced LUA Empty
PostSubject: Re: How? - Advanced LUA   How? - Advanced LUA I_icon_minitime8/8/2015, 1:28 pm

Ahh okay, thank you very much!!!
Back to top Go down
Sponsored content




How? - Advanced LUA Empty
PostSubject: Re: How? - Advanced LUA   How? - Advanced LUA I_icon_minitime

Back to top Go down
 

How? - Advanced LUA

View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
SWBF CUSTOM :: Star Wars Battlefront Games :: Modding-