zones movement with sty+ct

Designed a level that creates new, exciting, and challenging Armagetron game play? Or maybe just something funky. Put it right here.
Post Reply
AI Teâm
Core Dumper
Posts: 106
Joined: Sun Nov 02, 2008 8:38 pm
Location: Munich

zones movement with sty+ct

Post by AI Teâm »

well for example if you have the following code in your map:

Code: Select all

<Zone effect="fortress">
					<ShapeCircle radius="27" growth="0">
						<Point x="864" y="-688"/>
					</ShapeCircle>
how can i make the fort zone move??
do i only need to put something like that in there:

Code: Select all

<speed along x="6" y="-6" />
or is there any other possibility??
User avatar
ed
Match Winner
Posts: 613
Joined: Mon Feb 13, 2006 12:34 pm
Location: UK

Post by ed »

You can't make a zone which has been created by the map move. You can only make zones move that have been spawned by a command.
If we take a look at the moving zones map on flower power as an example...
The zones are spawned at the start of the round with

Code: Select all

    print("spawn_zone n north fortress none 0 " . $zone_pos . " " . $zone_size . " " . $growth . " 0 0 false\n");
	print("spawn_zone n north fortress none 0 " . $zone_pos . " " . $zone_size . " " . $growth . " 0 0 false\n");
	print("spawn_zone n north fortress none 0 " . $zone_pos . " " . $zone_size . " " . $growth . " 0 0 false\n");
	//south sumo zones
	print("spawn_zone n south fortress none 0 -" . $zone_pos . " " . $zone_size . " " . $growth . " 0 0 false\n");
	print("spawn_zone n south fortress none 0 -" . $zone_pos . " " . $zone_size . " " . $growth . " 0 0 false\n");
	print("spawn_zone n south fortress none 0 -" . $zone_pos . " " . $zone_size . " " . $growth . " 0 0 false\n");
	//east sumo zones
	print("spawn_zone n east fortress none " . $zone_pos . " 0 " . $zone_size . " " . $growth . " 0 0 false\n");
	print("spawn_zone n east fortress none " . $zone_pos . " 0 " . $zone_size . " " . $growth . " 0 0 false\n");
	print("spawn_zone n east fortress none " . $zone_pos . " 0 " . $zone_size . " " . $growth . " 0 0 false\n");
	//west sumo zones
	print("spawn_zone n west fortress none -" . $zone_pos . " 0 " . $zone_size . " " . $growth . " 0 0 false\n");
	print("spawn_zone n west fortress none -" . $zone_pos . " 0 " . $zone_size . " " . $growth . " 0 0 false\n");
	print("spawn_zone n west fortress none -" . $zone_pos . " 0 " . $zone_size . " " . $growth . " 0 0 false\n");
the script later sends the following command to start the zones on their journey to the centre of the map...

Code: Select all

			    print("CENTER_MESSAGE The Zones are Moving!...\n");
				print("set_zone_position north 0 -2.5 0 -100 0 -100\n");
				print("set_zone_position south 0 2.5 0 100 0 100\n");
				print("set_zone_position east -2.5 0 -100 0 -100 0\n");
				print("set_zone_position west 2.5 0 100 0 100 0\n");
it seems it's not well documented in the ct wiki.
Have a look at the flower sumo script here for example of its use.

Brief explanation...

Code: Select all

spawn_zone n north fortress
the zone is spawned. If the first argument after spawn_zone is n it means we are giving the zone a name, you can give multiple zones the same name (as we've done here) so we can effect multiple zones with a single command. As we do next..

Code: Select all

set_zone_position north 0 -2.5 0 -100 0 -100
this command tells the server we want to start moving the position of all zones with the name "north". 0 -2.5 is the speed vector at which we move the zone. "0 -100" is the coordinates we wish to move the zone to. If we give the server two identical coordinates (as we have here) it means we want the zones to stop at that point.

Or, a simpler way (I've just remembered) is to spawn a moving zone. Something like...

Code: Select all

SPAWN_ZONE death 450 250 40 0 -10 0 true
Have a look at that ct wiki, spawn_zone is fairly well documented.

Have fun :)
AI Teâm
Core Dumper
Posts: 106
Joined: Sun Nov 02, 2008 8:38 pm
Location: Munich

Post by AI Teâm »

i know the SPAWN_ZONE method , but the thing you showed me i need PHP and atm my PHP sucks , but maybe i can arrange it :lol: :lol:
ty for your fast help
User avatar
kyle
Reverse Outside Corner Grinder
Posts: 1876
Joined: Thu Jun 08, 2006 3:33 pm
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
Contact:

Post by kyle »

convert it to python :P
AI Teâm
Core Dumper
Posts: 106
Joined: Sun Nov 02, 2008 8:38 pm
Location: Munich

Post by AI Teâm »

hm ??
i dont get the point?!
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Post by sinewav »

AI Teâm wrote:hm ??
i dont get the point?!
I think kyle is saying you can convert the script to a language you understand better. But I suspect you aren't fluent in any programing language, isn't that right? I thought I remember you saying such. Maybe soon you will find someone to help you with your project. :)
AI Teâm
Core Dumper
Posts: 106
Joined: Sun Nov 02, 2008 8:38 pm
Location: Munich

Post by AI Teâm »

i dont know any programming language , but im learning PHp atm
User avatar
Ratchet
Match Winner
Posts: 779
Joined: Sat Mar 15, 2008 5:55 am

Re: zones movement with sty+ct

Post by Ratchet »

interesting. how would you go about converting it to python? tron hacks work in python too? wicked.
Image
"Dream as if you'll live forever,
Live as if you'll die today." -James Dean
User avatar
compguygene
Adjust Outside Corner Grinder
Posts: 2346
Joined: Thu Aug 21, 2008 12:09 pm
Location: Cleveland, Ohio
Contact:

Re: zones movement with sty+ct

Post by compguygene »

/me has a little bit of python skillz...but trying to learn php..

I am interested in the answer to this question as well. I would love to implement a few servers with python.
Armagetron: It's a video game that people should just play and enjoy :)
https://bit.ly/2KBGYjvCheck out the simple site about TheServerPharm
User avatar
kyle
Reverse Outside Corner Grinder
Posts: 1876
Joined: Thu Jun 08, 2006 3:33 pm
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
Contact:

Re: zones movement with sty+ct

Post by kyle »

the tron hacks are in the code (c++)

the script is just reading the ladderlog.txt file and doing stuff based on that.

instead of just running the server you run it like

tail -f /path/to/ladderlog.txt | parser | path/to/armagetron-dedicated

Code: Select all

import sys, re
while 1:
    line = sys.stdin.readline()
    if re.match("^GAME_TIME", line):
        keywords = line.split()
        game_time=int(keywords[1])
        if( game_time == -1):
             sys.stdout.write("Spawn_zone bla bla bla")
             sys.stdout.flush()
something like that for a very simple script to spawn a zone at the start of a round
of course you need to set the settings LADDERLOG_GAME_TIME_INTERVAL 1 and LADDELOG_WRITE_GAME_TIME 1
Image
Post Reply