Jump to content

Renewal Make Quest


Recommended Posts

M2 Download Center

This is the hidden content, please
( Internal )

This is the hidden content, please
( GitHub )

Hi everyone!

There is a simple renewal make.sh for qc file:

716f22f8784258197ebd85530cafbea0.png

 

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 46
  • Eyes 2
  • Angry 1
  • Sad 1
  • Think 1
  • Scream 1
  • Lmao 1
  • Good 10
  • Love 1
  • Love 27
Link to comment
Share on other sites

  • Forum Moderator

I don't see the reason why you would do that, but it's fine, here's the python version if someone wants it.

This is the hidden content, please

Edited by VegaS™
  • Metin2 Dev 31
  • Sad 1
  • Smile Tear 1
  • Think 1
  • Confused 1
  • Good 3
  • Love 2
  • Love 31
Link to comment
Share on other sites

  • 2 weeks later...
  • Forum Moderator
On 12/10/2019 at 11:58 PM, Morpheus™ said:

Could somebody write on quest_list?

Not tested, i'm not at home.

What's new:

  • You can use comment sections in locale_list, helps you to identify much faster the quests.
  • Two methods of reading, if you enable QC_READ_FILE_FROM_LIST, all of the quests from locale_list will be compiled, if you enable QC_READ_ALL, all of the quests file from specific directory (folders/sub-folders) will be compiled.

How-To-Use:

  • python make.py

This is the hidden content, please

  • Metin2 Dev 17
  • Think 1
  • Good 2
  • Love 2
  • Love 15
Link to comment
Share on other sites

  • 3 weeks later...
Spoiler
On 12/11/2019 at 12:19 PM, VegaS™ said:

Not tested, i'm not at home.

What's new:

  • You can use comment sections in locale_list, helps you to identify much faster the quests.
  • Two methods of reading, if you enable QC_READ_FILE_FROM_LIST, all of the quests from locale_list will be compiled, if you enable QC_READ_ALL, all of the quests file from specific directory (folders/sub-folders) will be compiled.

How-To-Use:

  • python make.py


#! /usr/bin/env python
# -*- coding: utf-8 -*-
__author__  = "VegaS"
__date__    = "2019-12-11"
__version__ = "0.0.1"

import os
import subprocess

os.chdir(os.path.dirname(os.path.realpath(__file__)))

QC_READ_FILE_FROM_LIST = 0
QC_READ_ALL = 1

"""
# QC_READ_FILE_FROM_LIST
# Read the locale_list with all quest/lua files.
"""
# The file with all quest file names.
QC_FILE_NAME = 'locale_list'

"""
# QC_READ_ALL
# Find all of the quest/lua files from root directory
"""
# Directory path of searching quest file names
QC_ROOT_PATH = '.'
# File extensions to be search
QC_EXTENSION_LIST = ('.lua', '.quest')

"""
# General configuration
"""
# Command of quest compiler
QC_COMMAND_STRING = './qc {}'
# Comment string
QC_COMMENT_CHARACTER = '#'
# Default state
QC_READ_STATE = QC_READ_FILE_FROM_LIST

def find_quest_files(type):
	"""
	Generate all of the file names by specific type.
	:param type: int
	:return: generator
	"""
	if type == QC_READ_FILE_FROM_LIST:
		with open(QC_FILE_NAME, 'r') as file:
			for fileName in file.readlines():
				if fileName.strip():
					yield fileName
	elif type == QC_READ_ALL:
		for root, dirs, files in os.walk(QC_ROOT_PATH):
			for fileName in files:
				if fileName.endswith(QC_EXTENSION_LIST):
					yield "{}/{}".format(root, fileName)

def strip_quest_file_name(fileName):
	"""
	Strip file name, ignore the commented sections.
	:param fileName: string
	:return: string
	"""
	fileName = fileName.strip()
	if QC_COMMENT_CHARACTER in fileName:
		fileName = fileName.split(QC_COMMENT_CHARACTER)[0].strip()
	return fileName

def main():
	QC_LOG_DICT = {'ok': 0, 'error': 0}
	for fileName in find_quest_files(QC_READ_STATE):
		fileName = strip_quest_file_name(fileName)
		if fileName:
			hasCompiled = subprocess.call(QC_COMMAND_STRING.format(fileName), shell=True) == 0
			QC_LOG_DICT['ok' if hasCompiled else 'error'] += 1

	print ('All quests are compiled, succeeded: {}, failed: {}.'.format(*QC_LOG_DICT.values()))

if __name__ == "__main__":
	main()

it doesnt works when your quest have defines before the state start :D

 

xxxxxx/Flammenrun.quest:1:must start with 'quest'

 

f36ad84043.png

 

and yours doesnt tells you where it failed, u have to scroll the whole console up to the error, because it doesnt stop there or even tell you where it fails. you have to find it in the console by yourself :D

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Forum Moderator
On 12/29/2019 at 10:52 PM, Mafuyu said:

it doesnt works when your quest have defines before the state start :D

xxxxxx/Flammenrun.quest:1:must start with 'quest'

 

You've to use pre_qc.py or make some changes on your qc core for enable defines in quests.

 

On 12/29/2019 at 10:52 PM, Mafuyu said:

and yours doesnt tells you where it failed, u have to scroll the whole console up to the error, because it doesnt stop there or even tell you where it fails. you have to find it in the console by yourself :D

 

Updated, check my previous reply again.

  • Love 2
Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.