|
2 registered members (Quad, TipmyPip),
6,316
guests, and 3
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: c_scan hit e key to pick up weapons
[Re: Raithe]
#402170
05/30/12 21:22
05/30/12 21:22
|
Joined: Jul 2008
Posts: 2,111 Germany
rayp

X
|

X
Joined: Jul 2008
Posts: 2,111
Germany
|
#define taken skill100
function pickup_now{)
{
c_scan(camera.x,camera.pan,vector(360,0,100),SCAN_ENTS | SCAN_LIMIT);
}
function _i_was_taken()
{
if(event_type==EVENT_SCAN)
my.taken = 1;
}
action Iam_a_Weapon()
{
set(my,PASSABLE);
my.emask |= ENABLE_SCAN;
my.event = _i_was_taken;
while(my.taken == 0) wait(1);
//item picked up with c_scan further code here
//..
ptr_remove(me);
}
function main()
{
..
on_e = pickup_now;
..
.
mhm greets
Last edited by rayp; 05/30/12 21:25.
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;
|
|
|
Re: c_scan hit e key to pick up weapons
[Re: Raithe]
#402181
05/31/12 05:41
05/31/12 05:41
|
Joined: Jul 2008
Posts: 2,111 Germany
rayp

X
|

X
Joined: Jul 2008
Posts: 2,111
Germany
|
Maybe this one is better (without c_scan) ?
function Iam_a_Weapon()
{
while(my)
{
if(vec_dist(my.x,player.x)<100 && key_e) break;
wait(1);
}
//i was taken place further code here
}
Have fun Edit: Get away from the templates just a tip
Last edited by rayp; 05/31/12 05:42.
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;
|
|
|
Re: c_scan hit e key to pick up weapons
[Re: Raithe]
#402421
06/04/12 20:15
06/04/12 20:15
|
Joined: Jul 2008
Posts: 2,111 Germany
rayp

X
|

X
Joined: Jul 2008
Posts: 2,111
Germany
|
Thats really off topic ^^ I dont know if pushable objects really need physic. It depends on what you want to do. In most cases u can write a "physic fake" which may look better and is much more framerate friendly. But if you want to use it, your idea is good. But i wouldnt disable the complete physics thats bullshit. Again the manual is your friend. // disable physics entity so we can manually alter its position. pXent_enable( me, 0 );vec_set(my.x, newPosition ); vec_set(my.pan, newOrientation ); // re-enable entity, this will inform the physics system that position/orientation has changed. pXent_enable( me, 1 );
Last edited by rayp; 06/04/12 20:23.
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;
|
|
|
|