Returnable objectives


(Flippy) #1

Hey… got a question here…

How can i “link” the team_CTF_redflag to show a BRUSH “model” instead of an existing model… i never tried making my own models for ET (i can make models a bit but never did it for ET… importing etc…)

I made a crucifix in brushwork but how do i make this into the capturable objective?!

I searched and found one topic with the same question with no answers…


(FireFly) #2

What you’re asking is possible, because I did it in my Tramfight map. I must admit that it is a bit complicated and it involves allot of steps, but I’ll try to explain anyway:

First off all your “team_CTF_redflag” (or blueflag) needs an md3 model. Doesn’t matter wich model, I suggest the radarbox ( models/mapobjects/portable_radar_sd/portable_radar_box.md3 ), but this entity needs a model to properly work. Now the trick is to give this model a transparent shader, so it will not be visible ingame.So now the fun part begins…

In photoshop create a 32 by 32 pixel image, all white and create an alpha channel that’s also completely white, save this as “whatever_trans.tga” into your models/mapobjects/mymap directory.

Use this shader for it:

models/mapobjects/mymap/whatever_trans
{
cull disable
{
map models/mapobjects/mymap/whatever_trans.tga
alphaFunc GE128
rgbGen lightingDiffuse

}
}

In your map place the “team_CTF_redflag” entity and it’s TOI where you want it (have a look at the goldrush map if you don’t know how to) give it the radar model.

Create your brush-work-model that will be the model that needs to be stolen ( crucifix ) and turn it into a script_mover: give it a targetname-and scriptname (don’t forget the origin brush!)

Now the scripting part that controls it all"

scriptname of your “team_CTF_redflag/blueflag” entity
{
spawn
{
remapshader “models/mapobjects/portable_radar_sd/portable_radar_sd” “models/mapobjects/mymap/whatever_trans”
remapshaderflush

}

trigger stolen
{
setstate “targetname of your crucifix” invisible
}

trigger captured
{
setstate “targetname of your crucifix” invisible
}

trigger returned

{
setstate “targetname of your crucifix” default

}

trigger dropped
{
}

}

So the ‘secret’ is in the remapshader-command & the setstate command: Ingame it will look like the player stole the crucifix, while instead he actually stole the radarpart…
I can understand that it might all sounds a bit complicated, but trust me, It truly works, good luck… :smiley:


(Flippy) #3

Hmm i thought about this too… but i came to the conclusion that it was impossible because:

when you are killed with the objective, the objective “spawns” where you were killed…

if you use this method, the objective (the crucifix, brushwork) will spawn at the start again…

or am i missing something?


(FireFly) #4

or am i missing something?

No, you are correct, my fault…

In Tramfight: Instead of the radarbox, I used a custom model that would be visible again (with the remapshader-command) once it was dropped.

You are correct to say that this wouldn’t work in the example above, as only the radarbox would be visible at the spot it was dropped( in fact it would be invisible because of the remapshadercommand…), instead of the cucifix brushmodel…

So I am afraid the only way it would work is to convert your crucifix into a md3 model, that way you don’t have to use the remapshader stuff above…


(RayBan) #5

if you used a custom model then why would you go through the whole setup you described?

@Flippy, if you post a small box map with just the cross you made, i can make it into an md3 so
you can get it to work with the ctf flags, include any custom textures/shaders you used
for it also.


(FireFly) #6

if you used a custom model then why would you go through the whole setup you described?

The objective in Tramfight (the venom gun) is rotating, like the weapons you can pick up in doom3 multiplayer ( and in quake3 if I remember correct), Therefor I had to fake it with a ‘dummy’ objective that was rotating…


(RayBan) #7

i see… i see… however… if you add a key/val of spawnflags 2 to the ctf_blueflag or red,
it will rotate also, but only at it’s initial spawn point, and not when dropped… when it gets
returned, it will continue to rotate.

it’s undocumented, but it works.


(DogRed9) #8

[quote=“RayBan”]

if you used a custom model then why would you go through the whole setup you described?

@Flippy, if you post a small box map with just the cross you made, i can make it into an md3 so
you can get it to work with the ctf flags, include any custom textures/shaders you used
for it also.[/quote]
Could you please do this for me too, ive been searching for days, but can never get my textures working… All mine is is a small rectangle. Ill be so thankfull :smiley:
http://www.bmccars.com/ET/csl.zip and if you need my email, Dogred9 at gmail.com
:drink:


