Page 2 of 5

Re: Unnamed RPG

Posted: Wed Feb 01, 2012 10:24 am
by Candlejack
Okay I don't know why I asked that, I didn't sleep last night so my thinking is sub-par.

So will I have to string a bunch of GetLocalPlayer()'s together?

Should I use a whole bunch of Else If statements one after another?
I'm not sure how to go about this since I suck at JASS :D

Re: Unnamed RPG

Posted: Wed Feb 01, 2012 10:27 am
by 3ICE
What are you trying to achieve again?

Here are two code snippets I commonly use:

Code: Select all

DisplayTextToPlayer(GetLocalPlayer(),0,0,"Hello World") //in my opinion the best way to display a message to all players.

Code: Select all

if(GetTriggerPlayer()==GetLocalPlayer())then
    //do stuff locally for that player only, eg. create or destroy a quest
endif
I didn't syntax check these code snippets, so error may happen.

Re: Unnamed RPG

Posted: Wed Feb 01, 2012 10:46 am
by Candlejack
Can I just use Custom Scripts inside my GUI?

Custom Script: if GetLocalPlayer() == GetOwningPlayer(GetBuyingUnit()) then
Quest - Create Quest
Custom Script: endif

Would something like this work or would it cause de-syncs or something?

Re: Unnamed RPG

Posted: Wed Feb 01, 2012 10:49 am
by 3ICE
Well, if you must... But half GUI half JASS is pure barbarism.

It will, however, work fine. As long as you don't do anything fancy in between. Check the generated code for inconsistencies.

Edit: And be aware what desyncs and what doesn't. Creating a quest will probably desync, so the way to do it is create the quest and hide it, then show it for the desired player inside a GetLocalPlayer() block.

Re: Unnamed RPG

Posted: Wed Feb 01, 2012 10:57 am
by Candlejack
I would do it in pure JASS if i knew how but I can't make anything of it.

I think I have the trigger figured out but I'd like to test it on b.net before posting it again to make no de-syncs occur.

It'll probably take an hour for someone to actually join the game though. x.x

Re: Unnamed RPG

Posted: Wed Feb 01, 2012 10:58 am
by 3ICE
Which server are you on? Set it in your profile.

Re: Unnamed RPG

Posted: Wed Feb 01, 2012 11:03 am
by Candlejack
US@East

I'll be in channel WaffleFace

Re: Unnamed RPG

Posted: Wed Feb 01, 2012 11:04 am
by 3ICE
Added WaffleFace to my friends list.

Edit: So, playtesting results:

Blue doesn't start with gold.
Blue can't buy a hero even after given gold via shared resources.
Desync upon quest accept. Mixing GUI with JASS is a bad idea. Post the related JASS code (Convert to JASS)
PJASS in notepad: t=726

Re: Unnamed RPG

Posted: Wed Feb 01, 2012 11:21 am
by Candlejack
if GetLocalPlayer() == GetOwningPlayer(GetBuyingUnit()) then
    call CreateQuestBJ( bj_QUESTTYPE_OPT_DISCOVERED, "TRIGSTR_176", "TRIGSTR_177", "ReplaceableTextures\\CommandButtons\\BTNAmbush.blp" )
endif

Re: Unnamed RPG

Posted: Wed Feb 01, 2012 11:23 am
by 3ICE
3ICE wrote:Creating a quest will probably desync, so the way to do it is create the quest and hide it, then show it for the desired player inside a GetLocalPlayer() block.
t_lea Quest - Disable Quest
Disabled quests are not shown in the quest log.