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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Akow), 1,403 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
player select #430677
09/30/13 19:30
09/30/13 19:30
Joined: Aug 2013
Posts: 78
Nottingham
DuaneDawson Offline OP
Junior Member
DuaneDawson  Offline OP
Junior Member

Joined: Aug 2013
Posts: 78
Nottingham
can someone point me in the right direction.

I want to be able to click on a panel button, 1 for each character and it selects the character of button clicked on


cheers

Re: player select [Re: DuaneDawson] #430686
09/30/13 20:45
09/30/13 20:45
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Which part exactly is causing you trouble here?


Always learn from history, to be sure you make the same mistakes again...
Re: player select [Re: Uhrwerk] #430689
09/30/13 20:54
09/30/13 20:54
Joined: Aug 2013
Posts: 78
Nottingham
DuaneDawson Offline OP
Junior Member
DuaneDawson  Offline OP
Junior Member

Joined: Aug 2013
Posts: 78
Nottingham
hi i have made the buttons, and have 4 characters.


but i don't know what function to call when i click
on the buttons for it to change between characters.

Re: player select [Re: DuaneDawson] #430692
09/30/13 21:43
09/30/13 21:43
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Totally depends on how you realized your characters and what selecting a character means to you. You could for example set the player pointer to the selected character....


Always learn from history, to be sure you make the same mistakes again...
Re: player select [Re: Uhrwerk] #430693
09/30/13 21:56
09/30/13 21:56
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
You could create a var (let's say 'charType'), and then change it depending on the button, that was pressed (from 1 to 4, as you have 4 characters). And then via 'ent_create' (or via 'ent_merph' if player already exist) you can create a character, but depending on the variable ('charType'), this is just a basic idea.

Greets


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: player select [Re: Uhrwerk] #430694
09/30/13 21:58
09/30/13 21:58
Joined: Aug 2013
Posts: 78
Nottingham
DuaneDawson Offline OP
Junior Member
DuaneDawson  Offline OP
Junior Member

Joined: Aug 2013
Posts: 78
Nottingham
hi

I made one player movement script,
and save it 4 times with each character names, and set the player action under each script - action character name ()

I can select each character with the mouse,
but I also want to select when clicking on a button.

I try this code to select just 1 character, but I just keep getting this message when I run.

engine crash in player1_click.


here is the code.

Code:
function player1_click()
{
	
 player = my;
	
 
   my.emask |= ENABLE_CLICK; // lite-C
   my.event = player1_select;
}

action player1_select()
{
    if (player == my) {return;} // don't make the switch if the actual player is clicked again

       player = my;

       camera.pan = my.pan; // start with a proper camera orientation
	
	
}


Re: player select [Re: DuaneDawson] #430698
09/30/13 23:34
09/30/13 23:34
Joined: Aug 2013
Posts: 78
Nottingham
DuaneDawson Offline OP
Junior Member
DuaneDawson  Offline OP
Junior Member

Joined: Aug 2013
Posts: 78
Nottingham
hi

I added a pointer

ENTITY* player1;

at the top of the player1 script.

and player1 = my;

at the start of the action player1()

but when I run I get the error message

script crash in event.

Re: player select [Re: DuaneDawson] #430738
10/01/13 11:11
10/01/13 11:11
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Well, if you have a crash in a script and want some help with it posting that script might be a good idea...


Always learn from history, to be sure you make the same mistakes again...
Re: player select [Re: Uhrwerk] #430781
10/01/13 22:38
10/01/13 22:38
Joined: Aug 2013
Posts: 78
Nottingham
DuaneDawson Offline OP
Junior Member
DuaneDawson  Offline OP
Junior Member

Joined: Aug 2013
Posts: 78
Nottingham
hi
I fixed the pointer problem, and git it working.
that when when click on the button its snaps to the player
with this code.

function player1_click()
{

while(player1)
{

vec_set(camera.x,player.x); // set a static position for the camera
vec_set(camera.pan,player.pan); // set the correct orientation for the camera




wait(1);
}

}

but there is a problem, it snaps to the player and places the camera at its feet
and I need it to snap above with the camera looking down on the character.

cheers


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