|
Author | Message |
---|
Zoyarox Craszen Sergeant
Messages : 41 Registration Date : 2015-07-14
| Subject: How? - Advanced LUA 7/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? |
|
| |
razac920 PFC
Messages : 22 Registration Date : 2013-08-05 Age : 32 Location : Philadelphia, Pennsylvania, USA
| Subject: Re: How? - Advanced LUA 8/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) |
|
| |
Zoyarox Craszen Sergeant
Messages : 41 Registration Date : 2015-07-14
| Subject: Re: How? - Advanced LUA 8/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 - 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 :/ |
|
| |
razac920 PFC
Messages : 22 Registration Date : 2013-08-05 Age : 32 Location : Philadelphia, Pennsylvania, USA
| Subject: Re: How? - Advanced LUA 8/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. |
|
| |
Zoyarox Craszen Sergeant
Messages : 41 Registration Date : 2015-07-14
| Subject: Re: How? - Advanced LUA 8/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! |
|
| |
razac920 PFC
Messages : 22 Registration Date : 2013-08-05 Age : 32 Location : Philadelphia, Pennsylvania, USA
| Subject: Re: How? - Advanced LUA 8/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. |
|
| |
Zoyarox Craszen Sergeant
Messages : 41 Registration Date : 2015-07-14
| Subject: Re: How? - Advanced LUA 8/8/2015, 1:28 pm | |
| Ahh okay, thank you very much!!! |
|
| |
Sponsored content
| Subject: Re: How? - Advanced LUA | |
| |
|
| |
|