caspa Posted October 28, 2012 Group: Members Topic Count: 194 Topics Per Day: 0.04 Content Count: 499 Reputation: 3 Joined: 03/11/12 Last Seen: September 18, 2023 Share Posted October 28, 2012 (edited) - script bg_emp#control -1,{ OnInit: setarray .rewarditem, 673, 5; // reward to the winning team set .winningscore, 2; // final score to win set .eventlasting, 1200; // abort the system if there's no progress, 1200 seconds = 20 mins sleep 1; disablenpc .rednpcname$; disablenpc .bluenpcname$; end; OnStart: if ( getwaitingroomstate( 0, .rednpcname$ ) < .minplayer2start || getwaitingroomstate( 0, .bluenpcname$ ) < .minplayer2start ) end; set .red, waitingroom2bg( "bat_a01", 171,346, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead", .rednpcname$ ); copyarray .team1aid, $@arenamembers, $@arenamembersnum; set .blue, waitingroom2bg( "bat_a01", 162,50, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead", .bluenpcname$ ); copyarray .team2aid, $@arenamembers, $@arenamembersnum; delwaitingroom .rednpcname$; delwaitingroom .bluenpcname$; disablenpc .rednpcname$; disablenpc .bluenpcname$; bg_warp .red, "bat_a01", 171,346; bg_warp .blue, "bat_a01", 162,50; setwall "bat_a01", 154,51, 6, 4, 0, "bg_emp_town_blue"; setwall "bat_a01", 164,347, 6, 4, 0, "bg_emp_town_red"; bg_updatescore "bat_a01", 0, 0; sleep 6000; if ( .inprogress == 0 ) goto L_Abort; mapannounce "bat_a01", "Rules are simple. The first one to break the opponent's emperium will get a score.", 0; sleep 3000; if ( .inprogress == 0 ) goto L_Abort; mapannounce "bat_a01", "Score "+ .winningscore +" rounds to win ! ... GET READY", 0; sleep 2000; if ( .inprogress == 0 ) goto L_Abort; while (1) { for ( .@i = 5; .@i > 0; .@i-- ) { mapannounce "bat_a01", .@i +"", 0; sleep 1000; if ( .inprogress == 0 ) goto L_Abort; } if ( .score[1] == .winningscore -1 && .score[2] == .winningscore -1 ) mapannounce "bat_a01", "Final Round start!", 0; else mapannounce "bat_a01", "Round "+ .round++ +" start!", 0; bg_monster .red,"bat_a01",171,346, "--ja--",1915, strnpcinfo(3)+"::OnRedDown"; bg_monster .blue,"bat_a01",162,50, "--ja--",1914, strnpcinfo(3)+"::OnBlueDown"; delwall "bg_emp_town_red"; delwall "bg_emp_town_blue"; sleep .eventlasting * 1000; if ( .inprogress == 0 ) goto L_Abort; .score[ .winside ]++; bg_updatescore "bat_a01", .score[1], .score[2]; killmonster "bat_a01", strnpcinfo(3)+"::OnRedDown"; killmonster "bat_a01", strnpcinfo(3)+"::OnBlueDown"; if ( .winside ) mapannounce "bat_a01", .empkiller$ +" has Destroy "+( ( .winside == 1 )?"Blue":"Red" )+"'s side Emperium. "+( ( .winside == 1 )?"Red":"Blue" )+" team score a point !", 0; if ( .score[1] == .winningscore || .score[2] == .winningscore || !.winside ) break; sleep 5000; if ( .inprogress == 0 ) goto L_Abort; bg_warp .red, "bat_a01", 171,346; bg_warp .blue, "bat_a01", 162,50; setwall "bat_a01", 154,51, 6, 4, 0, "bg_emp_town_blue"; setwall "bat_a01", 164,347, 6, 4, 0, "bg_emp_town_red"; .winside = 0; } if ( .winside ) { mapannounce "bat_a01", ( ( .winside == 1 )?"Red":"Blue" )+" side wins !", 0; .@size = getarraysize( getd(".team"+ .winside +"aid") ); for ( .@i = 0; .@i < .@size; .@i++ ) getitem .rewarditem[0], .rewarditem[1], getd(".team"+ .winside +"aid["+ .@i +"]" ); } else mapannounce "bat_a01", "Time Out. Aborting the match.", 0; sleep 5000; L_Abort: bg_warp .red, "prontera", 155,182; bg_warp .blue, "prontera", 158,182; bg_destroy .red; bg_destroy .blue; delwall "bg_emp_town_red"; delwall "bg_emp_town_blue"; .round = .winside = .score[0] = .score[1] = .inprogress = 0; end; OnRedDown: callsub L_EmpDown, 2; OnBlueDown: callsub L_EmpDown, 1; L_EmpDown: .empkiller$ = strcharinfo(0); .winside = getarg(0); awake strnpcinfo(3); OnRedDead: OnBlueDead: end; } prontera,156,186,5 script gm_start 100,{ if ( getgmlevel() < 99 ) { mes "I only talk to gm"; close; } if ( getvariableofnpc( .inprogress, "bg_emp#control" ) ) { mes "abort ?"; next; if ( select ( "Yes", "No" ) == 2 ) close; awake "bg_emp#control"; killmonster "bat_a01", strnpcinfo(3)+"::OnRedDown"; killmonster "bat_a01", strnpcinfo(3)+"::OnBlueDown"; delwaitingroom getvariableofnpc( .rednpcname$, "bg_emp#control" ); delwaitingroom getvariableofnpc( .bluenpcname$, "bg_emp#control" ); disablenpc getvariableofnpc( .rednpcname$, "bg_emp#control" ); disablenpc getvariableofnpc( .bluenpcname$, "bg_emp#control" ); announce strcharinfo(0) +" has abort the battleground", 0; close; } mes "select how many players to start"; next; input .@a; if ( .@a == 0 || .@a > 30 ) close; set getvariableofnpc( .minplayer2start, "bg_emp#control" ), .@a; announce strcharinfo(0) +" has hosted "+ .@a +"vs"+ .@a +" battleground", 0; enablenpc getvariableofnpc( .rednpcname$, "bg_emp#control" ); enablenpc getvariableofnpc( .bluenpcname$, "bg_emp#control" ); donpcevent getvariableofnpc( .rednpcname$, "bg_emp#control" ) +"::OnStart"; donpcevent getvariableofnpc( .bluenpcname$, "bg_emp#control" ) +"::OnStart"; set getvariableofnpc( .inprogress, "bg_emp#control" ), 1; close; } prontera,155,182,5 script Red side#bg_emp 100,{ end; OnStart: waitingroom "Red side", getvariableofnpc( .minplayer2start, "bg_emp#control" ) +1, "bg_emp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_emp#control" ); end; OnInit: set getvariableofnpc( .rednpcname$, "bg_emp#control" ), strnpcinfo(0); end; } prontera,158,182,5 script Blue side#bg_emp 100,{ end; OnStart: waitingroom "Blue side", getvariableofnpc( .minplayer2start, "bg_emp#control" ) +1, "bg_emp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_emp#control" ); end; OnInit: set getvariableofnpc( .bluenpcname$, "bg_emp#control" ), strnpcinfo(0); end; } bat_a01 mapflag battleground 2 bat_a01 mapflag nosave SavePoint bat_a01 mapflag nowarp bat_a01 mapflag nowarpto bat_a01 mapflag noteleport bat_a01 mapflag nomemo bat_a01 mapflag nopenalty bat_a01 mapflag nobranch bat_a01 mapflag noicewall -Also, I'm using 3ceAm Edited October 28, 2012 by caspa Quote Link to comment Share on other sites More sharing options...
GM Takumirai Posted October 28, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 592 Reputation: 31 Joined: 11/14/11 Last Seen: July 29, 2015 Share Posted October 28, 2012 Theres a problem on line 31.. Quote Link to comment Share on other sites More sharing options...
Euphy Posted October 28, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted October 28, 2012 3CeAM doesn't support direct variable assignment, so use the 'set' command instead (or switch to rAthena). Quote Link to comment Share on other sites More sharing options...
caspa Posted October 28, 2012 Group: Members Topic Count: 194 Topics Per Day: 0.04 Content Count: 499 Reputation: 3 Joined: 03/11/12 Last Seen: September 18, 2023 Author Share Posted October 28, 2012 Is it possible for me to ask you sir Euphy to fix the script into 3ceAm File? Quote Link to comment Share on other sites More sharing options...
Euphy Posted October 29, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted October 29, 2012 use the 'set' command for(set .@i,5; .@i>0; set .@i,.@i-1) Quote Link to comment Share on other sites More sharing options...
Ryokem Posted October 29, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted October 29, 2012 (edited) EDIT: ups! XD Commands like var++; will not work. You have to use the full version: var = var + 1; Plus, as people says, 3CeAM doesn't support direct variable settings, so set command is actually needed. set .@a, <value>; for( set .@i, 0; .@i < 10; set .@i, .@i + 1 ) //Just sample values. set .@a, .@a + 1; Edited October 29, 2012 by Ryokem Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted October 29, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted October 29, 2012 (edited) I was the one who wrote that script http://rathena.org/b...ng/#entry148440 Actually, eAthena is not C++. Commands like var++; will not work. You have to use the full version: var = var + 1; I understand if you say var++ doesn't work, but has to use set var, var +1;but why you say var = var + 1; ? prontera,152,191,5 script woe 100,{ while ( .@i < 5 ) mes "Counting "+ .@i++; close; } it works you know or have you messed up this rathena forum and eathena forum ? I'm not going to adjust my script to compatible with other emulator after all this is rathena forum Edited October 29, 2012 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
caspa Posted October 29, 2012 Group: Members Topic Count: 194 Topics Per Day: 0.04 Content Count: 499 Reputation: 3 Joined: 03/11/12 Last Seen: September 18, 2023 Author Share Posted October 29, 2012 (edited) @ annie : ms. annie can you make this script usable into eathena SVN files or the 3ceAm SVN files plsssssss.......... =========================================================================================== Coz this is what i'll use for the GOTM =D Edited October 29, 2012 by caspa Quote Link to comment Share on other sites More sharing options...
Ryokem Posted October 29, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted October 29, 2012 I understand if you say var++ doesn't work, but has to use set var, var +1; but why you say var = var + 1; ? Was speaking about 3CeaM as he said he was using it. prontera,152,191,5 script woe 100,{ while ( .@i < 5 ) mes "Counting "+ .@i++; close; } it works you know Does it? .@i is supposed to be 0 and .@i++ is supposed to do the following: 1. execute the command in which it is called. 2. Increase the variable .@i by 1. So where's the "0"? The code you wrote would be recognized as (++.@i) from all imperial programming languages, unless the variable starts from 1. Actually, the output should be "0 1 2 3 4". or have you messed up this rathena forum and eathena forum ? Sure it can be xD I always have both opened xD Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted October 29, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted October 29, 2012 I'm don't have any programming background so I don't know anything about those .... blah blah language I just write that simple script out, and the screenshot tells me it gives me 1,2,3,4,5 that's all I know, and that's how I learned rathena scripting LMAO from what I understand, .@i++ also means ( set .@i, .@i +1 ) prontera,152,191,5 script woe 100,{ while ( .@i < 5 ) mes "Counting "+ .@i++; close; } prontera,154,191,5 script woe2 100,{ while ( .@i < 5 ) mes "Counting "+ set( .@i, .@i +1 ); close; } prontera,156,191,5 script woe3 100,{ while ( .@i < 5 ) { set .@i, .@i +1; mes "Counting "+ .@i; } close; } tested these 3 npcs gives me the same dialog if you think this is wrong ... then its rathena script engine error ? I dunno ... as I never learn any other programming language I learn scripting from what my test server told me, not from what others told me Quote Link to comment Share on other sites More sharing options...
caspa Posted October 29, 2012 Group: Members Topic Count: 194 Topics Per Day: 0.04 Content Count: 499 Reputation: 3 Joined: 03/11/12 Last Seen: September 18, 2023 Author Share Posted October 29, 2012 hahahahahahaha.................. this topic has become who know's the code more rather than fixing the script =D .................... BOOM!! Quote Link to comment Share on other sites More sharing options...
KeyWorld Posted October 29, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 379 Reputation: 304 Joined: 11/10/11 Last Seen: December 2, 2014 Share Posted October 29, 2012 hahahahahahaha.................. this topic has become who know's the code more rather than fixing the script =D .................... BOOM!! You already have the answer to fix your script Quote Link to comment Share on other sites More sharing options...
Euphy Posted October 29, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted October 29, 2012 hahahahahahaha.................. this topic has become who know's the code more rather than fixing the script =D .................... BOOM!! #5 Quote Link to comment Share on other sites More sharing options...
caspa Posted October 29, 2012 Group: Members Topic Count: 194 Topics Per Day: 0.04 Content Count: 499 Reputation: 3 Joined: 03/11/12 Last Seen: September 18, 2023 Author Share Posted October 29, 2012 my next error encounter Quote Link to comment Share on other sites More sharing options...
Euphy Posted October 29, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted October 29, 2012 my next error encounter Are you reading anything being posted in this topic? >.> var = x --> set var,x; var++ --> set var,var+1 var-- --> set var,var-1 Quote Link to comment Share on other sites More sharing options...
KeyWorld Posted October 29, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 379 Reputation: 304 Joined: 11/10/11 Last Seen: December 2, 2014 Share Posted October 29, 2012 Well: .@var++; // (set(.@var, .@var+1 )-1); .@var--; // (set(.@var, .@var-1 )+1); ++.@var; // set(.@var, .@var+1); --.@var; // set(.@var, .@var-1); .@var = x;// set .@var, x; // etc. Euphy: What the hell, Euphy faster and use "x" like me °°', scary ! 1 Quote Link to comment Share on other sites More sharing options...
caspa Posted October 29, 2012 Group: Members Topic Count: 194 Topics Per Day: 0.04 Content Count: 499 Reputation: 3 Joined: 03/11/12 Last Seen: September 18, 2023 Author Share Posted October 29, 2012 so i should put || set .score, [.winside]+1; || is this correct? Quote Link to comment Share on other sites More sharing options...
KeyWorld Posted October 29, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 379 Reputation: 304 Joined: 11/10/11 Last Seen: December 2, 2014 Share Posted October 29, 2012 so i should put || set .score, [.winside]+1; || is this correct? set .score[.winside], .score[.winside]+1; Quote Link to comment Share on other sites More sharing options...
caspa Posted October 29, 2012 Group: Members Topic Count: 194 Topics Per Day: 0.04 Content Count: 499 Reputation: 3 Joined: 03/11/12 Last Seen: September 18, 2023 Author Share Posted October 29, 2012 (edited) plss give me the conversion codes for the errors and the for set code on image number 2..... coz im a stupid person who cant understand even a simple variable changes............... thx in advanced Edited October 29, 2012 by caspa Quote Link to comment Share on other sites More sharing options...
Ryokem Posted October 29, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted October 29, 2012 if you think this is wrong ... then its rathena script engine error ?I dunno ... as I never learn any other programming language Nah, I just said rAthena is not C++ or other languages, that's all ^^ Just to let him know that not everything about the other programming languages is correct also on rAthena and viceversa. plss give me the conversion codes for the errors and the for set code on image number 2..... coz im a stupid person who cant understand even a simple variable changes............... thx in advanced The errors you are showing up are basically all the same. You can't change the value of a variable by a direct set if using 3CeaM unless you did implement it by yourself. So: <variable> = <value>; //This is not allowed in 3CeaM set <variable>, <value>; //This has the same meaning of the command above, but works in 3CeaM Same with your error: set .@size, getarraysize([...]); Also, line 61 (for cicle) presents the same error for( set .@i, 0; .@ i < .@size; set .@i, .@i + 1 ) Quote Link to comment Share on other sites More sharing options...
Question
caspa
-Also, I'm using 3ceAm

Edited by caspaLink to comment
Share on other sites
19 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.