Go Back   Novahq.net Forum > Computers > Web design and Programming

Web design and Programming Discuss website creation and other programming topics.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-28-2016, 06:59 AM
City Ace is offline City Ace
City Ace's Avatar
Registered User

Join Date: Dec 2014
Location: 404 Not Found
Posts: 203

Biggrin LUA scripters?

I guess you all know about C++ scripts. But any guys here who are familiar with LUA?
Reply With Quote
  #2  
Old 06-28-2016, 10:06 AM
Guest001 is offline Guest001
Registered User

Join Date: Aug 2008
Posts: 4,971




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

end

Last edited by Guest001; 06-28-2016 at 10:56 AM.
Reply With Quote
  #3  
Old 06-28-2016, 10:36 AM
Guest001 is offline Guest001
Registered User

Join Date: Aug 2008
Posts: 4,971

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.

Last edited by Guest001; 06-28-2016 at 10:56 AM.
Reply With Quote
  #4  
Old 06-28-2016, 10:43 AM
City Ace is offline City Ace
City Ace's Avatar
Registered User

Join Date: Dec 2014
Location: 404 Not Found
Posts: 203

Hey, you know LUA? Is it similar to C++?
Reply With Quote
  #5  
Old 06-28-2016, 10:57 AM
Guest001 is offline Guest001
Registered User

Join Date: Aug 2008
Posts: 4,971

Quote:
Originally Posted by City Ace View Post
Hey, you know LUA? Is it similar to C++?
LUA is easier and been around longer AFIK
Reply With Quote
  #6  
Old 06-28-2016, 11:02 AM
City Ace is offline City Ace
City Ace's Avatar
Registered User

Join Date: Dec 2014
Location: 404 Not Found
Posts: 203

Yis. LUA is a easy language.
Reply With Quote
  #7  
Old 06-28-2016, 11:10 AM
Guest001 is offline Guest001
Registered User

Join Date: Aug 2008
Posts: 4,971

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.
Reply With Quote
  #8  
Old 06-28-2016, 12:17 PM
Guest001 is offline Guest001
Registered User

Join Date: Aug 2008
Posts: 4,971

I'm a prankster

Yeperoony.



Here's the correct version.

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
Reply With Quote
  #9  
Old 06-28-2016, 12:41 PM
Guest001 is offline Guest001
Registered User

Join Date: Aug 2008
Posts: 4,971

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.
Reply With Quote
  #10  
Old 06-28-2016, 01:09 PM
Guest001 is offline Guest001
Registered User

Join Date: Aug 2008
Posts: 4,971

Quote:
Originally Posted by City Ace View Post
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.
Reply With Quote
  #11  
Old 06-29-2016, 02:44 AM
City Ace is offline City Ace
City Ace's Avatar
Registered User

Join Date: Dec 2014
Location: 404 Not Found
Posts: 203

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!
Reply With Quote
  #12  
Old 07-16-2016, 01:54 PM
Ralphort
Unregistered

Posts: n/a

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.
Reply With Quote
  #13  
Old 07-22-2016, 08:26 AM
City Ace is offline City Ace
City Ace's Avatar
Registered User

Join Date: Dec 2014
Location: 404 Not Found
Posts: 203

I have no idea of it ;___;
Reply With Quote
  #14  
Old 07-23-2016, 02:54 PM
Guest001 is offline Guest001
Registered User

Join Date: Aug 2008
Posts: 4,971

Quote:
Originally Posted by City Ace View Post
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.

Last edited by Guest001; 07-24-2016 at 12:25 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:52 AM.




Powered by vBulletin®