Page 1 of 1

Doors with switch Problem

Posted: Thu Apr 05, 2007 12:19 pm
by Redline
Hello Everyone, i have a problem about doors with switch.
,because the door don,t open (by the destruction of the switch)

Here is my Lua-entry:
(from the switch and the door)

conquest:Start()


OnObjectKillName(PlayAnimRaise, "schalter");
OnObjectRespawnName(PlayAnimDrop, "schalter");

OnObjectKillName(PlayAnimRaise1, "shieldschalter");
OnObjectRespawnName(PlayAnimDrop1, "shieldschalter");

EnableSPHeroRules()


--START BRIDGEWORK!

-- OPEN
function PlayAnimRaise()
PauseAnimation("drop");
RewindAnimation("raise");
PlayAnimation("raise");


end
-- CLOSE
function PlayAnimDrop()
PauseAnimation("raise");
RewindAnimation("drop");
PlayAnimation("drop");


end

PS : All Animations in the Zero-edit done.

What is the problem ? PLs help

RE: Doors with switch Problem

Posted: Thu Apr 05, 2007 1:43 pm
by [RDH]Zerted
Add ShowMessageText("") to your fuctions. Use this to make sure they are getting called. The code should display "[Null]" ingame.

Posted: Thu Apr 05, 2007 3:29 pm
by Redline
I try it and this with ShowMessageText("") is a good idea for my Rebuplic Commander map ^^ :)

Ps : Where write i the text for the ShowMessageText("")

Posted: Fri Apr 06, 2007 1:43 am
by [RDH]Zerted
OnObjectKillName(PlayAnimRaise, "schalter");
OnObjectRespawnName(PlayAnimDrop, "schalter");
ShowMessageText("Count 1")

OnObjectKillName(PlayAnimRaise1, "shieldschalter");
OnObjectRespawnName(PlayAnimDrop1, "shieldschalter");
ShowMessageText("Count 2")

EnableSPHeroRules()


--START BRIDGEWORK!

-- OPEN
function PlayAnimRaise()
ShowMessageText("Starting Open")
PauseAnimation("drop");
RewindAnimation("raise");
PlayAnimation("raise");
ShowMessageText("Ending Open")
end

-- CLOSE
function PlayAnimDrop()
ShowMessageText("Starting Close")
PauseAnimation("raise");
RewindAnimation("drop");
PlayAnimation("drop");
ShowMessageText("Ending Close")
end
Count how many times it is displayed. Note the text will not get displayed, only [Null]. A good run (load -> open once -> close once) would display 6 nulls.

Posted: Fri Apr 06, 2007 5:12 am
by Redline
Ah thx and where write i the text for this ?

Posted: Fri Apr 06, 2007 12:12 pm
by [RDH]Zerted
Redline wrote:where write i the text for this ?
:? I don't understand your language/question.

Posted: Fri Apr 06, 2007 12:45 pm
by Redline
ShowMessageText("Count 1") I will give this a text , but how ?
Example: Destroy the front door

-- OPEN
function PlayAnimRaise()
ShowMessageText("Starting Open")
PauseAnimation("drop");
RewindAnimation("raise");
PlayAnimation("raise");
ShowMessageText("Ending Open")
end

-- CLOSE
function PlayAnimDrop()
ShowMessageText("Starting Close")
PauseAnimation("raise");
RewindAnimation("drop");
PlayAnimation("drop");
ShowMessageText("Ending Close")
end

Text for this ( ingame )

(also the text Null in the ingame)

Posted: Sat Apr 07, 2007 1:37 am
by [RDH]Zerted
You will not get the text. I just put it in there so you can better read the code.

This is how its normally used:
ShowMessageText("level.dea1.obj6_ambush3")
The string gets converted into whatever it represents in the localization files. If it doesn't represent anything (you could make a 'Starting Open' entry) it will display Null.

If you can get the error log file, you could use print("your text here") instead. Print will output its text to the error log. ShowMessageText() outputs to the game screen.