2 registered members (AndrewAMD, ozgur),
1,421
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
[Re: CocaCola]
#438859
03/22/14 16:34
03/22/14 16:34
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
X
|
X
Joined: Jul 2008
Posts: 2,107
Germany
|
Ich hab das eben mal verfasst aber nicht getestet, es ist der c_trace-Aufruf. Er lasert nach vorne, in die Richtung in die der Player bzw. die Cam blickt, in einer per "range" definierten Reichweite. Erfasst er eine Tür ( per my.id = a_door markiert ) würde er dann Deine Tür - Öffnungs - function / void aufrufen. Hilft Dir das? ^^
#define id skill100
#define a_door 1000
action Door_WED(){ // gib diese Aktion einer Tuer in WED ( oder per ent_create )
set (my, POLYGON);
my.id = a_door;
...
..
.
}
void interact_with_doors(){
var range = 50;
VECTOR tpos;
vec_for_angle (tpos, vector (camera.pan, camera.tilt, camera.roll));
vec_scale (tpos, range);
vec_add (tpos, vector (camera.x,camera.y,camera.z));
trace_mode = IGNORE_ME | IGNORE_PASSABLE | USE_POLYGON | SCAN_TEXTURE | IGNORE_SPRITES;
c_ignore (1, 0);
c_trace (vector (camera.x, camera.y, camera.z), tpos, trace_mode);
draw_point3d (target.x, vector (50,50,255), 100, 3); // debug
if (HIT_TARGET) if (you) if (you.id == a_door){
// Tuer gefunden! Ruf hier Deine TuerOeffnungs function / void auf
}
}
action HeroOrPlayer(){
my.group = 1; // Beim tracen ignorierte Gruppe
while (1){
...
..
.
if (key_space) interact_with_doors(); // Leertaste? dann Tracen!
wait (1);
}
}
Bedenke bitte, falls das alles mal klappt, das Du die function, die die Tür dann öffnet ( z.B. ne Schleife die my.pan addiert oder sowas ) gegen doppeltes Starten / aufrufen absichern solltest. Sowas wie z.B.
#define moving skill99
...
...
.
{
if (my.moving) return; // bewege mich bereits, abbrechen
my.moving = 1; // beginne mich zu bewegen
while (my){
c_rotate (me, vector(5*time_step, 0, 0), IGNORE_ME|IGNORE_PASSABLE);
wait (1);
}
my.moving = 0; // fertig mit bewegen
}
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Entire Thread
|
Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
CocaCola
|
03/19/14 15:27
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
rayp
|
03/19/14 15:32
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
CocaCola
|
03/19/14 18:36
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
Uhrwerk
|
03/19/14 19:41
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
CocaCola
|
03/20/14 11:06
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
rayp
|
03/20/14 16:08
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
CocaCola
|
03/20/14 17:39
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
CocaCola
|
03/21/14 08:23
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
LemmyTheSlayer
|
03/21/14 09:54
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
CocaCola
|
03/21/14 12:05
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
Abarudra
|
03/21/14 12:56
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
CocaCola
|
03/21/14 12:56
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
Abarudra
|
03/21/14 13:36
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
CocaCola
|
03/22/14 07:53
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
CocaCola
|
03/22/14 08:35
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
CocaCola
|
03/22/14 08:38
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
Uhrwerk
|
03/22/14 13:30
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
CocaCola
|
03/22/14 14:24
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
Uhrwerk
|
03/22/14 14:45
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
rayp
|
03/22/14 16:05
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
Uhrwerk
|
03/22/14 19:12
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
rayp
|
03/22/14 19:19
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
CocaCola
|
03/22/14 16:20
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
rayp
|
03/22/14 16:34
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
CocaCola
|
03/22/14 17:00
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
rayp
|
03/22/14 17:01
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
CocaCola
|
03/22/14 17:13
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
rayp
|
03/22/14 17:52
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
CocaCola
|
03/22/14 18:19
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
rayp
|
03/22/14 18:22
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
CocaCola
|
03/23/14 16:14
|
Re: Will Tür aufmachen, wenn ich sie "sehe"?EVENT_SHOOT?
|
rayp
|
03/26/14 22:45
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|