Gamestudio Links
Zorro Links
Newest Posts
FXCM demo test failed
by qin. 01/13/26 13:53
Camera always moves upwards?
by NeoDumont. 01/12/26 09:39
Alpaca Plugin v1.5.2 Release
by kzhao. 01/11/26 13:42
Alpaca Plugin v1.4.0
by kzhao. 01/11/26 13:38
separating groups of 3 digits by a comma
by joe_kane. 01/11/26 00:01
MRC.c and WFO
by joe_kane. 01/10/26 23:58
BarOffset (default = 940 for daily bars?
by joe_kane. 01/10/26 23:46
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 5,207 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
promfast, joe_kane, Namitha_NN, Syndrela, agasior
19190 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
c_scan hit e key to pick up weapons #402168
05/30/12 20:49
05/30/12 20:49
Joined: May 2012
Posts: 4
R
Raithe Offline OP
Guest
Raithe  Offline OP
Guest
R

Joined: May 2012
Posts: 4
Hi , I love the template but I know this should be easy but instead of the collision pick up I want it so you can use c_trace or c_scan with the cameras angle relative the the middle of the the screen where the cross hair should be ... then if it is scanned then do another check for the e key then run the skill.67 event should be easy enough but i'm having issues and I think it's do to the vector coordinates I was thiking doing the same c_trace as for shooting but I seem to fail or c_scan if anyone could just dump the phew lines of code that would be great thank you laugh

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 Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,111
Germany
Code:
#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: rayp] #402173
05/30/12 22:54
05/30/12 22:54
Joined: May 2012
Posts: 4
R
Raithe Offline OP
Guest
Raithe  Offline OP
Guest
R

Joined: May 2012
Posts: 4
More then perfect ?! tongue Thanks a lot next move inventory should be easy now ^_^... and hello wink

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 Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,111
Germany
Maybe this one is better (without c_scan) ?

Code:
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: rayp] #402417
06/04/12 18:50
06/04/12 18:50
Joined: May 2012
Posts: 4
R
Raithe Offline OP
Guest
Raithe  Offline OP
Guest
R

Joined: May 2012
Posts: 4
I would but it's just time consuming to pull a whole template together I'm sure only a week into it .... but it works fine... the problem right now i'm having though is to incorperate physx with the game for pushable barricades I know I could do this with the char using the physics engine but it runs to many fps.. Would the best route be to open up the engine then close it everytime the block is pushed .... kinda like

if (vec_dist(my.x,player.x)<50)
{
physx_open();
//init the crates physics
physx_destroy();
}

im looking at the plan for this though and it seem's as if it would run into alot of issues fps issues so maybe run the physx? then disable all the enties besides the dynamic objects.... ? Sorry getti ng alittle off-topic ... Hey and thanks I love the code snippets ^_^ happy to see this forum active still 0.o

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 Offline

X
rayp  Offline

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.

Quote:

// 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;

Moderated by  HeelX, rvL_eXile 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1