For the man who can't talk on russian

 
+
-
edit
 

donkey
donkey3

новичок
Sorry for i open this topic,but i need a tutorial for jbforth and jython and greenhope and the oder sent to you. I probiere get out some information from your write but i cant understand.Can you write a short description about a little beginners quest in jbforth and in jython.Andthen just the importtant command.

thank you in anticipation

Donkey
 
+
-
edit
 

donkey
donkey3

новичок
I write the enviroment but i break on the part of onEvent onTalk onKill:

i write this:

def onTalk (Self,npc,st):

npcId = npc.getNpcId()
htmltext = "<html><head><body>I have nothing to say to you.</body></html>"
if npcId = TEN_TEN
if st.setState(CREATED)
return "<html><body>Hello i am ten ten!</body><html>"


and it not work why?
 
+
-
edit
 

masterXL

разработчик OpenWorlds
i think u can make easy quest or event with forth. jython to hard and not flexible like a froth
Трудно быть богом... Не веришь? Спроси любого админа! можешь спросить у меня 175506816 ServerIP=193.41.172.19 Перенос доступен  

Murkt

Pythoneer

if st.setState(CREATED) - wrong
hmmm... maybe?

if st.getState == CREATED
or you need
if st.getState == STARTING

чёрт, на английском что-то написать - нереально.

and, masterXL is right - JBForth more flexible.
[team Їжачки - сумні падлюки]  
+
-
edit
 

masterXL

разработчик OpenWorlds
and maybe add -> addStartNPC(id)?
show all text of your's quest
Трудно быть богом... Не веришь? Спроси любого админа! можешь спросить у меня 175506816 ServerIP=193.41.172.19 Перенос доступен  

Styx

разработчик l2j-сервера
Or maybe because whitespaces do have a meaning in Jython? ;)
...and what better way to say goodbye than to kill everyone in sight? © Syntari  
+
-
edit
 

Pautina

новичок
And rename topic to "English for dummies"

Будет где в английском поупражняться.. :)
Если ... то ... иначе ... всё.  
+
-
edit
 

donkey
donkey3

новичок
print "importing quest: custom 50: myquest quest"
import sys
from net.sf.l2j.gameserver.model.quest import State
from net.sf.l2j.gameserver.model.quest import QuestState
from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest

TEN_TEN = 8206

class Quest (JQuest) :

def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

onTalk (Self,npc,st):
npcId = npc.getNpcId()
htmltext = "<html><head><body>I have nothing to say to you.</body></html>"
if npcId = TEN_TEN :
if st.setState(CREATED) :
return "<html><body>Hello i am ten ten!</body><html>"


QUEST = Quest(50,"50_myquest","custom")
CREATED = State('Start', QUEST)
STARTED = State('Started', QUEST)
COMPLETED = State('Completed', QUEST)

QUEST.setInitialState(CREATED)

QUEST.addStartNpc(TEN_TEN)

CREATED.addTalkId(TEN_TEN)
 
+
-
edit
 

donkey
donkey3

новичок
so give a little help how can i write it in forth? its just a little quest not a lot of time :)
 

Murkt

Pythoneer

at first, Python (and Jython, of course) uses whitespaces (spaces and tabs) as logical formatting

so
code python
  1. onTalk (Self,npc,st):
  2.   npcId = npc.getNpcId()
  3.     htmltext = "<html><body>I have nothing to say to you.</body></html>"
  4.     if npcId = TEN_TEN :
  5.       if st.setState(CREATED) :
  6.         return "<html><body>Hello i am ten ten!</body><html>"


and NEVER use construction like this
<html><head><body>
In Lineage 2 you don't need the <head> tag in hypertext. But this construction can make client crazy.
[team Їжачки - сумні падлюки]  
+
-
edit
 

donkey
donkey3

новичок
now my quest look like this:

print "importing quest: custom 50: sajat quest"
import sys
from net.sf.l2j.gameserver.model.quest import State
from net.sf.l2j.gameserver.model.quest import QuestState
from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest


class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

def onTalk (self,npc,st):
return "<html><body>asdasdI have nothing to say to you</body></html>"


QUEST = Quest(50,"50_sajat","custom")
CREATED = State('Start', QUEST)
COMPLETED = State('Completed', QUEST)

QUEST.setInitialState(CREATED)

QUEST.addStartNpc(405)

CREATED.addTalkId(405)

and this load in the server but when i click to the quest button dont do anything..
why?
 
+
-
edit
 

masterXL

разработчик OpenWorlds
Do u add a string about new qest on root folder in the init.py?
_all_ = [
'1006_tattoos',
'3995_echo',
'5000_crystal',
'5005_scroll',
'9987_aa',
'50_sajat' \ <= this your's new quest
]
print ""
print "importing custom data ..."
from data.jscript.custom import *
print "... done"
print ""
Трудно быть богом... Не веришь? Спроси любого админа! можешь спросить у меня 175506816 ServerIP=193.41.172.19 Перенос доступен  
+
-
edit
 

donkey
donkey3

новичок
yes the server is load the quest .It print when it load but the npc doesn't talk
 

Murkt

Pythoneer

As i told you, you need to correct format your quest

code text
  1. print "importing quest: custom 50: sajat quest"
  2. import sys
  3. from net.sf.l2j.gameserver.model.quest import State
  4. from net.sf.l2j.gameserver.model.quest import QuestState
  5. from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest
  6.  
  7. class Quest (JQuest) :
  8.     def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
  9.  
  10.     def onTalk (self,npc,st):
  11.         return "<html><body>asdasdI have nothing to say to you</body></html>"
  12.  
  13. QUEST = Quest(50,"50_sajat","custom")
  14. CREATED = State('Start', QUEST)
  15. COMPLETED = State('Completed', QUEST)
  16.  
  17. QUEST.setInitialState(CREATED)
  18.  
  19. QUEST.addStartNpc(405)
  20.  
  21. CREATED.addTalkId(405)
[team Їжачки - сумні падлюки]  
AD Реклама Google — средство выживания форумов :)
+
-
edit
 

donkey
donkey3

новичок
i know what my problem.I make the python file in eclipse and it show what conenct with what.And my problem was the def on talk line connect to nothing and it must conenct to the "class Quest (JQuest) : " line.So i can begin with to space like "def __init...." line.

THX murkt for the help, if i need help in the future i know where must i go :)
 

в начало страницы | новое
 
Поиск
Настройки
Твиттер сайта
Статистика
Рейтинг@Mail.ru