Yeah I guess it depends on the situation… However I’m not too sure what mine is.
Well, perhaps it is a bit much to ask, but could you help me implement this into this script?:
import GameLogic as g
cont = g.getCurrentController()
own = cont.owner
scene = g.getCurrentScene()
dialogue1 = scene.objects["dialogue"]
dialogue2 = scene.objects["dialogue.001"]
dialogue3 = scene.objects["dialogue.002"]
dialogue4 = scene.objects["dialogue.003"]
dialogue5 = scene.objects["dialogue.004"]
dialogue6 = scene.objects["dialogue.005"]
dialogue7 = scene.objects["dialogue.006"]
dialogue8 = scene.objects["dialogue.007"]
dialogue9 = scene.objects["dialogue.008"]
dialogue10 = scene.objects["dialogue.009"]
def line(text):
dialogue10["Text"] = dialogue9["Text"]
dialogue9["Text"] = dialogue8["Text"]
dialogue8["Text"] = dialogue7["Text"]
dialogue7["Text"] = dialogue6["Text"]
dialogue6["Text"] = dialogue5["Text"]
dialogue5["Text"] = dialogue4["Text"]
dialogue4["Text"] = dialogue3["Text"]
dialogue3["Text"] = dialogue2["Text"]
dialogue2["Text"] = dialogue1["Text"]
dialogue1["Text"] = text
def dialogue():
clear = cont.sensors["clear"]
if clear.positive:
dialogue1["Text"] = ""
dialogue2["Text"] = ""
dialogue3["Text"] = ""
dialogue4["Text"] = ""
dialogue5["Text"] = ""
dialogue6["Text"] = ""
dialogue7["Text"] = ""
dialogue8["Text"] = ""
dialogue9["Text"] = ""
dialogue10["Text"] = ""
dialogue = cont.sensors["dialogue"]
if dialogue.positive:
id = int(dialogue.bodies[0])
sys = msgarray[id][0]
if str(msgarray[id][1]) .find(">") > 1:
line(str(msgarray[id][1]))
line(str(msgarray[id+1][1]))
else: line(str(msgarray[id][1]))
#messages ~80 characters
#1001+ = dialogue
msgarray = [
(0,"Single Line),
(0,"Single Line"),
(1,"\"Really Really Really Really Really Really Really Really Really Really Really... >"),
(1,"Really Really Really Really Really Really Really Really Really Long Message\"")]
It’s really a simple, self explanatory dialogue system I set up. There isn’t any input or anything yet, but I’m working on the output first.
The effect I need: when the line updates to one-by-one remove a character and replace it with one from the previous line.
So I guess you could use the same function to do that?
#add
own["Text"] = text[:own["textindex"]]
own["textindex"] += 1
#subtract
own["Text"] = text[:own["textindex"]]
own["textindex"] -= 1
The problem is that the function line() requires a tap, or else it just keeps scrolling lines…
Any ideas (I’m probably doing this entirely incorrectly)?