Novahq.net Forum

Novahq.net Forum (https://novahq.net/forum/index.php)
-   Web design and Programming (https://novahq.net/forum/forumdisplay.php?f=32)
-   -   LUA scripters? (https://novahq.net/forum/showthread.php?t=47941)

City Ace 06-28-2016 06:59 AM

LUA scripters?
 
I guess you all know about C++ scripts. But any guys here who are familiar with LUA?

Guest001 06-28-2016 10:06 AM

:boxer:


Code:

function hurtplayer(e)
Detect = PlyrDist(e)
Health = Health(e)
 
if Detect < 100 then
Health(-1)
end

end


Guest001 06-28-2016 10:36 AM

Add a counter to trigger

Code:

InjuryCount=0

function hurtplayer(e)
Detect = PlyrDist(e)
Health = Health(e)

if Detect < 100 then
Health(-1)
InjuryCount=InjuryCount+1
end

if Health > 1 and InjuryCount==5 then
action(e,1)
end

end

Works with any engine that reads LUA, all you need is an IDE (or code editor like Notepad++) find the syntax for the engine functions and away you go with your own scripts.

City Ace 06-28-2016 10:43 AM

Hey, you know LUA? Is it similar to C++?

Guest001 06-28-2016 10:57 AM

Quote:

Originally Posted by City Ace (Post 385664)
Hey, you know LUA? Is it similar to C++?

LUA is easier and been around longer AFIK

City Ace 06-28-2016 11:02 AM

Yis. LUA is a easy language.

Guest001 06-28-2016 11:10 AM

I'm no expert, having limited time in this field but as I've come to understand it, it's like a universal secondary layer of control.

For instance, once a game engine's been compiled in C# or C++ you can modify it with LUA (if incorporated) without recompiling the whole thing.

Guest001 06-28-2016 12:17 PM

I'm a prankster :insane:

Yeperoony. :rofl::run:

:dontknow:

Here's the correct version. :read:

Code:

InjuryCount=0

function hurtplayer(e)
Detect = PlyrDist(e)
Health = Health(e)

if Detect < 100 and InjuryCount<=5 then
Health(-1)
InjuryCount=InjuryCount+1
else
Health > 1 and InjuryCount==5 then
action(e,1)
end

end


Guest001 06-28-2016 12:41 PM

The above is an example of the sort of error(s) an IDE might not pick up, so debugging code can still be reliant on a sharp eye. :cool2:

Guest001 06-28-2016 01:09 PM

Quote:

Originally Posted by City Ace (Post 385664)
Is it similar to C++?

BTW I know next to nothing about C++ but I imagine it's similar in structure to a lot of programming languages and still uses Boolean as a basis for it's logic structure but is more complex than any other that I know of.

I don't think it was created from scratch, it's an ancestor of a previous language like basic or C# I think.

Perhaps you know more about that than I do.

City Ace 06-29-2016 02:44 AM

I know nothing bout the C family of programming language :V And i dont even wanna learn it. It is so tough and booooooooring. LUA is a way way way way better for me at least!

Ralphort 07-16-2016 01:54 PM

Stompen & City Ace, wondering if u can help me. I got this old BHD stat uploader for Neos Chronos v1.9.0. It's written in LUA script. I can't seem to make it work. It won't upload stats. I got this message...

Quote:

Uploading server status to https://www.mywebsite.net/module/Neos_Chronos/
HTTP/1.1 200 OK
server = "nginx"
connection = "close"
content-type = "text/html; charset=UTF-8"
date = "Wed..."
vary = "Accept-Encoding"
No data sent
I tried several fixes including changing the HTTP backend server in my Synology DS214play NAS web server from Nginx to Apache to editing some LUA files without any luck.

The uploader file you can download here.

City Ace 07-22-2016 08:26 AM

I have no idea of it ;___;

Guest001 07-23-2016 02:54 PM

Quote:

Originally Posted by City Ace (Post 385676)
I know nothing bout the C family of programming language :V And i dont even wanna learn it. It is so tough and booooooooring. LUA is a way way way way better for me at least!

What makes the MEd so great is it really is fun in it's way, mainly because it's visual and it's not all booooooooring like C or as complex as LUA script either.


All times are GMT -5. The time now is 07:11 AM.

Powered by vBulletin®