View unanswered posts | View active topics It is currently Sat Jul 20, 2019 7:31 pm



Reply to topic  [ 8 posts ] 
 Lua script crashes game? 
Author Message
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post Lua script crashes game?
So, I'm modifying the AI Lua so my actor has a little bar over his head. This is the beginning of the script: (The rest isn't any different)



The bar floats over his head just fine. However... After a few seconds the game crashes without error. What's wrong?


Mon Sep 19, 2011 2:32 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 11418
Location: Here
Reply with quote
Post Re: Lua script crashes game?
You should check if the bar exists before setting its position.


Mon Sep 19, 2011 2:47 am
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3134
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: Lua script crashes game?
MOSParticles will automatically delete themselves after not moving for a while, even if they have a long lifetime. To work around this, you can set the MOSParticle's Age to 0 and ToDelete to false every update.


Mon Sep 19, 2011 3:01 am
Profile WWW
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post Re: Lua script crashes game?
Worked perfect. Thanks.


Mon Sep 19, 2011 3:17 am
Profile
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post Re: Lua script crashes game?
Um... The bar that floats above my head settles when I move it through the ground 1/8 of the time D:

This is the start of the lua:


And this is the ini for the bar:



I can't understand what's wrong :oops:


Mon Sep 19, 2011 4:11 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: Lua script crashes game?
And if you use a MOSRotating instead of a MOSParticle?

I did the bar thingie for a charging weapon, and I used a MOSRotating and I haven't got any problems at all.


Mon Sep 19, 2011 6:08 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 11418
Location: Here
Reply with quote
Post Re: Lua script crashes game?
Make it pinned and ToSettle = false.


Mon Sep 19, 2011 11:36 am
Profile
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post Re: Lua script crashes game?
Setting the PinStrength worked perfectly. Thanks a bunch :P


Mon Sep 19, 2011 12:12 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.018s | 13 Queries | GZIP : Off ]