Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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