Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
3 registered members (7th_zorro, henrybane, AndrewAMD), 1,343 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Simple c-script need help #179068
01/21/08 08:16
01/21/08 08:16
Joined: May 2006
Posts: 27
B
BrockA Offline OP
Newbie
BrockA  Offline OP
Newbie
B

Joined: May 2006
Posts: 27
I've just began learning C-script and i'm working on a script that simply makes the camera follow the mouse..I've gotten that far but when i try to mouse_map a BMP image it shows the cursor in the top left of the screen instead of as the cursor.

This is my code.

Oh and btw, I've also have gotten a "possible endless loop" error when running my script, when I have a wait var. in the function main, so I don't understand why I'm getting that..


Thanks.

Code:
var video_mode = 7;
var video_depth = 16;

///////////////////////

STRING ws13_wmb = <ws13.wmb>;
////////////////////////////

BMAP crosshair_pcx = "crosshair.pcx";


function mouse_mapping()
{
if (mouse_mode == 1)
{
mouse_map = crosshair_pcx;
}
}


function main()
{
level_load (ws13_wmb); //Load level
mouse_mode = 1;
while (1)
{
mouse_pos.x = mouse_pointer.x;
mouse_pos.y = mouse_pointer.y;
camera.pan -= mouse_force.x;
camera.tilt += mouse_force.y;
mouse_mapping()
}
wait (1);
}



Re: Simple c-script need help [Re: BrockA] #179069
01/21/08 10:43
01/21/08 10:43
Joined: Dec 2007
Posts: 34
L
Luzifer Offline
Newbie
Luzifer  Offline
Newbie
L

Joined: Dec 2007
Posts: 34
Just a wild guess but try to put the "mouse_map = ..." part out of the if comparison (basically just delete the if-comparison). It shouldn't be necessary.

Re: Simple c-script need help [Re: Luzifer] #179070
01/21/08 12:28
01/21/08 12:28
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
Code:



function mouse_mapping()
{
if (mouse_mode == 1)
{
mouse_map = crosshair_pcx;
}
}


function main()
{
level_load (ws13_wmb); //Load level
mouse_mode = 1;
mouse_mapping()
while (1)
{
mouse_pos.x = mouse_pointer.x;
mouse_pos.y = mouse_pointer.y;
camera.pan -= mouse_force.x;
camera.tilt += mouse_force.y;
wait (1);
}

}





"empty"

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