Conveyor belt
Author | Topic: Conveyor belt |
---|---|
Shock Trooper
Member # 10488
|
written Sunday, December 16 2007 18:48
Profile
I'm trying to create a terrain script which makes a space act like a conveyor belt. It works, but there's one problem: when several conveyor spaces are chained together, you are taken instantly to the end of the chain rather than being pushed a single space. Is there any way to fix this? I thought of setting an SDF which is reset in, say, the scenario start state, but then only one belt space would operate per turn. My code: (It's in the START_STATE.) [ Sunday, December 16, 2007 18:48: Message edited by: Celtic Minstrel ] Posts: 334 | Registered: Friday, September 14 2007 07:00 |
Lifecrafter
Member # 6193
|
written Sunday, December 16 2007 19:34
Profile
Homepage
I'm pretty sure you could do this in the town start_state, thus eliminating the need to lay down tons of terrain scripts. Run a check for each NPC, seeing if they are on a conveyor belt. If they are, move them one space forward (in either the +- x or +- y depending on what direction belt it is.) Make sure the belts' blockage are defined so that you can't walk backwards on them. -------------------- "NOW PASS ME MY BOOTS. I HAVE AN APPOINTMENT WITH A FACE." -Nikki Frostbite: Get It While It's...... Hot? Posts: 900 | Registered: Monday, August 8 2005 07:00 |
Shock Trooper
Member # 10488
|
written Monday, December 17 2007 05:01
Profile
Well... I never thought of this. Only one minor problem – I wanted to be able to set an SDF to turn it off (so it stops pushing). However it's fairly unlikely I'll have two completely separate conveyor networks in the same town, so that shouldn't be a significant problem. I actually made the terrain script be set automatically, but I still had to go through and set the direction appropriately. I wonder... could I make this work outdoors? Posts: 334 | Registered: Friday, September 14 2007 07:00 |
Lifecrafter
Member # 6193
|
written Monday, December 17 2007 11:54
Profile
Homepage
If you wanted to turn off a conveyor belt and leave others on, you'd have to swap the entire belt to a different 'dummy' belt, which would look the same but be a different number that isn't recognized in the start_state as being a belt, and thus wouldn't push people. I don't think it'd work outdoors, since you can't get the x,y loc of the party to check what floor they're standing on, and can't use the terrain script method either. -------------------- "NOW PASS ME MY BOOTS. I HAVE AN APPOINTMENT WITH A FACE." -Nikki Frostbite: Get It While It's...... Hot? Posts: 900 | Registered: Monday, August 8 2005 07:00 |
Shock Trooper
Member # 10488
|
written Monday, December 17 2007 12:01
Profile
Or I could use my original method - the SDF - if I simply wanted to disable all belts in the town. By the way, what's the maximum number of creatures in a town? And the max num of items? Edit: There's no way to iterate through all items in the town like you can do with creatures, is there? :( Edit: It's telling me there is "syntax error [statement" (ALint) or "Bad term in expression" (Avernum) on line 39. That's the "south" line in the INIT_STATE: This makes no sense at all. [ Monday, December 17, 2007 12:26: Message edited by: Celtic Minstrel ] Posts: 334 | Registered: Friday, September 14 2007 07:00 |
Agent
Member # 5814
|
written Monday, December 17 2007 13:36
Profile
The "east" line is missing a semicolon. Maybe an SDF could be used to chart whether a belt has moved a player yet, with one for each player (6). Set them to a number after moving a player, and reset them every turn. If you want the belt to stop you can set all the SDFs to the inactive value. Will monsters also need to walk on the belt? -------------------- It's just trying to say hi! Posts: 1115 | Registered: Sunday, May 15 2005 07:00 |
Infiltrator
Member # 5576
|
written Monday, December 17 2007 13:40
Profile
Homepage
The maximum is 120 creatures, I think, and something like 144 items, but move_item_on_spot is probably your best bet for items. -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |
Shock Trooper
Member # 7662
|
written Monday, December 17 2007 14:42
Profile
Looking at the 3D source file Global.h around line 65 gives all of the limits, this agrees with Editor help file. In particular, you can only place eighty monsters, the other 34 slots are reserved for summonings. Edit: as it so happens the Blazing Blades produced good conveyor belt graphics. [ Monday, December 17, 2007 14:43: Message edited by: Ishad Nha ] Posts: 292 | Registered: Monday, November 13 2006 08:00 |
Infiltrator
Member # 5576
|
written Monday, December 17 2007 14:58
Profile
Homepage
80 placed creatures + 34 summoned + 6 party members = 120 charcters in the town. -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |
Shock Trooper
Member # 10488
|
written Monday, December 17 2007 16:42
Profile
quote:Whoa – how'd I miss that? quote:Actually, for the characters I'm going to check each character in turn to see if they are on a belt, so that monsters/NPCs can be affected by them - provided they aren't blocked. quote:I've seen the graphic you mean (based on the original Exile graphics), but I had already made my own at that time. However, I will likely switch at some point as mine is really bad. quote:Thanks. I was assuming 250, but clearly I was wrong. Now I just have to figure out a way to ensure a specific pile of items is only pushed once per turn... The easiest way would be to work backwards along the chain, but that would require different code for each town that uses conveyors. I'll do it if I can't think of a better way, though... I have a suspicion that this is actually the only way it could work. Posts: 334 | Registered: Friday, September 14 2007 07:00 |
Infiltrator
Member # 5576
|
written Monday, December 17 2007 19:10
Profile
Homepage
quote:About a year ago I worked on this for some time, and I concluded that a unique script for every town was the only practical way. One major reason is that even if you make sure that you only move each character once, how you you correctly handle things that are next to each other on the conveyor, or when one goes off the end, stops, and the others can't move forward? -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |