Why does this script crash the game

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
hades200082
Posts: 14
Joined: Sun Feb 24, 2013 5:49 pm

Why does this script crash the game

Post by hades200082 »

When the script below executes it crashes the game in the editor preview ... no warnings/errors .. just stops.

I'm probably missing something really obvious here but I just can't see why it's crashing. Any help is appreciated.

Code: Select all

function AwardXp(XpToAward)
	XpToAward = math.floor((XpToAward / 4) + 0.5)
	party:getChampion(1):gainExp(XpToAward)
	party:getChampion(2):gainExp(XpToAward)
	party:getChampion(3):gainExp(XpToAward)
	party:getChampion(4):gainExp(XpToAward)
end
Level = 2
XP = 100 * Level
AwardXP(XP)
Edit: Just to note... the AwardXp function works when used elsewhere.
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Why does this script crash the game

Post by Neikun »

Is your end in the wrong place?
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
Vice Dellos
Posts: 47
Joined: Thu Feb 28, 2013 12:56 pm

Re: Why does this script crash the game

Post by Vice Dellos »

should it maybe be "local level = 2"?
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: Why does this script crash the game

Post by Xanathar »

I didn't try.
But I would bet my 1€ on "AwardXP" - that is, the P in AwardXp is written once lower-case and the other upper-case. I wouldn't bet more than 1€ though ;)
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
User avatar
Vice Dellos
Posts: 47
Joined: Thu Feb 28, 2013 12:56 pm

Re: Why does this script crash the game

Post by Vice Dellos »

ugh I hate having to watch caps
hades200082
Posts: 14
Joined: Sun Feb 24, 2013 5:49 pm

Re: Why does this script crash the game

Post by hades200082 »

Xanathar wrote:I didn't try.
But I would bet my 1€ on "AwardXP" - that is, the P in AwardXp is written once lower-case and the other upper-case. I wouldn't bet more than 1€ though ;)
That was it! Ugh that sucked up hours!

Thank you so much for helping. Thanks to all the others that replied too. I never fail to be amazed by how helpful this community is :)
Post Reply