PDA

View Full Version : Exception every time I try to move stuff



cpury
02-26-2007, 08:49 AM
Hi there!

Everytime I call something like AddAproach in my own games, I get a strange exception:

http://img223.imageshack.us/img223/9112/novashellvb5.th.jpg (http://img223.imageshack.us/my.php?image=novashellvb5.jpg)

btw the screen is German but I think you know what it says ;)

It happens when I call this:GetGoalManager():AddApproach(...); or similar stuff that tries to move entities. I tried with two versions of Novashell (currently the newest) and I also tried to use player scripts from the examples in my own games and I also followed the (new) tutorial step by step, but nothing helped.

Since the examples work on my machine it seems I do some stuff wrong, but I'd really like to know what :)

Hope someone can help, thanks! :D

Seth
02-26-2007, 11:40 AM
Hmm, I just tried playing with it and it seems ok here - I did put up new builds a few hours ago, did you try with that?

If it's still broken please attach a .zip with your world that demonstrates it, I'm sure I can fix it then.

It should never crash, even with bad input/no base brain initialized, so I really want to fix it.

cpury
02-26-2007, 01:48 PM
Ahhh I'm sorry, it was my stupidity xD I installed the new version this morning, but to a different location, while not updating the shortcut and so I still used the old version... I'm so sorry :rolleyes:

well, with the new version the bug is fixed :)

but I have a question: You use this:SetIsCreature(true); in the new tutorials, but neither it is documented nor it is implemented (I get console errors), maybe you should update the tutorial? :)

thanks for your help anyways! :D






EDIT

ahhh new bug, this time with the new version! I fixed it myself but it's still a bug :D

I accidently wrote elseif in one of my scripts, as a result, novashell crashed everytime it tried to parse the script, e.g. when clicking new or edit in the menu. it didn't even show any error, just quit without saying anything xD

maybe you can fix it :)

Seth
02-26-2007, 10:35 PM
Entity:SetIsCreature is now documented here (http://www.rtsoft.com/novashell/docs/api/files/EntityBindings-cpp.html#Entity.SetIsCreature).

It shouldn't be giving console errors!


accidently wrote elseif in one of my scripts, as a result, novashell crashed everytime it tried to parse the script, e.g. when clicking new or edit in the menu. it didn't even show any error, just quit without saying anything xD

Hmm, can you post the exact script that you used that caused the error? :eek:

cpury
02-27-2007, 03:33 PM
1. this:setcreature thingy:
here are the console errors I get when I use this:SetIsCreature(true); :
http://img170.imageshack.us/img170/4638/consolehp2.th.jpg (http://img170.imageshack.us/my.php?image=consolehp2.jpg)
Maybe I misunderstood the message? :confused:

2. elseif crash:
well, i just realized that the problem wasn't actually the elseif but that I forgot the "then" key word. just try "elseif (...) ... end" without then and it should crash. if not, I'll post my whole code.

3. Another odd thing:

if(ent:FunctionExists("Talk")) then
this:GetGoalManager():RemoveAllSubgoals();
this:GetGoalManager():AddApproach(ent:GetID(), C_DISTANCE_TALK);
this:GetGoalManager():AddSay("Hi there!", C_FACING_NONE);
this:GetGoalManager():AddRunScriptString("GetEntityByID(" .. ent:GetID() .. "):RunFunction('Talk');");
end

The player approaches the target, then, instead of directly continueing with his goals, he waits for like 3 seconds and then continues (saying hi and run the talk function)...

when I remove the approach goal, he instantly talks with the entity, without waiting, so it must be a problem with the approach goal?

sorry for the work I cause you, but I think it's good bugfixing :D
thanks!

Seth
02-28-2007, 02:43 AM
Hmm, this:SetIsCreature(true) definitely works on the latest version, how sure are you that you're running the latest? Try running the .exe directly, instead of double clicking a .novashell file in case the file association is wrong.

I should really modify it show the build date at startup to make it a little clearer.

I played with Approach using this code:


this:GetGoalManager():AddApproach(GetEntityByName("Player"):GetID(), C_DISTANCE_TALK);
this:GetGoalManager():AddSay("All done", C_FACING_NONE);


and there are no weird delays, if this still happens on the latest version perhaps you could attach or email me your "world" that shows the problem? Then I'm sure I could fix it.

Thanks!!

cpury
02-28-2007, 12:07 PM
ok, well, I downloaded my version on 26/2 but it was still the build from 25/2, maybe I was too early xD SetIsCreature is implemented since 26/2, so it's working now :)

The approach lag is still there, so I attached my world files. The problem is in player.lua (LeftMouseClick()) and/or in Dragon.lua (Talk()). I hope you can fix it :)

thanks for your help so far

max

Seth
02-28-2007, 12:46 PM
Hmm, I don't see any approach lag?? If I click on the dragon the player walks up to the dragon (well, as long as he didn't move too far away..) and says his lines without a delay.

Am I missing something here?

Some other issues though:

1. If you double click to choose a choice, that click is passed to the script, which things he clicked on the map to move which isn't good. I'll fix that.. for now should probably set it up to ignore mouse clicks until the conversion is over or something.

2. After you click on the dragon, he should probably be told to stop moving so the player doesn't have to work so hard to catch him

cpury
02-28-2007, 09:08 PM
Hmm, that's odd, then it's maybe on my machine only... But it's no ordinary lag, graphics and system work fine during the lag, it seems more like a hidden Delay LUA adds :confused:

Well, I redid my whole project today and for now I removed the approach and let the player talk directly.

btw everytime I'm making a general LUA syntax error (like forgetting then, end, etc.) Novashell completely crashes without any error message. Though the error is in the log file it should at least show some kind of error message, shouldn't it? :)

Thanks for all your help, I'll try to stop annoying you for at least some time :D
I'm looking forward to many good updates which make this awesome tool even better! Thanks for all your work! :)

Seth
03-01-2007, 11:26 AM
Thanks, please download the latest version, lua syntax errors no longer will crash the system. I had a bug where even after the syntax error it would try to run the script.. whups!