Jump to content

Map script help


Evilducky

Recommended Posts

I have been working on a map for awhile now for [GR] called blackhawk_down , and I have got it to the point to where it can start. only problem is I had them spawning all the guys at once, which I didnt want but I think I fixed that, but I have a tank in there and want it to patrol a small street. so I looked at mission 11 and opened the map and look at that as well, but I cant get it to patrol the street. After looking at missions 11's script, I made mine look very close to theres and heres what I got for the main body. Now to let you know I have no programing skills at all and am trying to do this. Maybe one of you better people or a grin person can help me out. Heres my scrip of what I have so far:

	<script_data>


		<xi:include href="/data/levels/common/common.xml#xpointer(/common/*)"/>


		<!--<area_group name="area1" area_name="area1" group="mp_players" interval="0.3" condition="1"/>-->

		<area_group name="patrol01" area_name="patrol01" group="mp_players" interval="0.3" condition="1"/>

		<area_group name="patrol_tank" area_name="patrol_tank" group="mp_players" interval="0.3" condition="1"/>

		<area_group name="patrol02" area_name="patrol02" group="mp_players" interval="0.3" condition="1"/>


		<!--AREA TRIGGERS-->

		<user name="patrol01" type="once">

			<trigger type="UnitInArea" area="patrol01"/>

			<event name="patrol01"/>

		</user>


		<user name="patrol_tank" type="once">

			<trigger type="UnitInArea" area="patrol_tank"/>

			<event name="patrol_tank"/>

		</user>


		<user name="patrol02" type="once">

			<trigger type="UnitInArea" area="patrol02"/>

			<event name="patrol02"/>

		</user>



		<event name="start_game">


		</event>


		<event name="patrol01">

			<element type="ActivateGroup" group_id="patrol01" start_time="1.0"/>

			<element type="UnitInArea" area="patrol01" state="deactivate"/>

		</event>


		<event name="activate_tanks">

			<element type="ActivateVehicle" vehicle_id="patrol_tank" start_time="0.0/>

			<element type="OrderTank" vehicle_id="patrol01" ai="true" order="patrol" start_time="0.1">

				<waypoint position="-8257 3244 0"/>

				<waypoint position="8709 7217 0"/>

			</element>

		</event>


		<event name="patrol_tank">

			<element type="TriggerEvent" event="activate_tanks" start_time="0.1"/>

		</event>


		<event name="patrol02">

			<element type="ActivateGroup" group_id="patrol02" start_time="1.0"/>

			<element type="UnitInArea" area="patrol02" state="deactivate"/>

		</event>

with that one, everytime I start it, it crashes with this error:
Crash in application version: grpcrc1.30


data\levels\custom_levels\blackhawk_down\blackhawk_down.xml (59): Expected identifier


SCRIPT STACK


	data\levels\custom_levels\blackhawk_down\blackhawk_down.dsf(26)

Now w.t.f. does that mean?! these errors are WAY to vauge to help out to me. This is the only thing left that I want to do and release it to get a new map out there, but I cant get past this part. :wall::wall::wall::wall:

Ill take on any advise you guys have on to making this work.

Thanks

-Ducky-

Edited by Evilducky
Link to comment
Share on other sites

When reading error messages, the first line after crash message is important. it says what file and at what line the game crashed.

"data\levels\custom_levels\blackhawk_down\blackhawk_down.xml (59): Expected identifier"

This says that you have a error in blackhawk_down.xml on line 59, if that is your whole xml file, you have missed to end the script data tag.

begin by adding a </script_data> to the end of the file.

Link to comment
Share on other sites

This dont seem right...

<element type="OrderTank" vehicle_id="patrol01" ai="true" order="patrol" start_time="0.1">

<waypoint position="-8257 3244 0"/>

<waypoint position="8709 7217 0"/>

</element>

I could be wrong but your not telling it to move...your telling it to patrol which i dont know if that will work.

I can get vehicles to goto the first waypoint by doing this....

