Jump to content
  • 0

Single player instance.


gekigengar

Question


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   2
  • Joined:  08/30/13
  • Last Seen:  

I wonder if a single player instance is possible? (Without check party).

 

It would be lovely if it is, could give players a private dungeon.

 

If yes, how do I do it?

Edited by gekigengar
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Instances are attached to parties, so you can't create one without having a party.

However, you can easily work around this: ensure that the player does not have a party before creating/entering the instance, and let the NPC create the party. Like this: [paste=1941ov47vbzx]

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   2
  • Joined:  08/30/13
  • Last Seen:  

Instances are attached to parties, so you can't create one without having a party.

However, you can easily work around this: ensure that the player does not have a party before creating/entering the instance, and let the NPC create the party. Like this: [paste=1941ov47vbzx]

Thanks Euphy!

 

May I ask what is "while (1)"?

 

It seems like something that will run infinitely without an exit sentinel (But somehow it works!)

Edited by gekigengar
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

May I ask what is "while (1)"?

 

It seems like something that will run infinitely without an exit sentinel (But somehow it works!)

Here's the code, commented:

	// The 'while' statement will loop infinitely (since '1' is always true)
	// until a 'break' statement is reached, or the server detects an infinite
	// loop (related to check_gotocount).
	while (1) {
		// This tries to pick a random party name that is unlikely to exist
		// ("i50928", "i18735", etc.).
		.@name$ = "i" + rand(100000);

		// 'party_create' returns '1' if the party was successfully created.
		// If it succeeds, break out of the loop.
		// If it fails, try again with a different party name.
		if (party_create(.@name$) > 0)
			break;
	}
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   2
  • Joined:  08/30/13
  • Last Seen:  

 

May I ask what is "while (1)"?

 

It seems like something that will run infinitely without an exit sentinel (But somehow it works!)

Here's the code, commented:

	// The 'while' statement will loop infinitely (since '1' is always true)
	// until a 'break' statement is reached, or the server detects an infinite
	// loop (related to check_gotocount).
	while (1) {
		// This tries to pick a random party name that is unlikely to exist
		// ("i50928", "i18735", etc.).
		.@name$ = "i" + rand(100000);

		// 'party_create' returns '1' if the party was successfully created.
		// If it succeeds, break out of the loop.
		// If it fails, try again with a different party name.
		if (party_create(.@name$) > 0)
			break;
	}

Thank you very much!, I understand the others, but the while loop confuses me, But now I understand that one can break through a while loop using the "break;" function :P

 

I appreciate the explanation ^^

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...