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
Page 2 of 3 1 2 3
Re: C-Script problem... [Re: JimmyJazz] #167839
11/17/07 15:09
11/17/07 15:09
Joined: Aug 2005
Posts: 312
Sweden
tindust Offline
Senior Member
tindust  Offline
Senior Member

Joined: Aug 2005
Posts: 312
Sweden
Seems the door action needs a while loop to allow alternating mouse input.
Something like:
Code:

action doorControls
{
my.ENABLE_CLICK = ON;

while(1)
{
if(event_type == EVENT_CLICK)
{
my.event = manipulateDoor;
}
wait(1);
}
}



did not try it but hope it helps,
cheers
tindust

Re: C-Script problem... [Re: tindust] #167840
11/17/07 16:02
11/17/07 16:02
Joined: Nov 2007
Posts: 18
J
JimmyJazz Offline OP
Newbie
JimmyJazz  Offline OP
Newbie
J

Joined: Nov 2007
Posts: 18
Still no joy! It's beginning to bug me now!

I can't see what the problem is except that the player movement action is exclusively hogging the "my" pointer or something. When I use the c_scan from the player control loop it works fine (well, as fine as it can with a c_scan) but the minute I try and run the door action from a click nothing happens.



Thanks anyway...

Jim.

Re: C-Script problem... [Re: JimmyJazz] #167841
11/17/07 16:12
11/17/07 16:12
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
no the while loop is false, when you call an event it automaticly waits for your input.

Quote:


When I use the c_scan from the player control loop it works fine





Do you mean that it does work when you use even_scan instead of event_click in the door action?

Try to use beep(); instead of my.pan += 45; and see if you got a result when clicking. It should work though as far as I can see.

Last edited by Joozey; 11/17/07 16:15.

Click and join the 3dgs irc community!
Room: #3dgs
Re: C-Script problem... [Re: Joozey] #167842
11/17/07 16:15
11/17/07 16:15
Joined: Nov 2007
Posts: 18
J
JimmyJazz Offline OP
Newbie
JimmyJazz  Offline OP
Newbie
J

Joined: Nov 2007
Posts: 18
Yeah - although I call c_scan from within the player control loop. When I trigger the scan it triggers the action. The problem is I don't like using c_scan to manipulate objects...

Cheers - Jim.

Re: C-Script problem... [Re: JimmyJazz] #167843
11/17/07 16:16
11/17/07 16:16
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
I eddited my post in case you missed it


Click and join the 3dgs irc community!
Room: #3dgs
Re: C-Script problem... [Re: Joozey] #167844
11/17/07 16:26
11/17/07 16:26
Joined: Nov 2007
Posts: 18
J
JimmyJazz Offline OP
Newbie
JimmyJazz  Offline OP
Newbie
J

Joined: Nov 2007
Posts: 18
Still nothing! I put the beep in the action defintion as well as the event and it beeps three times when the world is first compiled (there are three entities with this behaviour so the action behaviour is registering properly) but when I click on the target nothing happens!

Cheers - Jim.

Re: C-Script problem... [Re: JimmyJazz] #167845
11/17/07 16:37
11/17/07 16:37
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
You do have a mouse function do you?

Code:

bmap mouse_pcx = "mouse_pcx";

function mouse() {
mouse_map = mouse_pcx;
mouse_mode = 1;

while (1) {
mouse_pos.x = pointer.x;
mouse_pos.y = pointer.y;
wait(1);
}
}




Click and join the 3dgs irc community!
Room: #3dgs
Re: C-Script problem... [Re: JimmyJazz] #167846
11/17/07 16:45
11/17/07 16:45
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
what does happen if you remove

player.pan -= (mouse_force.x * 24 * time);
tempTilt = (mouse_force.y * 8 * time);

it would be the problem if it still dont work its a other problem

and i maid a foult i hink

funtion main
{
mouse_mode = 1;
mouse_map = "pointer.bmp";
while(1)
{
mouse_pos.x = pointer.x;
mouse_pos.y = pointer.y;
wait(1);
}


"empty"
Re: C-Script problem... [Re: JimmyJazz] #167847
11/17/07 16:52
11/17/07 16:52
Joined: Aug 2005
Posts: 312
Sweden
tindust Offline
Senior Member
tindust  Offline
Senior Member

Joined: Aug 2005
Posts: 312
Sweden
Right, forgot.
OK, you're getting a lot of suggestions,
here is another one for the door action:

Code:

action doorControls
{
my.ENABLE_CLICK = ON;
if(me == mouse_ent && mouse_left == on)
{
my.event = manipulateDoor;
}
}


cheers

might need the while loop for this one though

Re: C-Script problem... [Re: tindust] #167848
11/17/07 17:28
11/17/07 17:28
Joined: Nov 2007
Posts: 18
J
JimmyJazz Offline OP
Newbie
JimmyJazz  Offline OP
Newbie
J

Joined: Nov 2007
Posts: 18
Nope! Neither one of those seems to resolve it - I've tried different uses of the mouse_ent object too.

One idea did spring to mind - is it possible to call the my.event function from the mouse_ent object? That way I could place the code to handle the mouse click within my player control loop and run it from there?

Just a thought...

Thanks again for your help guys, it is appreciated.

Cheers - Jim.

Page 2 of 3 1 2 3

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