SSH, i already figured that out when scorpiopus posted first.
still haven't figured reload...
Anyway: Left click is suppose to be fire.(look). Right click is reloads(walk). I put the objects to 'any click on object' so it would react to all but walk. I didn't put hide player as if you do that, there is no walk cursor.
New problem: The obects won't come up! function room_b() is suppose to make the obects come up, but it doesn't...this happened after i tried to make a 'shortcut' the riskshot.
int shum = 0; //nothing important. Random string
int chooser = 0; //what object is next
int mouse_clicks = 0; //mouse clicks
int gak = 0; //shot
int lives = 5; //lives
int riskshot = 0; //on if shot
function on_mouse_click(int button) {
if (IsGamePaused() == 1) {
// Game is paused, so do nothing (ie. don't allow mouse click)
}
else if (button==LEFT) {
ProcessClick(mouse.x, mouse.y, GetCursorMode() );
mouse_clicks = mouse_clicks + 1; // increasing mouse click counter
if (mouse_clicks < 9) {
PlaySound(1);
}
if (mouse_clicks == 0) {
SetObjectGraphic(3,10);
SetCursorMode(MODE_LOOK);
}
if (mouse_clicks == 1) { //changes graphics with number of
SetObjectGraphic(3,11);//clicks. Changes the ammo thing.
}
if (mouse_clicks == 2) {
SetObjectGraphic(3,12);
}
if (mouse_clicks == 3) {
SetObjectGraphic(3,13);
}
if (mouse_clicks == 4) {
SetObjectGraphic(3,14);
}
if (mouse_clicks == 5) {
SetObjectGraphic(3,15);
}
if (mouse_clicks == 6) {
SetObjectGraphic(3,16);
}
if (mouse_clicks == 7) {
SetObjectGraphic(3,17);
}
if (mouse_clicks == 8) {
SetObjectGraphic(3,18);
SetTimer(9, 50);
SetCursorMode(MODE_WALK);
DisableCursorMode(MODE_LOOK);
mouse_clicks = 10;
}
}
else { // right-click, so cycle cursor
shum = mouse_clicks * 10 + 15;
SetTimer(9, shum);
SetCursorMode(MODE_WALK); //when right clicked re-loads
DisableCursorMode(MODE_LOOK); //sets the time it takes to reload
mouse_clicks = 10;
}
}
// called when a mouse button is clicked. button is either LEFT or RIGHT
function repeatedly_execute() {
if (IsTimerExpired(9)==1){ //when the reload timer is up
mouse_clicks = 0;
EnableCursorMode(MODE_LOOK);
SetCursorMode(MODE_LOOK);
SetObjectGraphic(3,10);
}
if (gak == 1){
gak = 0;
lives --;
if (lives == 5) {
SetObjectGraphic(4,22);
}
if (lives == 4) {
SetObjectGraphic(4,23);
}
if (lives == 3) {
SetObjectGraphic(4,24);
}
if (lives == 2) {
SetObjectGraphic(4,25);
}
if (lives == 1) {
SetObjectGraphic(4,26);
}
if (lives == 0) {
SetObjectGraphic(4,27);
}
if (lives < 0) {
SetObjectGraphic(4,27);
}
}
}
function room_b() {
// script for room: Repeatedly execute
if (riskshot == 1){
if (IsTimerExpired(1) == 1){
gak = 1;
riskshot = 0;
}
}
if (chooser == 0){
SetObjectGraphic(0,6);
MoveObjectDirect(0,70,103,1);
SetTimer (1, 80);
riskshot = 1;}
if (chooser == 1){
SetObjectGraphic(1,6);
MoveObjectDirect (1,12,103,1);
SetTimer (1, 80);
riskshot = 1;
}
if (chooser == 2) {
SetObjectGraphic(5, 6);
MoveObjectDirect (5,219,113,2);
SetTimer (1,60);
riskshot = 1;
}
}
function object0_a() {
// script for object0: Any click on object
SetObjectGraphic(0,8);
MoveObjectDirect (0,68,126,1);
chooser = 2;
}
function object1_a() {
// script for object1: Any click on object
SetObjectGraphic(1,8);
MoveObjectDirect (1,13,127,1);
chooser = 3;
}
function room_c() {
// script for room: Player enters screen (before fadein)
SetCursorMode(MODE_LOOK);
}
function object4_a() {
// script for object4: Look at object
SetTimer(9, 80);
SetCursorMode(MODE_WALK);
DisableCursorMode(MODE_LOOK);
mouse_clicks = 10;
}
still haven't figured reload...
Anyway: Left click is suppose to be fire.(look). Right click is reloads(walk). I put the objects to 'any click on object' so it would react to all but walk. I didn't put hide player as if you do that, there is no walk cursor.
New problem: The obects won't come up! function room_b() is suppose to make the obects come up, but it doesn't...this happened after i tried to make a 'shortcut' the riskshot.
int shum = 0; //nothing important. Random string
int chooser = 0; //what object is next
int mouse_clicks = 0; //mouse clicks
int gak = 0; //shot
int lives = 5; //lives
int riskshot = 0; //on if shot
function on_mouse_click(int button) {
if (IsGamePaused() == 1) {
// Game is paused, so do nothing (ie. don't allow mouse click)
}
else if (button==LEFT) {
ProcessClick(mouse.x, mouse.y, GetCursorMode() );
mouse_clicks = mouse_clicks + 1; // increasing mouse click counter
if (mouse_clicks < 9) {
PlaySound(1);
}
if (mouse_clicks == 0) {
SetObjectGraphic(3,10);
SetCursorMode(MODE_LOOK);
}
if (mouse_clicks == 1) { //changes graphics with number of
SetObjectGraphic(3,11);//clicks. Changes the ammo thing.
}
if (mouse_clicks == 2) {
SetObjectGraphic(3,12);
}
if (mouse_clicks == 3) {
SetObjectGraphic(3,13);
}
if (mouse_clicks == 4) {
SetObjectGraphic(3,14);
}
if (mouse_clicks == 5) {
SetObjectGraphic(3,15);
}
if (mouse_clicks == 6) {
SetObjectGraphic(3,16);
}
if (mouse_clicks == 7) {
SetObjectGraphic(3,17);
}
if (mouse_clicks == 8) {
SetObjectGraphic(3,18);
SetTimer(9, 50);
SetCursorMode(MODE_WALK);
DisableCursorMode(MODE_LOOK);
mouse_clicks = 10;
}
}
else { // right-click, so cycle cursor
shum = mouse_clicks * 10 + 15;
SetTimer(9, shum);
SetCursorMode(MODE_WALK); //when right clicked re-loads
DisableCursorMode(MODE_LOOK); //sets the time it takes to reload
mouse_clicks = 10;
}
}
// called when a mouse button is clicked. button is either LEFT or RIGHT
function repeatedly_execute() {
if (IsTimerExpired(9)==1){ //when the reload timer is up
mouse_clicks = 0;
EnableCursorMode(MODE_LOOK);
SetCursorMode(MODE_LOOK);
SetObjectGraphic(3,10);
}
if (gak == 1){
gak = 0;
lives --;
if (lives == 5) {
SetObjectGraphic(4,22);
}
if (lives == 4) {
SetObjectGraphic(4,23);
}
if (lives == 3) {
SetObjectGraphic(4,24);
}
if (lives == 2) {
SetObjectGraphic(4,25);
}
if (lives == 1) {
SetObjectGraphic(4,26);
}
if (lives == 0) {
SetObjectGraphic(4,27);
}
if (lives < 0) {
SetObjectGraphic(4,27);
}
}
}
function room_b() {
// script for room: Repeatedly execute
if (riskshot == 1){
if (IsTimerExpired(1) == 1){
gak = 1;
riskshot = 0;
}
}
if (chooser == 0){
SetObjectGraphic(0,6);
MoveObjectDirect(0,70,103,1);
SetTimer (1, 80);
riskshot = 1;}
if (chooser == 1){
SetObjectGraphic(1,6);
MoveObjectDirect (1,12,103,1);
SetTimer (1, 80);
riskshot = 1;
}
if (chooser == 2) {
SetObjectGraphic(5, 6);
MoveObjectDirect (5,219,113,2);
SetTimer (1,60);
riskshot = 1;
}
}
function object0_a() {
// script for object0: Any click on object
SetObjectGraphic(0,8);
MoveObjectDirect (0,68,126,1);
chooser = 2;
}
function object1_a() {
// script for object1: Any click on object
SetObjectGraphic(1,8);
MoveObjectDirect (1,13,127,1);
chooser = 3;
}
function room_c() {
// script for room: Player enters screen (before fadein)
SetCursorMode(MODE_LOOK);
}
function object4_a() {
// script for object4: Look at object
SetTimer(9, 80);
SetCursorMode(MODE_WALK);
DisableCursorMode(MODE_LOOK);
mouse_clicks = 10;
}