Small Scripting issue (Icepick you need your own forum!!!)

Talk about your new mod or map here

Moderators: jelco, bert_the_turtle

Gimpstarr
level0
Posts: 8
Joined: Wed Sep 15, 2004 3:12 pm

Small Scripting issue (Icepick you need your own forum!!!)

Postby Gimpstarr » Tue Mar 15, 2005 6:31 pm

Hey all, glad to see some people working on fresh levels and game styles! Also reassuring to note this is the least active room in the forum, means my mod won't have so much competition!!

My problem is that while the in-game level editor etc is all groovy, I can't get my scripting to work. If I may I'll paste my code in here and I'm sure the first viewer will pick up on the obvious mistake I'm making.

Game.txt:

Locations_StartDefinition
# Id Avail mapFile missionFile
# ==================================================================
0 1 map_newlevel.txt mission_newlevel.txt
Locations_EndDefinition

Buildings_StartDefinition
# Id teamId locId type link online
# =======================================
Buildings_EndDefinition

Research_StartDefinition
Research Darwinian 0 2
Research Officer 0 2
Research Squad 0 2
Research Laser 0 2
Research Grenade 0 2
Research Rocket 0 2
Research Controller 0 2
Research AirStrike 0 2
Research Armour 0 2
Research TaskManager 0 2
Research Engineer 0 2
CurrentResearch Squad
CurrentPoints 0
Research_EndDefinition

Events_StartDefinition
Event BuildingOnline:map_newlevel.txt,5
Action RunScript CamScript.txt
End

Events_EndDefinition


So that's basically calling my camscript when the building comes online...

CamScript.txt:

CamMove pos2 5
CamReset


and that should move the camera a bit. I'm guessing the problem isn't in the camscript, since it's simpler, but I'll be damned if I know what's wrong. If there were more mods about I could try and test the problem in them, but for lack of that or any kind of debugger, I'm stuck.

Also, if it's impossible to employ the text script for yourself, would it not be possible to simply edit an existing campaign text script and use that?
User avatar
Stormchild
level2
level2
Posts: 131
Joined: Thu Mar 06, 2003 12:03 am
Location: 127.0.0.1
Contact:

Postby Stormchild » Tue Mar 15, 2005 6:45 pm

Event BuildingOnline:map_newlevel.txt,5

Should be:

Event BuildingOnline:0,5

You use the ID of the location (as shown in game.txt) not the map name.
= Registered Uplink Agent =
Gimpstarr
level0
Posts: 8
Joined: Wed Sep 15, 2004 3:12 pm

Postby Gimpstarr » Tue Mar 15, 2005 8:45 pm

No joy, besides, I've seen working scripts that use the building name. I really don't know where Ive messed up, must be something really silly, but without a proper compiler or anything there's no way to knwo where!!!!!!!!!!!!!!!!!!!!!!!
User avatar
LLamaBoy
level5
level5
Posts: 1627
Joined: Sun Aug 18, 2002 12:18 pm
Location: Cyprus
Contact:

Postby LLamaBoy » Tue Mar 15, 2005 9:03 pm

I think it may be your camscript - try putting a "Wait 5" after "CamMove pos2 5". If what I'm suspecting is right, what's happening is it's executing the CamMove instruction and immediately resetting the camera, so it looks like nothing is happening.
Gimpstarr
level0
Posts: 8
Joined: Wed Sep 15, 2004 3:12 pm

Postby Gimpstarr » Tue Mar 15, 2005 9:18 pm

Still no luck. CamScript doesn't run no matter what, won't even work with a CamFocus or anything. I guess this is too tricky to solve without access to my pc.

Bitch.
User avatar
Stormchild
level2
level2
Posts: 131
Joined: Thu Mar 06, 2003 12:03 am
Location: 127.0.0.1
Contact:

Postby Stormchild » Tue Mar 15, 2005 10:07 pm

Looking at the original games scripts, they use:

BuildingOnline :<mapname>,<id>

If your map file is map_newlevel.txt then mapname is newlevel, thus:

BuildingOnline :newlevel,<id>
= Registered Uplink Agent =
Icepick
level5
level5
Posts: 7528
Joined: Wed Oct 24, 2001 10:29 pm
Location: Bradford, England

Postby Icepick » Thu Mar 17, 2005 12:09 pm

Thats correct, scripts use the name of the map itself, not the map filename. So basically, everything stormchild just said :)

http://thenextgame.co.uk/modguide/index.php?p_id=14
Gimpstarr
level0
Posts: 8
Joined: Wed Sep 15, 2004 3:12 pm

Postby Gimpstarr » Thu Mar 17, 2005 12:33 pm

Still no luck!! This is so bleeding annoying without some kinda debugger or compiler to show where the script stops running. Thanks for all your help guys!

Is there some clever way I can test whether the problem is in Game.txt or the CamScript? Some other script command? Is it possible I've just got some silly option turned on/off or not reloaded the mod or something daft?
Icepick
level5
level5
Posts: 7528
Joined: Wed Oct 24, 2001 10:29 pm
Location: Bradford, England

Postby Icepick » Thu Mar 17, 2005 2:10 pm

Post the current version of the script and I'll take a look, its hard to know what you've got now after all the changes.
Gimpstarr
level0
Posts: 8
Joined: Wed Sep 15, 2004 3:12 pm

Postby Gimpstarr » Thu Mar 17, 2005 3:33 pm

Cheers

Game.txt


Locations_StartDefinition
# Id Avail mapFile missionFile
# ==================================================================
0 1 map_newlevel.txt mission_newlevel.txt
Locations_EndDefinition

Buildings_StartDefinition
# Id teamId locId type link online
# =======================================
Buildings_EndDefinition

Research_StartDefinition
Research Darwinian 0 2
Research Officer 0 2
Research Squad 0 2
Research Laser 0 2
Research Grenade 0 2
Research Rocket 0 2
Research Controller 0 2
Research AirStrike 0 2
Research Armour 0 2
Research TaskManager 0 2
Research Engineer 0 2
CurrentResearch Squad
CurrentPoints 0
Research_EndDefinition

Events_StartDefinition
Event BuildingOnline :newlevel,5
Action RunScript CamScript.txt
End

Events_EndDefinition



CamScript:


CamMove pos2 5
WaitCam 3
User avatar
Stormchild
level2
level2
Posts: 131
Joined: Thu Mar 06, 2003 12:03 am
Location: 127.0.0.1
Contact:

Postby Stormchild » Thu Mar 17, 2005 7:17 pm

Just a thought: Is building 5 dynamic and/or global? I've had some issues with the game not recognising the online status of buildings if they aren't one or the other (can't remember which)
= Registered Uplink Agent =

Return to “Mod Projects”

Who is online

Users browsing this forum: No registered users and 3 guests