Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Waiting... (https://forums.graalonline.com/forums/showthread.php?t=22946)

lordhelmut 02-03-2002 04:21 PM

Waiting...
 
Would it be possible, maybe like on the old multiplayer games to make it so if one player starts an event (2p event) a message pops up saying waiting... and it waits for another player to join? I was just thinking how cool that would be

joseyisleet 02-03-2002 04:35 PM

most likely if you set some variables. something like this:

if (playerchats&&strequals(#c,play event)){
if (this.player==0){
this.playery+=1;
message Waiting for next player.;
} else if (this.player==1){
this.player+=1;
message 2 players are now in.
doEvent();
}
}
function doEvent(){
<your event here>;
}

Most likely something like that
or you could use setstring.

aller05 02-03-2002 05:51 PM

it wud

lordhelmut 02-03-2002 11:29 PM

whats the code to check the current gani of the player?

Python523 02-04-2002 01:33 AM

Quote:

Originally posted by lordhelmut
whats the code to check the current gani of the player?
try strequals(#m,)

Goboom 02-04-2002 01:49 AM

i have fun with this code!
if (created){
toweapons -ani checker;
timeout=0.05;}
if (timeout){
setplayerprop #c,#m;
timeout=0.05;}
its simple but ammusing

lordhelmut 02-04-2002 11:12 AM

Quote:

Originally posted by Goboom
i have fun with this code!
if (created){
toweapons -ani checker;
timeout=0.05;}
if (timeout){
setplayerprop #c,#m;
timeout=0.05;}
its simple but ammusing

*amuses self with silly NPC for hours on end*

lordhelmut 02-04-2002 11:15 AM

SetFocus
 
I think there are SetFocus problems...

i did this...

// NPC made by Lord Helmut
if (created) {
x+=.4;
y+=.7;
}
if(playerenters){
timeout=.05;
}
if (playertouchsme&&keydown(6)) {
setfocus 31,28;
disabledefmovement;
playersprite=19;
}
if (timeout&&keydown(5)) {
resetfocus;
enabledefmovement;
timeout=.05;
}

no matter what I try I cant get it to unset the focus and for some reason u have to hold A and run at the NPC for it to setfocus =/

lordhelmut 02-04-2002 11:22 AM

for now its a image (button) on a wall and if they touch it and hit a its supposed to setfocus and if they hit s it needs to unset the focus but its not working =/

lordhelmut 02-04-2002 11:36 AM

o damn, is that easy to fix?

Saga2001 02-04-2002 12:02 PM

better:
NPC Code:

timeout=0.05;
if (playerenters){
toweapons -ani checker;
if (timeout)
timeout=0.05;
setplayerprop #c,#m;



i dunno y i posted that, but i love it...

lordhelmut 02-04-2002 12:05 PM

Quote:

Originally posted by Kaimetsu


Sure, there are lots of ways around it. Wait for a playertouchsme and then keep some sort of potentia ready for if they do press A, removing it if they move, maybe. Monitor A and whenever it is pressed check if the player is close enough to the button for him to press it, possibly. There are lots of ways. I'd personally advocate the latter, but I'm just giving you options.

only way i can think of is to put some kind of timeout maybe that checks if they are touching it and pressing a?

Saga2001 02-05-2002 12:18 AM

yay! i will help ya out lh.


All times are GMT +2. The time now is 10:32 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.