Think I've run into a new problem ...

Get some help with creating maps or modding.
Need a map editor or other tools, look here!
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base

Think I've run into a new problem ...

Post by Goth Zagog-Thou »

Working on the Campaign 4 scripts, and I've run into an issue that has me climbing the walls.

I've got new build events for the Scavenger VTOL Factories. The crash error is:

Code: Select all

error   |03:56:21: [scr_error:5703] script parse error:
'Event ToWorld declared without being defined' at Main.slo:3616
Token: 330, Text: 'ScavsBuildChoppersA1'
I don't have any events (glitched or otherwise) called ToWorld. And yes, I've looked. HARD.

Is there a limit to how many lines can be in a Campaign script? What I'm starting to think is happening is that the script interpreter is getting overloaded and mashing the code up.

The code that it's complaining about is:

Code: Select all

// New Scavenger VTOL Events (yay!)
ScavsBuildChoppersA1(inactive)
{
	if (ScavVTOLFacA1 == NULLOBJECT)
	{
		setEventTrigger(ScavsBuildChoppersA1, inactive);
	}
	else
	{
		buildDroid(Chopper1, ScavVTOLFacA1, ScavBasePlayer, 1);
		pause(120);
		buildDroid(Chopper2, ScavVTOLFacA1, ScavBasePlayer, 1);
		pause(120);
		buildDroid(HeavyChopper, ScavVTOLFacA1, ScavBasePlayer, 1);
	}
}
That's why I'm concerned as to the cause. Any help would be sincerely appreciated. I should also note that the error didn't occur until I assigned build events. When I loaded the map up beforehand, it worked fine.
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: Think I've run into a new problem ...

Post by aubergine »

ToWorld is likely a C++ function that converts from tile to world coordinates?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Think I've run into a new problem ...

Post by Per »

All I know is that there are hard-coded limits of 300 functions/events and 300000 instructions, but I'm not sure if that is for each context, each call, or each... something else.
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base

Re: Think I've run into a new problem ...

Post by Goth Zagog-Thou »

Well yes, I'm using the ToWorld function that Milo made .. but I'm not using it in the event or anything attached to the event at all.

It's gotta be one of my typos.
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base

Re: Think I've run into a new problem ...

Post by Goth Zagog-Thou »

Looks like it's the hard limit of 300 events. I comment out the six ScavVTOLBuild events (and their declarations at the front) and the code runs without issue.

I'm gonna have to split M1 and M4 up after all, from the looks of things. I still have to assign attack events for the Scav Choppers, and it was going to be something different and creative.
User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

Re: Think I've run into a new problem ...

Post by Rman Virgil »

Goth Zagog-Thou wrote:Looks like it's the hard limit of 300 events. I comment out the six ScavVTOLBuild events (and their declarations at the front) and the code runs without issue.

I'm gonna have to split M1 and M4 up after all, from the looks of things. I still have to assign attack events for the Scav Choppers, and it was going to be something different and creative.
Wonder what the downside to lifting the hard limit on events would be ?
.
.

Impact = C x (R + E + A + T + E)

Contrast
Reach
Exposure
Articulation
Trust
Echo
.
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base

Re: Think I've run into a new problem ...

Post by Goth Zagog-Thou »

Rman Virgil wrote:
Goth Zagog-Thou wrote:Looks like it's the hard limit of 300 events. I comment out the six ScavVTOLBuild events (and their declarations at the front) and the code runs without issue.

I'm gonna have to split M1 and M4 up after all, from the looks of things. I still have to assign attack events for the Scav Choppers, and it was going to be something different and creative.
Wonder what the downside to lifting the hard limit on events would be ?
.
Decreased performance.

It's okay. I can import what I need into the scripts and do some major retooling at the same time. I've already found a lot of things I can be doing better as it is -- starting with getting more organized. :D
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base

Re: Think I've run into a new problem ...

Post by Goth Zagog-Thou »

... and I see the problem now. :oops:

Leave it to me to have something SO simple wrong that causes so much grief.

*sigh* gotta love dyslexia / reading dysfunction. :annoyed:
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: Think I've run into a new problem ...

Post by aubergine »

At least you don't have short-term memory loss, combined with long-term memory loss ... and medium-term memory loss. I have to document everything I learn about the scripting environment just to remember what I'm doing heh.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO