Posts: 3822
Joined: 16 Sep 2007, 22:00
KaM Skill Level: Skilled
ICQ: 269127056
Website: http://lewin.hodgman.id.au
Yahoo Messenger: lewinlewinhodgman
Location: Australia
Re: Dynamic Script Usage
It would be cool to support classes, maybe one day
Posts: 3822
Joined: 16 Sep 2007, 22:00
KaM Skill Level: Skilled
ICQ: 269127056
Website: http://lewin.hodgman.id.au
Yahoo Messenger: lewinlewinhodgman
Location: Australia
Former Site Admin
Posts: 3814
Joined: 08 Jan 2009, 23:00
Location: California - Pacific Time (UTC -8/-7 Summer Time)
But speaking of feature support:
is there a way to prevent enemy (but not allied) troops from entering a specific area? Will this be possible?
Former Site Admin
Posts: 3814
Joined: 08 Jan 2009, 23:00
Location: California - Pacific Time (UTC -8/-7 Summer Time)
King Karolus Servant
Posts: 2154
Joined: 29 Aug 2007, 22:00
KaM Skill Level: Veteran
Location: In his dark thunderstormy castle
It's working now, thanks.
Meanwhile I'm trying to use Actions.SetOverlayText to display a message for all players, e.g. "The Dark Lord has defeated the first attack wave!" I got this message working, but then I want to erase it again. How can I do this? I'm trying to overwrite the text with an empty string, but I want it to be delayed (lets say after 5 seconds).
Currently I have added this code:
DelayedErase becomes true after defeating the first attack wave.
- Code:
const DELAY = 50; var DelayedErase: Boolean; DelayedTime: Integer; procedure HideOverlayMsg; begin if (DelayedErase = true) and (DelayedTime = (States.GameTime + DELAY)) then begin Actions.SetOverlayText(0, States.Text(29)); Actions.SetOverlayText(1, States.Text(29)); Actions.SetOverlayText(2, States.Text(29)); Actions.SetOverlayText(3, States.Text(29)); DelayedErase := false; end; end;
It's a very dirty way of hiding the text, and it doesn't even work.I'm guessing my use of DelayedTime is wrong? HELP!!!
Posts: 3822
Joined: 16 Sep 2007, 22:00
KaM Skill Level: Skilled
ICQ: 269127056
Website: http://lewin.hodgman.id.au
Yahoo Messenger: lewinlewinhodgman
Location: Australia
Lewin? Krom? I desperately need a hand.
King Karolus Servant
Posts: 2154
Joined: 29 Aug 2007, 22:00
KaM Skill Level: Veteran
Location: In his dark thunderstormy castle
The problem is you never set DelayedTime to anything, you only ever compare its value to something else, so it will be uninitialised. When you set DelayedErase to true you need to set DelayedTime to something as well. But I'm not sure you have the condition right anyway:Lewin? Krom? I desperately need a hand.
(DelayedTime = (States.GameTime + DELAY))
should probably be:
(States.GameTime = DelayedTime)
Then when you show a message you can set:
DelayedTime := States.GameTime + DELAY
So that means "DelayedTime" means "What tick should we erase the message?" (now + 50 ticks). When you reach that tick you erase it.
Also, I noticed that you're not initialising any of your global variables. Given that your script works, it looks like the compiler initialises them all to zero or false anyway (or you're just lucky that the memory allocated to them was already zero), but it's good practice to initialise them. Add something like this:
Then it's clear to someone reading your script what the global variables all start as.
Another tip, replace this:with this: There's so many places where you do something to all 4 players in your code which could be done using a for loop. It's easier to read, easier to change later, and harder to make mistakes (otherwise the code could be slightly different for each player and you might not notice).
Posts: 3822
Joined: 16 Sep 2007, 22:00
KaM Skill Level: Skilled
ICQ: 269127056
Website: http://lewin.hodgman.id.au
Yahoo Messenger: lewinlewinhodgman
Location: Australia
King Karolus Servant
Posts: 2154
Joined: 29 Aug 2007, 22:00
KaM Skill Level: Veteran
Location: In his dark thunderstormy castle
Posts: 3822
Joined: 16 Sep 2007, 22:00
KaM Skill Level: Skilled
ICQ: 269127056
Website: http://lewin.hodgman.id.au
Yahoo Messenger: lewinlewinhodgman
Location: Australia
King Karolus Servant
Posts: 2154
Joined: 29 Aug 2007, 22:00
KaM Skill Level: Veteran
Location: In his dark thunderstormy castle
I'm not sure what you mean about invisible troops. For me the players who aren't in the game still receive troops but they ARE visible, they just stand there with no tower to go attack. What did you do to make them invisible?
procedure OnHouseLost(aHouseID: Integer);
var Tower01: Integer;
begin
Tower01 := States.HouseAt(49, 78);
if States.HouseDestroyed(Tower01) then
Actions.GroupOrderWalkTo(Warriors01, 122, 57, 6);
Actions.GroupOrderWalkTo(Knights01, 112, 49, 5);
Actions.GroupOrderWalkTo(Crossbows01, 113, 55, 6);
end;
Posts: 3822
Joined: 16 Sep 2007, 22:00
KaM Skill Level: Skilled
ICQ: 269127056
Website: http://lewin.hodgman.id.au
Yahoo Messenger: lewinlewinhodgman
Location: Australia
AWWWW YEAH! A simple 'HideOverlayMsg;' after OnTick solved everything... Didn't know I had to call upon a procedure. Oops.
I mean exactly what I said: they are really invisible.I'm not sure what you mean about invisible troops. For me the players who aren't in the game still receive troops but they ARE visible, they just stand there with no tower to go attack. What did you do to make them invisible?I did nothing to make them invisible, they just are... Could it be related to the SET_USER_PLAYER issue (since you didn't have trouble with that either, but I had)?
I run my mission, and the game says: "Unknown identifier GROUPORDERWALKTO". What have I mistaken?.
King Karolus Servant
Posts: 2154
Joined: 29 Aug 2007, 22:00
KaM Skill Level: Veteran
Location: In his dark thunderstormy castle
That's really weird. The version you emailed to me didn't have invisible units. Could you send me the files which cause the units to be invisible, including the .mi file? (and tell me how you set up the lobby and what you did in game to get the invisible units)I mean exactly what I said: they are really invisible.I'm not sure what you mean about invisible troops. For me the players who aren't in the game still receive troops but they ARE visible, they just stand there with no tower to go attack. What did you do to make them invisible?I did nothing to make them invisible, they just are... Could it be related to the SET_USER_PLAYER issue (since you didn't have trouble with that either, but I had)?
Users browsing this forum: No registered users and 0 guests
|
Powered by phpBB® Forum Software © phpBB Group Designed by ST Software |
|