Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Newton and Unity LUA scripting

Author
Message
monotonic
19
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 25th Apr 2006 22:18
Hi ppl,
I've just ordered Unity LUA and the project I'am working on relies on newton heavily, I was just wondeing if there is anyone out there that has used newton and unity together and if there is any problems with moving stuff around in the physics world etc?

Fornit some fornus.
BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 25th Apr 2006 23:35
You wouldn't use Unity to move your objects. Newton performs that task. However, you might use Lua to script consequences. For example, you might call a Lua function every time a collision with your character occurs, to determine how he will respond.

You need to play with Lua to work out where it will become useful. The more you play, the more useful you will find it



monotonic
19
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 25th Apr 2006 23:46
Oh right, its just I was thinking, say if made my enemy A.I in lua and I wanted to turn the enemy to face the player, in newton I would have to add omega force to turn the entity, so in my lua script would I have to create a list of actions to perform and parse this list when execution returned to dbpro. I just wanted to know if anybody had played with this before I'm not being lazy

Fornit some fornus.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 26th Apr 2006 20:54
Quote: "Oh right, its just I was thinking, say if made my enemy A.I in lua and I wanted to turn the enemy to face the player, in newton I would have to add omega force to turn the entity, so in my lua script would I have to create a list of actions to perform and parse this list when execution returned to dbpro. I just wanted to know if anybody had played with this before I'm not being lazy "


Sounds good, it's always best to separate your logic from your actual implementation code. Reason being, if you suddenly wanted to change how something acted instead of having to go through every single consequence in your script and edit the code, you can just find the relevant action in your DBPro code and change it there

monotonic
19
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 26th Apr 2006 21:56
Yeah that sounds like the right way to go thanks, can't wait to get stuck into lua scripting the engine I'm working on at the minute will rely quite a lot on scripting because I want it to be easily 'mod-able' in mulitplayer.

Fornit some fornus.
BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th Apr 2006 21:59
In that scenario, I would suggest that the outcome of your Lua decision-making function is "attack nearest enemy", "attach enemy 3" or "run like the wind". The engine would then follow the necessary process to turn the player.



monotonic
19
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 26th Apr 2006 22:08
Thanks for the input guys, I think I'm gonna get some engine planning done while I wait for my order

Fornit some fornus.

Login to post a reply

Server time is: 2025-06-25 17:31:56
Your offset time is: 2025-06-25 17:31:56