|
|
linkto? |
-tiger-
Steuerzahler
Dabei seit: 22.01.2008
Beiträge: 189
|
|
Wie kann ich linkto aktivieren und deaktivieren? Die Funktion brauche ich für ein Tür, ich möchte das sich erst der Türgriff bewegt und dann die Tür auf geht.
Code angehängt. Klicke hier zum Ein-/Ausblenden
code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
|
main()
{
thread door1();
}
door1()
{
level.door1_open = false;
level.door1_moving = false;
thread door1_trigger_right();
thread door1_trigger_left();
}
door1_trigger_right()
{
door1 = getent ("door1","targetname");
doorhandle1 = getent ("tg1","targetname");
doorhandle2 = getent ("tg2","targetname");
door1_trigger_right = getent ("door1_trigger_right","targetname");
while (1)
{
door1_trigger_right waittill ("trigger");
if (level.door1_open == false)
{
if(level.door1_moving == false)
{
level.door1_moving = true;
level.door1_open = true;
level.door1_dierection = true;
doorhandle1 rotateto ((-90,0,0),1);
doorhandle2 rotateto ((90,0,0),1);
doorhandle1 waittill ("rotatedone");
doorhandle1 linkto(door1);
doorhandle2 linkto(door1);
door1 rotateto ((0,90,0),1);
door1 waittill ("rotatedone");
level.door1_moving = false;
thread door1_trigger_right();
return;
}
else if (level.door1_moving == true)
{
thread door1_trigger_right();
return;
}
}
else if(level.door1_open == true)
{
if(level.door1_moving == false)
{
if (level.door1_dierection == true)
{
level.door1_moving = true;
doorhandle1 rotateto ((90,0,0),1);
doorhandle2 rotateto ((-90,0,0),1);
doorhandle1 waittill ("rotatedone");
door1 rotateto ((0,0,0),1);
door1 waittill ("rotatedone");
level.door1_open = false;
level.door1_moving = false;
thread door1_trigger_right();
return;
}
else if (level.door1_dierection == false)
{
level.door1_moving = true;
doorhandle1 rotateto ((90,0,0),1);
doorhandle2 rotateto ((-90,0,0),1);
doorhandle1 waittill ("rotatedone");
doorhandle1 linkto(door1);
doorhandle2 linkto(door1);
door1 rotateto ((0,0,0),1);
door1 waittill ("rotatedone");
level.door1_open = false;
level.door1_moving = false;
thread door1_trigger_right();
return;
}
}
else if (level.door1_moving == true)
{
thread door1_trigger_right();
return;
}
}
}
}
door1_trigger_left()
{
door1 = getent ("door1","targetname");
doorhandle1 = getent ("tg1","targetname");
doorhandle2 = getent ("tg2","targetname");
door1_trigger_left = getent ("door1_trigger_left","targetname");
while (1)
{
door1_trigger_left waittill ("trigger");
if (level.door1_open == false)
{
if(level.door1_moving == false)
{
level.door1_moving = true;
level.door1_open = true;
level.door1_dierection = false;
doorhandle1 rotateto ((-90,0,0),1);
doorhandle2 rotateto ((90,0,0),1);
doorhandle1 waittill ("rotatedone");
doorhandle1 linkto(door1);
doorhandle2 linkto(door1);
door1 rotateto ((0,90,0),1);
door1 waittill ("rotatedone");
level.door1_moving = false;
thread door1_trigger_left();
return;
}
else if (level.door1_moving == true)
{
thread door1_trigger_left();
return;
}
}
else if(level.door1_open == true)
{
if(level.door1_moving == false)
{
if (level.door1_dierection == true)
{
level.door1_moving = true;
doorhandle1 rotateto ((90,0,0),1);
doorhandle2 rotateto ((-90,0,0),1);
doorhandle1 waittill ("rotatedone");
doorhandle1 linkto(door1);
doorhandle2 linkto(door1);
door1 rotateto ((0,0,0),1);
door1 waittill ("rotatedone");
level.door1_open = false;
level.door1_moving = false;
thread door1_trigger_left();
return;
}
else if (level.door1_dierection == false)
{
level.door1_moving = true;
doorhandle1 rotateto ((90,0,0),1);
doorhandle2 rotateto ((-90,0,0),1);
doorhandle1 waittill ("rotatedone");
doorhandle1 linkto(door1);
doorhandle2 linkto(door1);
door1 rotateto ((0,0,0),1);
door1 waittill ("rotatedone");
level.door1_open = false;
level.door1_moving = false;
thread door1_trigger_left();
return;
}
}
else if (level.door1_moving == true)
{
thread door1_trigger_left();
return;
}
}
}
}
|
|
Die Tür geht mit dem skript auf so wie sie soll aber sie geht nicht mehr zu, ich vermute mal das es mit dem linkto zusammen hängt und deshalb möchte ich das deaktivieren/aktivieren.
__________________
Processor: Intel Core2 Quad Q6600 | Mainboard: ABIT IP35 | Grafikkarte: GeForce 9800 GTX | Arbeitsspeicher: 2 GB G-Skill | Netzteil: Be Quiet! Straight Power
Dieser Beitrag wurde 2 mal editiert, zum letzten Mal von -tiger-: 25.07.2008 10:47.
|
|
|
|
|
BadMan
Turnbeutelvergesser
Dabei seit: 31.01.2008
Beiträge: 278
|
|
machs ma so
Code angehängt. Klicke hier zum Ein-/Ausblenden
code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
|
main()
{
thread door1();
}
door1()
{
level.door1_open = false;
level.door1_moving = false;
thread door1_trigger_right();
thread door1_trigger_left();
}
door1_trigger_right()
{
door1 = getent ("door1","targetname");
doorhandle1 = getent ("tg1","targetname");
doorhandle2 = getent ("tg2","targetname");
door1_trigger_right = getent ("door1_trigger_right","targetname");
doorhandle1 linkto(door1);
doorhandle2 linkto(door1);
while (1)
{
door1_trigger_right waittill ("trigger");
if (level.door1_open == false)
{
if(level.door1_moving == false)
{
level.door1_moving = true;
level.door1_open = true;
level.door1_dierection = true;
doorhandle1 rotateto ((-90,0,0),1);
doorhandle2 rotateto ((90,0,0),1);
doorhandle1 waittill ("rotatedone");
door1 rotateto ((0,90,0),1);
door1 waittill ("rotatedone");
level.door1_moving = false;
thread door1_trigger_right();
return;
}
else if (level.door1_moving == true)
{
thread door1_trigger_right();
return;
}
}
else if(level.door1_open == true)
{
if(level.door1_moving == false)
{
if (level.door1_dierection == true)
{
level.door1_moving = true;
doorhandle1 rotateto ((90,0,0),1);
doorhandle2 rotateto ((-90,0,0),1);
doorhandle1 waittill ("rotatedone");
door1 rotateto ((0,0,0),1);
door1 waittill ("rotatedone");
level.door1_open = false;
level.door1_moving = false;
thread door1_trigger_right();
return;
}
else if (level.door1_dierection == false)
{
level.door1_moving = true;
doorhandle1 rotateto ((90,0,0),1);
doorhandle2 rotateto ((-90,0,0),1);
doorhandle1 waittill ("rotatedone");
door1 rotateto ((0,0,0),1);
door1 waittill ("rotatedone");
level.door1_open = false;
level.door1_moving = false;
thread door1_trigger_right();
return;
}
}
else if (level.door1_moving == true)
{
thread door1_trigger_right();
return;
}
}
}
}
door1_trigger_left()
{
door1 = getent ("door1","targetname");
doorhandle1 = getent ("tg1","targetname");
doorhandle2 = getent ("tg2","targetname");
door1_trigger_left = getent ("door1_trigger_left","targetname");
doorhandle1 linkto(door1);
doorhandle2 linkto(door1);
while (1)
{
door1_trigger_left waittill ("trigger");
if (level.door1_open == false)
{
if(level.door1_moving == false)
{
level.door1_moving = true;
level.door1_open = true;
level.door1_dierection = false;
doorhandle1 rotateto ((-90,0,0),1);
doorhandle2 rotateto ((90,0,0),1);
doorhandle1 waittill ("rotatedone");
door1 rotateto ((0,90,0),1);
door1 waittill ("rotatedone");
level.door1_moving = false;
thread door1_trigger_left();
return;
}
else if (level.door1_moving == true)
{
thread door1_trigger_left();
return;
}
}
else if(level.door1_open == true)
{
if(level.door1_moving == false)
{
if (level.door1_dierection == true)
{
level.door1_moving = true;
doorhandle1 rotateto ((90,0,0),1);
doorhandle2 rotateto ((-90,0,0),1);
doorhandle1 waittill ("rotatedone");
door1 rotateto ((0,0,0),1);
door1 waittill ("rotatedone");
level.door1_open = false;
level.door1_moving = false;
thread door1_trigger_left();
return;
}
else if (level.door1_dierection == false)
{
level.door1_moving = true;
doorhandle1 rotateto ((90,0,0),1);
doorhandle2 rotateto ((-90,0,0),1);
doorhandle1 waittill ("rotatedone");
door1 rotateto ((0,0,0),1);
door1 waittill ("rotatedone");
level.door1_open = false;
level.door1_moving = false;
thread door1_trigger_left();
return;
}
}
else if (level.door1_moving == true)
{
thread door1_trigger_left();
return;
}
}
}
}
|
|
den befehl linkto muss man nur einmal verwenden fest ist fest schraubst die klinke doch auch nicht jedesma nach dem öffnen fest oder
hoffe das hilft
Edit:
must ja links und rechts linkto haben habs ma geendert
Dieser Beitrag wurde 1 mal editiert, zum letzten Mal von BadMan: 25.07.2008 11:13.
|
|
|
|
|
-tiger-
Steuerzahler
Dabei seit: 22.01.2008
Beiträge: 189
|
|
Also geht das nicht so wie ich mir das vorgestellt habe.
__________________
Processor: Intel Core2 Quad Q6600 | Mainboard: ABIT IP35 | Grafikkarte: GeForce 9800 GTX | Arbeitsspeicher: 2 GB G-Skill | Netzteil: Be Quiet! Straight Power
Dieser Beitrag wurde 1 mal editiert, zum letzten Mal von -tiger-: 25.07.2008 10:59.
|
|
|
|
|
-tiger-
Steuerzahler
Dabei seit: 22.01.2008
Beiträge: 189
|
|
Original von BadMan
gehen müste das schon könnte sein das zu zuoft linkto verwendet hast da man es eigentlich ja nur einmal braucht
hab aber noch was gefunden im jumppad skript
vor der bewegung kommt
user linkto (air);
nach der bewegung
user unlink();
müste das sein was du gesucht hast
aha genau nach diesem befehl habe ich gesucht "unlink();"
thx T|GER
Und hier ist das Skript für alle die es brauchen.
Code angehängt. Klicke hier zum Ein-/Ausblenden
code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
|
main()
{
thread door1();
}
door1()
{
level.door1_open = false;
level.door1_moving = false;
thread door1trigger1();
thread door1trigger2();
}
door1trigger1()
{
door1 = getent ("door1","targetname");
doorhandle1 = getent ("tg1","targetname");
doorhandle2 = getent ("tg2","targetname");
door1trigger1 = getent ("ta1","targetname");
while (1)
{
door1trigger1 waittill ("trigger");
if (level.door1_open == false)
{
if(level.door1_moving == false)
{
level.door1_moving = true;
level.door1_open = true;
level.door1_dierection = true;
doorhandle1 rotateto ((315,0,0),1);
doorhandle2 rotateto ((45,0,0),1);
doorhandle1 waittill ("rotatedone");
doorhandle1 linkto(door1);
doorhandle2 linkto(door1);
door1 rotateto ((0,90,0),1);
door1 waittill ("rotatedone");
doorhandle1 unlink(door1);
doorhandle2 unlink(door1);
level.door1_moving = false;
thread door1trigger1();
return;
}
else if (level.door1_moving == true)
{
thread door1trigger1();
return;
}
}
else if(level.door1_open == true)
{
if(level.door1_moving == false)
{
if (level.door1_dierection == true)
{
level.door1_moving = true;
doorhandle1 linkto(door1);
doorhandle2 linkto(door1);
door1 rotateto ((0,0,0),1);
door1 waittill ("rotatedone");
doorhandle1 unlink(door1);
doorhandle2 unlink(door1);
doorhandle1 rotateto ((0,0,0),1);
doorhandle2 rotateto ((0,0,0),1);
doorhandle1 waittill ("rotatedone");
level.door1_open = false;
level.door1_moving = false;
thread door1trigger1();
return;
}
else if (level.door1_dierection == false)
{
level.door1_moving = true;
doorhandle1 linkto(door1);
doorhandle2 linkto(door1);
door1 rotateto ((0,0,0),1);
door1 waittill ("rotatedone");
doorhandle1 unlink(door1);
doorhandle2 unlink(door1);
doorhandle1 rotateto ((0,0,0),1);
doorhandle2 rotateto ((0,0,0),1);
doorhandle1 waittill ("rotatedone");
level.door1_open = false;
level.door1_moving = false;
thread door1trigger1();
return;
}
}
else if (level.door1_moving == true)
{
thread door1trigger1();
return;
}
}
}
}
door1trigger2()
{
door1 = getent ("door1","targetname");
doorhandle1 = getent ("tg1","targetname");
doorhandle2 = getent ("tg2","targetname");
door1trigger2 = getent ("ta2","targetname");
while (1)
{
door1trigger2 waittill ("trigger");
if (level.door1_open == false)
{
if(level.door1_moving == false)
{
level.door1_moving = true;
level.door1_open = true;
level.door1_dierection = false;
doorhandle1 rotateto ((315,0,0),1);
doorhandle2 rotateto ((45,0,0),1);
doorhandle1 waittill ("rotatedone");
doorhandle1 linkto(door1);
doorhandle2 linkto(door1);
door1 rotateto ((0,90,0),1);
door1 waittill ("rotatedone");
doorhandle1 unlink(door1);
doorhandle2 unlink(door1);
level.door1_moving = false;
thread door1trigger2();
return;
}
else if (level.door1_moving == true)
{
thread door1trigger2();
return;
}
}
else if(level.door1_open == true)
{
if(level.door1_moving == false)
{
if (level.door1_dierection == true)
{
level.door1_moving = true;
doorhandle1 linkto(door1);
doorhandle2 linkto(door1);
door1 rotateto ((0,0,0),1);
door1 waittill ("rotatedone");
doorhandle1 unlink(door1);
doorhandle2 unlink(door1);
doorhandle1 rotateto ((0,0,0),1);
doorhandle2 rotateto ((0,0,0),1);
doorhandle1 waittill ("rotatedone");
level.door1_open = false;
level.door1_moving = false;
thread door1trigger2();
return;
}
else if (level.door1_dierection == false)
{
level.door1_moving = true;
doorhandle1 linkto(door1);
doorhandle2 linkto(door1);
door1 rotateto ((0,0,0),1);
door1 waittill ("rotatedone");
doorhandle1 unlink(door1);
doorhandle2 unlink(door1);
doorhandle1 rotateto ((0,0,0),1);
doorhandle2 rotateto ((0,0,0),1);
doorhandle1 waittill ("rotatedone");
level.door1_open = false;
level.door1_moving = false;
thread door1trigger2();
return;
}
}
else if (level.door1_moving == true)
{
thread door1trigger2();
return;
}
}
}
}
|
|
__________________
Processor: Intel Core2 Quad Q6600 | Mainboard: ABIT IP35 | Grafikkarte: GeForce 9800 GTX | Arbeitsspeicher: 2 GB G-Skill | Netzteil: Be Quiet! Straight Power
Dieser Beitrag wurde 4 mal editiert, zum letzten Mal von -tiger-: 27.07.2008 15:04.
|
|
|
|
|
|
|
|
Impressum ||Datenschutzerklärung
|