Game Development Community

Script to allow the player to build buildings?

by Brian Lyon · in Game Design and Creative Issues · 07/14/2004 (10:29 pm) · 21 replies

I was wondering is it possible to allow the player to create a building without touching any of the torqe sourcecode and has anyone done this yet or have an example?
Page «Previous 1 2
#1
07/14/2004 (11:29 pm)
The answer is no for the most part. Without changing the engine, I'd say it's possible to model some pieces, modify the editor a little bit to allow people to assemble the pieces into a building. A 'builder mode' if you will.


Bottom line, torque can do a lot as is, but it can't do everything. If you can learn to script, then it can do a whole lot more for you, if you can learn to script, you can eventually learn C++, etc...
#2
07/14/2004 (11:53 pm)
It would require you to dynamically create DIF objects via script at runtime, and snap them together along some imaginary 3d grid. A good example of this was the Tribes 2 Construction Set mod where you had a builder like weapon and you could select the piece of the building you wanted to create, you pointed your weapon in the spot where you wanted it, and clicked. Boom, the chunk of building would appear and be snapped to the piece next to, above, or below it.

I would have to disagree and say that this could be done entirely in script by a savvy scripter. It would not ~require~ engine changes. Good luck.

Robert
#3
07/15/2004 (12:38 am)
Quote:I would have to disagree..... It would not ~require~ engine changes.


Ummm so you disagree with me when I say....


Quote:Without changing the engine, I'd say it's possible.....


??
#4
07/15/2004 (1:36 pm)
Ive been looking for the construction set mod just to see how the script works but all the sites for it are down anyone know where i can get it?also ive herd that some people are working on an rts with torque anyone know how there rts is building there buildings?
#5
07/15/2004 (4:21 pm)
If you just want the buildings to be there but not necessarily have complex collision a DTS shape would be fine, too.
#6
07/15/2004 (4:51 pm)
Brian, what exactly do you mean by building? Do you just mean placing a building on the terrain, or do you mean actually constructing a building?

In either case, I guess you have answers here. If you just need to be able to place buildings-- and you don't need them to be huge or have interiors-- you could use DTS shapes and do this easily. If you want the ability to actively construct buildings.. that would take more work. In order to offer more details, we'd need to know more about what exactly you're wanting to do.

Btw, sorry to say I don't know where an active link to T2's construction mod is, but hopefully some kind soul does.
#7
07/15/2004 (4:56 pm)
Here's a link the latest version of the mod (0.69):
downloads.rawr32.net/t2files/Construction_v0.69a.exe

They are working on 0.70 so you can view info here:
www.tribes3.org/forums/forumdisplay.php?f=20

Note that this was done for Tribes 2 so you won't be able to just drop it into Torque. There's a lot of work to make it play nice with starter.fps as it depends on a lot of shapes and resources from Tribes 2.
#8
07/15/2004 (5:04 pm)
As he mentioned RTS games, I would imagine that he means something along the lines of building construction in Warcraft III.

In other words, each building has several stages of construction with animated characters working in or near it, but each building only has one shape.

I don't see an obvious reason why TorqueScript wouldn't be able to handle this given enough 3D models.

If he meant that he wanted to allow the player to create a building of any shape such as a 3D model package might do, that would be another story.
#9
07/16/2004 (5:18 pm)
My plan is to allow the player to build buildings in an rts style the buildings would generate resources and the player could use the resources to build troops in other building also the same effect could be done by using an npc and a conversation right? also thanks for posting the link to the constructiion set i just wanna see the code for how they load the shapes for the buildings
#10
07/16/2004 (7:39 pm)
Well, if your buildings are simply "Unit Factories", you're best off doing some simple .dts models. Much less complicated to add shapes dynamically than it is to add interiors. The disadvantage is that players will not being able to enter these buildings. If that feature is a requirement, you'll have to stick with interiors.

Good luck. Personally I love the RTS/FPS mod Natural Selection. It'd be cool to see something like that coming from the GG community.
#11
07/17/2004 (8:30 am)
Quote: The disadvantage is that players will not being able to enter these buildings. If that feature is a requirement, you'll have to stick with interiors.

Not sure where that impression came from, but it's not really the case. We are doing this exact concept (although not limited to scripting), and players walk into, around, and through .dts buildings easily. Collision meshes can be tricky, but it works fine...
#12
07/17/2004 (10:19 am)
The reason we usually say that is because people seem to crash and burn when they try it. If it's working for you.. That's great!
#13
07/17/2004 (11:12 am)
Quote:Not sure where that impression came from, but it's not really the case. We are doing this exact concept (although not limited to scripting), and players walk into, around, and through .dts buildings easily. Collision meshes can be tricky, but it works fine...

Wow! Really?!? I honestly didn't know that was possible, since all evidence points in the opposite direction, given the limitations of .dts collision hulls, and numerous people (with more knowledge than myself) saying that dts collision isn't good enough for interiors. But, I'd be VERY happy to be wrong on this! ;-D

Would you mind sharing your methods? Pretty please? ;-) I'm sure there's plenty of people who would be interested in making (working) dts-based buildings. I know I'm very eager to hear how this was accomplished.
#14
07/17/2004 (5:57 pm)
Im a bit of a newbie what program is used to make .dts files?
#15
07/17/2004 (6:25 pm)
Welcome, Brian. You should start here: here. The first chapter of those docs contains a section with beginning information just like what you're looking for.
#16
07/19/2004 (3:06 pm)
@Chris: I think the definition of "interior" is the problem here--what you (and we) are talking about is a pretty basic set of 4 walls and a floor, plus a doorway, while an "interior" from a standard FPS perspective is extremely large, and complicated.

As far as I am aware there wasn't any magic, or extremely complicated techniques, our artist simply created collision meshes for the walls, floors, etc. and exported the model. Some of them (curved walls, partial walls, etc.) took some trial and error work, but it wasn't all that magical.

We don't have any lifts, or ramps, or major triggers, or other complicated/detailed objects, so the collision meshes just aren't that complex.
#17
07/19/2004 (3:48 pm)
To reverse the question...how can you show damage to buildings/objects?
#18
07/21/2004 (5:34 pm)
I was thinking about how this would be scriptied soemthing like add a .dts at the position of the players cursor then when the player clicks add the .dts in the world where the player clicked right?
#19
07/22/2004 (9:16 am)
@Jon: I would suggest having an animation thread that transitions the shape from healthy to damaged, then set the thread based on damage.

@Brian: Yup. We have this working pretty well in our RTS code pack - more info on that will be posted soon.
#20
08/17/2004 (4:49 am)
A question.. is it possible to damage .dif interiors?.. and show its damage?.
Page «Previous 1 2