Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 900 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Carrying #404963
07/20/12 07:02
07/20/12 07:02
Joined: Jul 2008
Posts: 168
8
82RJZAE Offline OP
Member
82RJZAE  Offline OP
Member
8

Joined: Jul 2008
Posts: 168
Hi, any idea how to make a carry code that does not use pX_pick()?

Thanks,
82RJZAE

Re: Carrying [Re: 82RJZAE] #404966
07/20/12 08:07
07/20/12 08:07
Joined: Nov 2011
Posts: 29
G
GreenDeveloper Offline
Newbie
GreenDeveloper  Offline
Newbie
G

Joined: Nov 2011
Posts: 29
Code:
BMAP* pointer_tga = "pointer.tga";
 
VECTOR temp;
 
function mouse_startup()
{ 
       mouse_mode = 2;
       mouse_map = pointer_tga;
       while (1)
       { 
               vec_set(mouse_pos, mouse_cursor);
               wait(1);
       }
}
 
function pick_or_drop()
{
       wait (1);
       my.skill1 += 1;
       if ((my.skill1 % 2) == 1) // clicked the object?
       {
               while (mouse_left) {wait (1);} // wait until the player releases the left mouse button
               while (!mouse_left) // move the object until the player presses the mouse button again
               {
                       temp.x = mouse_cursor.x;
                       temp.y = mouse_cursor.y;
                       temp.z = 200; // move the object 200 quants below the camera, play with this value
                       vec_for_screen(temp.x, camera);
                       vec_set (my.x, temp.x);
                       set (my, PASSABLE);
                       wait (1);
               }
       }
       else // drop the object here
       {
               vec_set (temp.x, my.x);
               temp.z -= 3000; // trace up to 5,000 quants below the player
               // make sure to drop the object on the ground
               my.z -= c_trace (my.x, temp.x, IGNORE_ME + IGNORE_SPRITES + IGNORE_MODELS + USE_BOX);
               reset (my, PASSABLE);
       }
}
 
action click_and_move()
{
       my.skill1 = 0;
       my.emask |= ENABLE_CLICK;
       my.event = pick_or_drop;
}



in aum85


"Actually we are all Guybrush.." GreenDeveloper
Re: Carrying [Re: GreenDeveloper] #404987
07/20/12 14:10
07/20/12 14:10
Joined: Apr 2008
Posts: 650
Sajeth Offline
User
Sajeth  Offline
User

Joined: Apr 2008
Posts: 650
Well that didn't help.


Teleschrott-Fan.
Re: Carrying [Re: Sajeth] #404991
07/20/12 15:54
07/20/12 15:54
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Which kind of code do you want to see then ?


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: Carrying [Re: rayp] #404998
07/20/12 18:41
07/20/12 18:41
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Sajeth@ could you pls upload anything that could help 82RJZAE??


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Carrying [Re: 3run] #405000
07/20/12 18:55
07/20/12 18:55
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Iam intrested too


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: Carrying [Re: rayp] #405019
07/21/12 09:35
07/21/12 09:35
Joined: Apr 2008
Posts: 650
Sajeth Offline
User
Sajeth  Offline
User

Joined: Apr 2008
Posts: 650
Didn't get around to work with PhysX much, but my (un-)educated guess would be to directly set the position of the object in front of the camera and then connect it with a PH_BALL constraint to the px actor used as player.
The code snippet posted above is useless as it isn't using the physics system.

Last edited by Sajeth; 07/21/12 09:36.

Teleschrott-Fan.
Re: Carrying [Re: Sajeth] #405031
07/21/12 15:32
07/21/12 15:32
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
or u simply disable physic of the object while carring with a mod of the code above. reactivating it on drop.


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: Carrying [Re: rayp] #405035
07/21/12 16:38
07/21/12 16:38
Joined: Jul 2008
Posts: 168
8
82RJZAE Offline OP
Member
82RJZAE  Offline OP
Member
8

Joined: Jul 2008
Posts: 168
If I'm not correct, that code does not allow for collision detection while you are carrying something. How would you prevent a carried object from intersecting other objects like the wall? C_move?


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | 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