<element type="OrderCar" vehicle_id="panhard" order="move" position="-3301 5530 0" start_time="10.0"/>

but i cant get them to go to a second waypoint after that. We need more info on scripting and what the commands mean.

If i put this in.....

<element type="OrderCar" vehicle_id="panhard" order="move" position="-3301 5530 0" start_time="10.0"/>

<element type="OrderCar" vehicle_id="panhard" order="move" position="-3301 2073 0" start_time="15.0"/>

<element type="OrderCar" vehicle_id="panhard" order="move" position="1177 2073 0" start_time="19.0"/>

<element type="OrderCar" vehicle_id="panhard" order="move" position="1177 5530 0" start_time="24.0"/>

it just goes to the first waypoint and stops.

someone please tell me how to get them to follow a set path with multiple waypoints.

Edited by }PW{ Postal
Link to comment
Share on other sites

When reading error messages, the first line after crash message is important. it says what file and at what line the game crashed.

"data\levels\custom_levels\blackhawk_down\blackhawk_down.xml (59): Expected identifier"

This says that you have a error in blackhawk_down.xml on line 59, if that is your whole xml file, you have missed to end the script data tag.

begin by adding a </script_data> to the end of the file.

Thanks for that. I didnt know that. I had a though it was that but wasnt sure. What I posted isnt my whole script, its just part of it. Here is the WHOLE one:

<?xml version="1.0" encoding="ISO-8859-1"?>

<World>

	<!-- World -->

	<load_scene file="/data/levels/custom_levels/Blackhawk_down/Blackhawk_down.diesel" use_lightset="true" materials="/data/levels/custom_levels/Blackhawk_down/materials.xml">


		<object name="world_bb" hidden="true"/>


		<object name="room01" hidden="true"/>

		<object name="Plane01" hidden="true"/>


		<global_ambient color="60 60 40"/>


	</load_scene>


	<load_scene file="/data/objects/lens/normal_lens.diesel">

		<object name="normal_lens" hidden="true"/>

	</load_scene>

	<load_scene file="/data/objects/lens/zoom_lens.diesel">

		<object name="zoom_lens" hidden="true"/>

	</load_scene>


	<script_data>


		<xi:include href="/data/levels/common/common.xml#xpointer(/common/*)"/>


		<!--<area_group name="area1" area_name="area1" group="mp_players" interval="0.3" condition="1"/>-->

		<area_group name="patrol01" area_name="patrol01" group="mp_players" interval="0.3" condition="1"/>

		<area_group name="patrol_tank" area_name="patrol_tank" group="mp_players" interval="0.3" condition="1"/>

		<area_group name="patrol02" area_name="patrol02" group="mp_players" interval="0.3" condition="1"/>


		<!--AREA TRIGGERS-->

		<user name="patrol01" type="once">

			<trigger type="UnitInArea" area="patrol01"/>

			<event name="patrol01"/>

		</user>


		<user name="patrol_tank" type="once">

			<trigger type="UnitInArea" area="patrol_tank"/>

			<event name="patrol_tank"/>

		</user>


		<user name="patrol02" type="once">

			<trigger type="UnitInArea" area="patrol02"/>

			<event name="patrol02"/>

		</user>



		<event name="start_game">


		</event>


		<event name="patrol01">

			<element type="ActivateGroup" group_id="patrol01" start_time="1.0"/>

			<element type="UnitInArea" area="patrol01" state="deactivate"/>

		</event>


		<event name="activate_tanks">

			<element type="ActivateVehicle" vehicle_id="patrol_tank" start_time="0.0/>

			<element type="OrderTank" vehicle_id="patrol01" ai="true" order="patrol" start_time="0.1">

				<waypoint position="-8257 3244 0"/>

				<waypoint position="8709 7217 0"/>

			</element>

		</event>


		<event name="patrol_tank">

			<element type="TriggerEvent" event="activate_tanks" start_time="0.1"/>

		</event>


		<event name="patrol02">

			<element type="ActivateGroup" group_id="patrol02" start_time="1.0"/>

			<element type="UnitInArea" area="patrol02" state="deactivate"/>

		</event>


		<player name="player1" mod_name="OnFoot">

			<spawn unit_name="ghost_player" object="spawn_player1"/>

		</player>

		<player name="player2" mod_name="OnFoot">

			<spawn unit_name="ghost_player" object="spawn_player2"/>

		</player>

		<player name="player3" mod_name="OnFoot">

			<spawn unit_name="ghost_player" object="spawn_player3"/>

		</player>

		<player name="player4" mod_name="OnFoot">

			<spawn unit_name="ghost_player" object="spawn_player4"/>

		</player>



		<gametype_info name="enemies_to_kill" value="50"/>


		<spawn_manager>

			<!--<xi:include href="/data/levels/merge_xml/common_spawn.xml#xpointer(/to_include/spawn/*)"/> -->

		</spawn_manager>


	</script_data>

</World>

Now I counted out the 59 lines in 2 ways. 1 is including the double spaced gap lines, and 2 is without those. I would like to know which way to count the line, and I might be able to figure out what I did wrong. :P Like I said, im still trying to learn this stuff, and im sorry for a possible n00b question.

Link to comment
Share on other sites

what type of text editor are you using? most good text editors has a line counter. you should also count the empty lines.

remember, the two most common errors you will get is either unclosed tags, or that you forgot or put too many "´s in your xml, always look at that first:)

Link to comment
Share on other sites

see... theres going to be problems like this all over the place. its great you grin guys are here to help us mentally challenged folks out but theres going to be alot of questions that could be saved and a lot of frustrated time by people saved if there was an "editor for dummies" model available.

Like it either actualy fixes these extremely minor errors or it brings up a detailed line of script telling you exactly what you need to do. For instance, if you make an [GR] map to test with no bad guys it should come up and say " do you want to ad enemies?" if you say yes all you have to do is just click them in and click view cones and drag lines like you do in teh TAC map during game play and it gives you all the rest.

I am having a problem myself, i was making my own maps and gave up. so i took the sieg strongpoint map,... took out the neutral zone and resaved it as a test [GR] with no bad guys of course. it works perfectly !.........functional wise. However, it looks like a bad acid trip.... the hills are all green and blue checkers, the ground i walk on is either that or dark black, some of the buildings are either pefect or dark black... all vegetation is either blueish green or purple and everyone once ina while something is fazed in then perfect. and all I did was resave an existing map, I didn't do anything to it.

whats wrong wtih this ?

Link to comment
Share on other sites

alright... I found the line thats causing the error, and I dont see what Im doing wrong. The line thats getting the error is the first line in this code section:

			<element type="OrderTank" vehicle_id="patrol_tank01" ai="true" order="patrol" <!--world_x="-8266.8818" world_y="3262.9829"--> start_time="1.0">

				<waypoint position="-8137 3248 0"/>

				<waypoint position="-2656 3230 0"/>

			</element>
That one is mine. Now im sitting here compairing it to your script which looks like this:
			<element type="OrderTank" vehicle_id="enemy_tank01" ai="true" order="patrol" <!--world_x="-26700" world_y="-6500"--> start_time="18.0">

				<waypoint position="-31225 -10329 0"/>

				<waypoint position="-30926 -6246 0"/>

			</element>

they look almost identical and I dont know what I did wrong. I pasted both of those lines in a seperate notepad and compaired them letter by letter and I dont know where I went wrong. I extract it and still get the script error for that first line (line 60 now) I dont know...

Link to comment
Share on other sites

This dont seem right...

<element type="OrderTank" vehicle_id="patrol01" ai="true" order="patrol" start_time="0.1">

<waypoint position="-8257 3244 0"/>

<waypoint position="8709 7217 0"/>

</element>

I could be wrong but your not telling it to move...your telling it to patrol which i dont know if that will work.

I can get vehicles to goto the first waypoint by doing this....

<element type="OrderCar" vehicle_id="panhard" order="move" position="-3301 5530 0" start_time="10.0"/>

but i cant get them to go to a second waypoint after that. We need more info on scripting and what the commands mean.

If i put this in.....

<element type="OrderCar" vehicle_id="panhard" order="move" position="-3301 5530 0" start_time="10.0"/>

<element type="OrderCar" vehicle_id="panhard" order="move" position="-3301 2073 0" start_time="15.0"/>

<element type="OrderCar" vehicle_id="panhard" order="move" position="1177 2073 0" start_time="19.0"/>

<element type="OrderCar" vehicle_id="panhard" order="move" position="1177 5530 0" start_time="24.0"/>

it just goes to the first waypoint and stops.

someone please tell me how to get them to follow a set path with multiple waypoints.

I think you have to set it up like mine.

<element type="OrderCar" vehicle_id="panhard" order="move" start_time="10.0">

<waypoint position="-3301 5530 0"/>

<waypoint position="1177 5530 0"/>

</element>

with the waypoints tabed in once

Edited by Evilducky
Link to comment
Share on other sites

The thing about this is they expect you to understand the infite possibility of errors that you could have automatically. We're given this small tutorial making making maps look simple when its nothing even remotely close to that.

You do exactly as the tutorial says and don't even still come close to a working product.

Duck and a I as well as a few others work together on mods all the time so we have multipe minds going and I think from knowing big fat ZERO about modding and map building we've done pretty damn good as a whole so far so we are by no means stupid but come on guys you gotta do better than this "throw us a fricken bone here people"

Duck made a great black hawk down map that we played several times but he cant put finishing touches on it like tanks driving and etc so that he can release it and we cant for the life of us figure out why.

help us... please

Link to comment
Share on other sites

I think you have to set it up like mine.

<element type="OrderCar" vehicle_id="panhard" order="move" start_time="10.0">

<waypoint position="-3301 5530 0"/>

<waypoint position="1177 5530 0"/>

</element>

with the waypoints tabed in once

I tried this ...

<event name="trigger">

<element type="OrderCar" vehicle_id="panhard" order="move" start_time="10.0">

<waypoint position="-3301 5530 0"/>

<waypoint position="-3301 2703 0"/>

<waypoint position="1177 2703 0"/>

<waypoint position="1177 5530 0"/>

</element>

</event>

but now it just goes to some unknown waypoint and stops...hehe Just cant win with this...lol

Link to comment
Share on other sites

w000000000t! I fixed the crashes... they error line was wrong for some reason. It kept saying line 60 was wrong, line 60... but it was really line 59 that was wrong... strange. I didnt narrow it down till I split up the lines more. Now to get the guys to spawn when I pass the area and stuff. its almost done guys. There are a few small problems with the little map in the right hand corner, and the map that comes up when you hit m isnt there. But those are minor and I dont care to much about those to fix them. if I get this running, ill post it on here so you all can have and try out, and maybe if you guys tell me how to fix those 2 small problems that arnt major, then Ill go back and fix them and update it. But im excited now that i got the map to load again without crashing.

Link to comment
Share on other sites

ok. I got the guys to spawn when you hit the zones, and the tanks will spawn and everything, but 2 major problems have come up. I had a friend help me test it and both errors came up. The first major problem is when you shoot the tank with a zeus, the second the rocket hits it, the game will crash with this:

Crash in application version: grpcrc1.30


data\lib\units\types\vehicles\abrams.dsf(-1): cant find member: push in type <void>


SCRIPT STACK


	data\lib\units\types\vehicles\abrams.dsf(0)

	data\lib\units\types\vehicles\abrams.dsf(0)

	data\lib\units\types\weapons\predatorrocket.dsf(0)

	data\lib\units\types\weapons\predatorrocket.dsf(0)

	data\lib\units\types\weapons\predatorrocket.dsf(0)

I dont know if there is anything I can do about that one. The second major problem is that the tanks will not show up for other people. they wont shoot anyone but the host. anyone else that joins wont see them there. I have tested this one both ways. I started the map and I could see it, but my friend couldnt and he started a map and he could see it that way, and I couldnt. I dont know what to do to fix it.

I still cant get the tanks to patrol. They wont move. I dont know why, but they wont. :( oh well. Ill work on it more tongiht after work.

Link to comment
Share on other sites

Ok, Like i said. I cant get the vehicle to follow a path and continue to move forever like in a circle or whatever but i did just figure something out. Lets say you want the tank to get from point A to point B but there are buildings and trees in your way. Now...if you just tell it to move to point B anyway it will find the shortest route and make it to point B without running into anything. Just thought i would share.

If you want this to work all you have to do is this for the event.....

</event>

<event name="trigger">

<element type="OrderCar" vehicle_id="panhard" order="move" position="-3301 2073 0" start_time="10.0"/>

</event>

Obviously replace the bold with your own info.

Ok, i just tried this with the tank and for some reason it gets stuck, but if i replace the tank and put a panhard in then it works perfect. Weird

Edited by }PW{ Postal
Link to comment
Share on other sites

  • 3 weeks later...

w000000000t! I fixed the crashes... they error line was wrong for some reason. It kept saying line 60 was wrong, line 60... but it was really line 59 that was wrong... strange. I didnt narrow it down till I split up the lines more. Now to get the guys to spawn when I pass the area and stuff. its almost done guys. There are a few small problems with the little map in the right hand corner, and the map that comes up when you hit m isnt there. But those are minor and I dont care to much about those to fix them. if I get this running, ill post it on here so you all can have and try out, and maybe if you guys tell me how to fix those 2 small problems that arnt major, then Ill go back and fix them and update it. But im excited now that i got the map to load again without crashing.

Mind sharing the code that got it right?

Also, I'm trying to get a panhard to move on start_game. My code is

		<event name="start_game">


			<element type="ActivateGroup" group_id="TestGroup" start_time="3"/>


		  <element type="ActivateVehicle" vehicle_id="TestV1" start_time="2"/>


			<element type="OrderCar" vehicle_id="TestV1" ai="true" order="patrol" start_time="15.0">

				<waypoint position="-284 341 0"/>

				<waypoint position="-3784 -6218 0"/>

				<waypoint position="368 597 0"/>

			</element>


		</event>

But it crashes when it tries to do the OrderCar element.

Thanks in advance for you help.

R

Link to comment
Share on other sites

see... theres going to be problems like this all over the place. its great you grin guys are here to help us mentally challenged folks out but theres going to be alot of questions that could be saved and a lot of frustrated time by people saved if there was an "editor for dummies" model available.

Like it either actualy fixes these extremely minor errors or it brings up a detailed line of script telling you exactly what you need to do. For instance, if you make an [GR] map to test with no bad guys it should come up and say " do you want to ad enemies?" if you say yes all you have to do is just click them in and click view cones and drag lines like you do in teh TAC map during game play and it gives you all the rest.

its not like WE wouldnt want that aswell ;) its just that someone has to code it and there wasnt/isnt any time or manpower to spare :/

Link to comment
Share on other sites

to get the waypoint coords, when you save the game, it creates a world file in the folder whatever your map is called. if you open up that XML it will give you the coords of all the ai nodes, vehicle nodes, and the position of all the other objects in your map.

There are another way to get the cordinates. Press F12 while in the editor and the "action" window opens on low left side. Now when you move around the map you get the position, and you just have to write down those you want. Easier then searching thru n:th numbers of world files.

Link to comment
Share on other sites

This might be offtopic, but man I wished the will remove the CD/DVD-check in the next patch. All that time one spends waiting while switching between modding and testing I rather used for modding.

Or if thats not possible, make it possible to test the map while in the editing mode!

Sorry I had to get that off my chest, now it feels a little better.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...