Doors with switch Problem

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Redline
2nd Lieutenant
2nd Lieutenant
Posts: 396
Joined: Tue Jan 16, 2007 4:22 pm
Projects :: Space to Ground [reworking]
Games I'm Playing :: Different Games
xbox live or psn: No gamertag set
Location: The left side of the moon
Contact:

Doors with switch Problem

Post 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
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

RE: Doors with switch Problem

Post by [RDH]Zerted »

Add ShowMessageText("") to your fuctions. Use this to make sure they are getting called. The code should display "[Null]" ingame.
Redline
2nd Lieutenant
2nd Lieutenant
Posts: 396
Joined: Tue Jan 16, 2007 4:22 pm
Projects :: Space to Ground [reworking]
Games I'm Playing :: Different Games
xbox live or psn: No gamertag set
Location: The left side of the moon
Contact:

Post 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("")
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Post 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.
Redline
2nd Lieutenant
2nd Lieutenant
Posts: 396
Joined: Tue Jan 16, 2007 4:22 pm
Projects :: Space to Ground [reworking]
Games I'm Playing :: Different Games
xbox live or psn: No gamertag set
Location: The left side of the moon
Contact:

Post by Redline »

Ah thx and where write i the text for this ?
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Post by [RDH]Zerted »

Redline wrote:where write i the text for this ?
:? I don't understand your language/question.
Redline
2nd Lieutenant
2nd Lieutenant
Posts: 396
Joined: Tue Jan 16, 2007 4:22 pm
Projects :: Space to Ground [reworking]
Games I'm Playing :: Different Games
xbox live or psn: No gamertag set
Location: The left side of the moon
Contact:

Post 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)
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Post 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.
Post Reply