PDA

View Full Version : Dickymints door tutorial



arachnofang
January 11th, 2012, 13:10
Hi guys, I've got a problem with my door, Ive followed Dickymints tutorial.........

http://www.codutility.com/showthread.php?332-Open-Door-Tutorial

And just to give you a better idea of my problem I did this as well......
http://img502.imageshack.us/img502/7695/image1wq.jpg


When I go to the door for the first time you can't walk through it, when you open it the "clip_full" moves out of the way and you can walk through, but when the door closes the "clip_full" does not return to block the door, and as the door is non colliding you can walk through it with out being stopped as many times as you like, does anyone know how to make the "clip_full" return when the door closes.

Heres my script so you can compare it to dickymints.


main()
{
thread frontdoor_01();
}
frontdoor_01()
{
frontdoor01 = getent("frontdoor01", "targetname");
block1 = getent("block1", "targetname");
dest_org = ( 0.25, 0, 0);
dest_org2 = ( 0.25, 0, -200);
trig = getent("frontdoortrig", "targetname");
while (1)
{
trig waittill("trigger");
frontdoor01 rotateYaw(90, 1.5, 0.7, 0.7);
block1 moveto(dest_org2, 1.5, 0.7, 0.7);
frontdoor01 playsound ("trapdoor01");
frontdoor01 waittill("rotatedone");
wait (3);
frontdoor01 rotateYaw(-90, 1.5, 0.7, 0.7);
block1 moveto(dest_org, 1.5, 0.7, 0.7);
frontdoor01 playsound ("trapdoor01");
frontdoor01 waittill("rotatedone");
}
}

Any help would be greatly appreciated, as I've been on it for two days solid now and its driving me nuts.

Thanx, Ian.

CaptCom
January 11th, 2012, 15:17
Yes I think something is missing in the script... Checking that Ian....

arachnofang
January 11th, 2012, 15:33
Thank you CaptCom, Your a star, never occured to me that something might be missing, but then I'm not that good at scripting, I have to rely on guys like you, godsends all of you :champion-1er:

Thanx, Ian.

snypir
January 11th, 2012, 15:52
Its not your fault, but this is my take on it:

block1 moveto(dest_org2, 1.5, 0.7, 0.7);

with dest_org2 = ( 0.25, 0, -200);

basically means to move it to 0.25, 0, -200, which are XYZ coordinates, which are relative to the world. If you textured your block1 brush with something you could see, you'd see what i mean. Once the trigger has been pulled, it is moving the the brush to those coordinates. The clip/brush starts where you put it in radiant, then goes with the script, which is why it seems to work at first then never comes back, you have a random clip somewhere in your map.

Solution would be to use


block1 movez(###, 1.5, 0.7, 0.7);


with ### being how far you want it moved. Z is up and down, X and Y can be used also (movey or movex or movey)


so the first part would have

block1 movez(-300, 1.5, 0.7, 0.7);

then the 2nd half of the script (the return part)

block1 movez(300, 1.5, 0.7, 0.7);

1.5 = how long it takes, the first 0.7 is the acceleration time, the second is the deceleration time


I can explain further if needed, let me know




trig waittill("trigger");
frontdoor01 rotateYaw(90, 1.5, 0.7, 0.7);
block1 movez(-300, 1.5, 0.7, 0.7);
frontdoor01 playsound ("trapdoor01");
frontdoor01 waittill("rotatedone");
wait (3);
frontdoor01 rotateYaw(-90, 1.5, 0.7, 0.7);
block1 movez(300, 1.5, 0.7, 0.7);
frontdoor01 playsound ("trapdoor01");
frontdoor01 waittill("rotatedone");

arachnofang
January 11th, 2012, 16:20
Thank you, I understand the basics of it now, but do I still have to use "getent" and "targetname" EG: would I have to incorporate these lines in the script you've done.

frontdoor01 = getent("frontdoor01", "targetname");

block1 = getent("block1", "targetname");

trig = getent("frontdoortrig", "targetname");

Or does it know where the door and clip are.

Thanx, Ian.

CaptCom
January 11th, 2012, 16:25
Remember that:
movex goes right-left
movey goes back-forward
and
movez goes up-down.

We are presently looking closely to fix that tutorial.

arachnofang
January 11th, 2012, 16:26
Hi, This is what I have done........


main()
{
thread frontdoor_01();
}
frontdoor_01()
{
frontdoor01 = getent("frontdoor01", "targetname");
block1 = getent("block1", "targetname");
trig = getent("frontdoortrig", "targetname");
while (1)
{
trig waittill("trigger");
frontdoor01 rotateYaw(90, 1.5, 0.7, 0.7);
block1 movez(-300, 1.5, 0.7, 0.7);
frontdoor01 playsound ("trapdoor01");
frontdoor01 waittill("rotatedone");
wait (3);
frontdoor01 rotateYaw(-90, 1.5, 0.7, 0.7);
block1 movez(300, 1.5, 0.7, 0.7);
frontdoor01 playsound ("trapdoor01");
frontdoor01 waittill("rotatedone");
}
}

I took out the "dest_org" lines.

Thanx, Ian.

arachnofang
January 11th, 2012, 16:42
Hi, Thanx Captcom, I was really confused about the direction, but you cleared that up for me, it's now in my hints_tips_help file :enaccord8:

I combined the two scripts, dickymints & snypir and am happy to report that it is working perfectly :bravo: I just ran my map and the door works perfectly everytime. So!!! The above script is fully working, if you just change the script in dickymints tutorial for the one above you will have a fully working door tutorial that doesn't let the player get stuck. :champion-1er:

Thank you so much for your help CaptCom & snypir I really appreciate it, I also reckon that dickymints tutorial will now open up a whole new side to mapping, I think a lot of mappers have been waiting for this.

Once again Thank you.

Ian.