Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (7th_zorro), 793 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
c_move in Lite-c? #145098
08/01/07 17:11
08/01/07 17:11
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline OP
User
Ottawa  Offline OP
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

I'm having a problem with a pick and drop function that was working
very well in VER 6.60 Pro

I now have VER 7.04 Pro with WindowsXP-home.
I have transferred all my ".wdl" scripts to Lite-C ".c".
Two of my levels work...So the migration is coming along fine.
Level 3 opens and works until I try to pick up the object.
Then I get the following message.

Error E1513: Crash in bougequest1j2
Program aborted


The code follows below:
Code:
 ENTITY* quest1j2;
ENTITY* tempj2;

/////////////
var enable_polycollision = 0; //is set in main.c before function main()
////////////
int valeurclic = 0;

function bougequest1j2 () // August 1st 2007
{
wait(1);
valeurclic += 1;
if ( (valeurclic % 2) == 1) // The left side of mouse was selected
{
while (mouse_left == 1) {wait (1);}
while (mouse_left == 0)
// move the object until the player presses the mouse button again
{
tempj2.x = mouse_cursor.x;
tempj2.y = mouse_cursor.y;
tempj2.z = 500; // move the object 500 quants below the camera,
vec_for_screen(tempj2, camera);
quest1j2.x = tempj2.x;
quest1j2.y = tempj2.y;
quest1j2.z = tempj2.z;
wait (1);
}
}
else // drop the object
{
vec_set (tempj2.x, quest1j2.x);
quest1j2.z += 50; // drop the object 50 quants
c_move(quest1j2,nullvector,nullvector,
IGNORE_MAPS | IGNORE_CONTENT | ACTIVATE_TRIGGER | USE_AABB );
}
}




Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: c_move in Lite-c? [Re: Ottawa] #145099
08/01/07 19:32
08/01/07 19:32
Joined: Aug 2005
Posts: 390
Florida
O
oldschoolj Offline
Senior Member
oldschoolj  Offline
Senior Member
O

Joined: Aug 2005
Posts: 390
Florida
The first nullvector, wont work because that is where your movement speed is supposed to go. So it should be:
c_move (quest1j2,vector ("x","y","z"),nullvector,....


you can find me with my face in the keyboard, unshaven, listening to some nameless techno tragedy, and hashing through code over a cold cup a stale joe. __________________________________ yours truly
Re: c_move in Lite-c? [Re: oldschoolj] #145100
08/02/07 13:19
08/02/07 13:19
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline OP
User
Ottawa  Offline OP
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi oldschoolj !

Did not work.

The level is stopped with the same message. And I can't use the //! to find out
wat is wrong.

Any suggestion will help.


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: c_move in Lite-c? [Re: Ottawa] #145101
08/02/07 14:22
08/02/07 14:22
Joined: Oct 2003
Posts: 312
Lüneburg, Germany
Gnometech Offline
Senior Member
Gnometech  Offline
Senior Member

Joined: Oct 2003
Posts: 312
Lüneburg, Germany
The only thing I see that might go wrong in Lite-C is the vec_for_screen instruction, which expects a VECTOR* and not an ENTITY*. Try to add an ".x" to this (for both the entity pointer and the VIEW* pointer "camera").

And I do not quite see what the c_move is supposed to do - if both speeds are the nullvector, then the object will not move at all. Is this intended?

Regards,
Gnometech

Last edited by Gnometech; 08/02/07 14:23.

Download our playable Movement & Interaction Tutorial for 3DGS here:
http://www.puppenheim.org/MITutorial.zip
Re: c_move in Lite-c? [Re: Gnometech] #145102
08/02/07 15:14
08/02/07 15:14
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline OP
User
Ottawa  Offline OP
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi Gnometech !

Thanks for the information. This morning, I looked at another of your messages
where you responded to Frederic about Vertors. So I went back and

Code:
 //The correct code follows below:
ENTITY* quest1j2;
VECTOR* tempj2 = {x=0;y=0;z=0;}


/////////////
var enable_polycollision = 0; //is set in main.c before function main()
////////////
int valeurclic = 0;

function bougequest1j2 () // August 1st 2007
{
wait(1);
valeurclic += 1;
if ( (valeurclic % 2) == 1) // The left side of mouse was selected
{
while (mouse_left == 1) {wait (1);}
while (mouse_left == 0)
// move the object until the player presses the mouse button again
{
vec_set (tempj2, vector(mouse_cursor.x,mouse_cursor.y,500));
vec_for_screen(tempj2, camera); // voir manuel
vec_set (quest1j2.x,tempj2.x);
wait (1);
}
}
else // drop the object
{
vec_set (tempj2.x, quest1j2.x);
quest1j2.z += 50; // drop the object 50 quants
c_move(quest1j2,nullvector,nullvector,
IGNORE_MAPS | IGNORE_CONTENT | ACTIVATE_TRIGGER | USE_AABB );
}
}



So your comments about Vectors was the answer.
Now the code is shorter

As for the nullvector for the movement...the box (with this code) drops
where I want it. It falls below the camera view and does a collision.

Ps: look at my flags at a glance table in Lite-C contribution.


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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