(Flippy) #9

Thanks for all your help… but ill keep it the way i have it now (the way firefly said in his first post)

It’s actually no problem at all in my map to have to obj spawn at its start point again, as its not a frag map and the objective is always very close to the drop off point…
also, axis cannot come close to allies so they wont get killed anyway

just if your wondering, im trying to make a map that resembles those games on the internet where you are stuck in a room and need to find all sorts of things and eventually unlock the door…

also, what im trying to do now, is having the crucifix suspended on the wall, then when a certain thing is done (not telling what this certain thing is ofcourse :smiley: ) the crucifix falls down on the ground (just a splinepath) and THEN make the team_CTF_redflag visible… this requires the redflag to have a targetname tho and the editor says i shouldnt set it… ah well, im just compiling atm and will try if it works …
(i also read that if you set a targetname you should alert it before it can be used, so that’s what i did)

EDIT:
ok apparently that doesnt work… :frowning:

Can you tag the team_CTF_redflag entity to a scriptmover so it “waits” beneath the floor before the crucifix has fallen?

(i dont want it to be “pickupable” before the brushed crucifix is actually on the ground)

Also another problem, the radar box is now completely white… either the shader is wrong or not loaded for some reason…


(RayBan) #10

@DogRed9

here is the md3 file, make shure you make proper shaders for it, using the same texture paths and names.
** file deleted **
@Flippy.
you shure??? its no trouble for me to toss out the md3, it should be a small file and would be a lot easier to setup
for a ctf_flag.


(DogRed9) #11

Thankyou SOO much, so, i just put my textures in the models/mapobject/csl/ folder ?


(Flippy) #12

@Rayban, yes im sure :stuck_out_tongue: its one thing less i need to think of putting into the pk3… and its no problem at all

if i ever need something else ill tell you :stuck_out_tongue:


(Flippy) #13

btw, i WOULD be gratefull if you could show me how you export the model so it can be used properly in ET! Could you show me on msn maybe? or is it too hard to learn in a few minutes… (i learn things quick so dont worry :stuck_out_tongue: learned scripting in about a week…)


(RayBan) #14

@DogRed9
no, the textures were in the orginal place you sent them to me, however… let me redo the model and i will post you back a link for it setup for that
folder you just posted, since i didnt know what folder you wanted the model in.

@Flippy,
you can download milkshape 3d, 30 day trial and make your models in there, they export easy to md3 from there, but you still have to edit the .qc file
that milkshape will make for you, but its easy.


(DogRed9) #15

ok thanks for redoing it, so, in the .pk3 (after you redo the model) it should look like this?
/models/mapobjects/csl/demobox.md3
/models/mapobjects/csl/demolitions_kit2.jpg
/models/mapobjects/csl/black.jpg
right?


(RayBan) #16

yes, thats how its setup now, and it has a shader file with it, so add
demobox_csl to your shaderlist

http://rapidshare.de/files/28448499/demobox_csl.pk3.html

you can make larger textures for it if you want, they seem a bit small, as long as
you keep the textures the same name and in that folder they will work ok.


(DogRed9) #17

theyre the only textures i have, thanks again :smiley:
The textures show up fine in radient, is there something else i need to do to make them show in ET though, because all i get is a black box :confused:


(RayBan) #18

did you add the demobox_csl to the shaderlist??
if not, go into the scripts folder, find a file named shaderlist.txt and at the end of it add
demobox_csl

without the .shader extension. it should work fine after that… but in fact i forgot to add
it to mine when i tested it, and it still worked.


(DogRed9) #19

I dont need that in the scripts folder in .pk3 that contains the map do I? Thats how I got it to show in Radient, do i need the Shaderlist.txt in the /scripts/ folder in my maps pk3 too?
Edit: oh, and i noticed that the in the .shader file you made for me it has .tga extentions and my textures are .jpgs, do i need to photoshop them to .tga’s?


(RayBan) #20

you can just extract the model and shader file from that pk3 to its proper folders, and add what i mentioned to the shader list, also
it doesnt matter that it say’s .tga’s, it will work with the jpg images. those images are the same on my end and im using the same
model/shader files and it works fine here.

also do not load it as a misc_model, it will appear all black because it’s not meant for a static model, my understanding was that you
were going to use it for a ctf_redflag or blueflag, so you create the ctf_red/blueflag and add the key/val of
model models/mapobjects/csl/demobox.md3