Page 1 of 2
Gnarf
PostPosted: 16 Jan 2014, 21:13
by MaxDeus
So. Here is a new topic for you!
For the next fow times i will ask in this topic, so i don´t need to open 4-5-6 new one.
The first questing is very easy, i hope. How can i spawn people (serfs with goods) into the map. they shall come maybe every 10 seconds, for 2 minutes and 30 seconds, bring the goods in the store and then went away were they came from (go tho the "spawnpoint" and then be deleted).
I hope someone can help. It is for a mission i´ll make (If the informations are not enough i will explain more).
Thanks in advance
GR
MaxDeus
Re: Gnarf
PostPosted: 16 Jan 2014, 22:18
by sado1
I'm sorry but according to my knowledge it's impossible. The closest thing to what you're asking for is detecting what serf is carrying (States.UnitCarry), or adding a ware to the storehouse with a script (Actions.HouseAddWaresTo). The only idea I have, that could solve your problem, would be to spawn a storehouse with 1 item inside and a serf, then quickly delete the storehouse right after we detect that the serf is carrying the ware to the other store. Please give us some more details then, maybe we can think of some trick to use.
Re: Gnarf
PostPosted: 17 Jan 2014, 08:24
by MaxDeus
Tonight i had another idea how to implement this. Maybe we could make a part of the map black (fog, or however it will be called). There is a store from where some serf transport the objects to the other store.
This is it now (pic 1 is normal).
You see the store, some serfs can take wares from there. But in fact i want to have it like this: It´s a outpost from some country and the food is comming from the inland. So the serfs shall take some food and bring it in the other store.
To make it realise, i thought of extend the map on the left side a little bit, so that i can put a store there. This should look like this (of course with good edges, pic 2).
Maybe it is the only way to solve this problem. Can this be implemented?
GR
MaxDeus
Re: Gnarf
PostPosted: 17 Jan 2014, 11:25
by pawel95
AHHHHH
You mean, you want sth like an "invisible spawn point" (like in roller coaster ty:
http://www.gameclassification.com/files ... coon-2.jpg ) where an invisible storehouse is and serfs disapears when they move in that area and appear again, when they come back with the ware? XD
I don´t think that something like this is implementable yet.
However I have an other idea. Do you have played "The Meize" from Andreus? He has "teleporters" there! maybe you could place a storehosue just behind some hills, far away, so the player can´t see it, and those serfs will go then into this "hole" for example and come back with wares?!

Re: Gnarf
PostPosted: 17 Jan 2014, 11:44
by MaxDeus
The meize? Sry, never done yet. And you´re right. Like in rollercoaster Tycoon, left side of the screen only.
The problem is, that the storehouse is from the allies, not enemy, so you see were it is.
Re: Gnarf
PostPosted: 17 Jan 2014, 12:15
by pawel95
The problem is, that the storehouse is from the allies, not enemy, so you see were it is.
I am not programming much with the Remake, so I can only write "what I guess"

But I guess to remember that at sado´s conquest map, he also did it somehow, to make a fog of a certain area and it will be only revealed when YOU go there, not your ally.
Re: Gnarf
PostPosted: 17 Jan 2014, 13:50
by Lewin
You can't spawn a serf in the middle of his delivering task. The way our code is written the delivery requires a source and a destination, so it's not simple for us to make a script command that places a serf in the middle of this task. It's not impossible for us to implement but given that it has only a few limited useful cases I don't think we'll implement it soon.
The problem is, that the storehouse is from the allies, not enemy, so you see were it is.
You can disable sharing fog between allied players with the script then cover the area

Then the storehouse can remain hidden.
Re: Gnarf
PostPosted: 17 Jan 2014, 13:56
by dicsoupcan
You can't spawn a serf in the middle of his delivering task. The way our code is written the delivery requires a source and a destination, so it's not simple for us to make a script command that places a serf in the middle of this task. It's not impossible for us to implement but given that it has only a few limited useful cases I don't think we'll implement it soon.
The problem is, that the storehouse is from the allies, not enemy, so you see were it is.
You can disable sharing fog between allied players with the script then cover the area

Then the storehouse can remain hidden.
actually i had a similiar idea to fix this in a future mission i had planned (beware shd, you arenot nearly doneyet

). just hide a storehouse somewhere with enoughs serfs and goods to carry the needed resources. after they took the goods just silent kill your storehosue(well...you know...that command that make it vanish without the destruction whererubble is left).
Re: Gnarf
PostPosted: 17 Jan 2014, 14:00
by MaxDeus
but if it´s not possible jet, can we make it like this: 4 serfs are at the store B, take some sausages for example, walk to point X, "warp" to point Y (with sausages), give the sausage to the tavern or the store A?!
The problem might be to give them the task, even if they don´t have a normal way to the tavern/store A.
Re: Gnarf
PostPosted: 17 Jan 2014, 17:23
by MaxDeus
And one more question. Is it possible to make a command like this:
If Player 1 sees/uncovers Point (x/y), show message X?!
GR
MaxDeus
Re: Gnarf
PostPosted: 18 Jan 2014, 00:07
by Lewin
but if it´s not possible jet, can we make it like this: 4 serfs are at the store B, take some sausages for example, walk to point X, "warp" to point Y (with sausages), give the sausage to the tavern or the store A?!
The problem might be to give them the task, even if they don´t have a normal way to the tavern/store A.
There is no script command for teleporting units. The way other scripts achieve it is by silently killing the unit and respawning it somewhere else, but obviously this means the delivery task won't be happening any more since it's actually a new unit not the old one.
The problem with actual teleporting is that lots of our code relies on that not happening. For example the walking action keeps track of where the unit is and where it is going. If the unit suddenly teleported somewhere else it would make it crash. Restarting the walking action is not easy because that depends on the unit's task, he could be in the middle of delivering, or pushed away by another unit, or walking to build a road.... I don't think teleporting will be implemented any time soon (if it is it will almost certainly only be for idle units).
There is also no way to get a serf to deliver from a storehouse to another storehouse. Maybe we do need a command to give a serf a specific delivery or even a delivery without a source (magically giving him the resource). If a few people are interested in this I can look into it, but probably not for this next release.
And one more question. Is it possible to make a command like this:
If Player 1 sees/uncovers Point (x/y), show message X?!
Something like this:
- Code:
var AreaRevealed: Boolean;
procedure OnMissionStart;
begin
AreaRevealed := False;
end;
procedure OnTick;
begin
if States.FogRevealed(0, 56, 97) and not AreaRevealed then
begin
Actions.ShowMessage("Player 0 revealed location 56, 97!");
AreaRevealed := True;
end;
end;
Re: Gnarf
PostPosted: 18 Jan 2014, 09:11
by MaxDeus
Okay, thanks. I will try it like this. I will change a little bit of the map so that it is possible.
Next question will come, be warned

GR
MaxDeus
Re: Gnarf
PostPosted: 19 Jan 2014, 18:27
by MaxDeus
He does not know the command: ShowMessage.
First mistake was to forget the var...., then i added it, now he has got the mistake: warnig in script error, 12:13 unknown identifier 'SHOWMESSAGE'
And can we make it like this: Show message 2 (-> he shall take it from the .ger or .eng..., so that everybody will understand the message?!)
GR
MaxDeus
Update: He made it, command was: Showmsg
Re: Gnarf
PostPosted: 20 Jan 2014, 10:31
by MaxDeus
So. Next question is comming:
Can i give a player the command: if house A does not find coal anymore, build another house B at P(x/y)?
Re: Gnarf
PostPosted: 20 Jan 2014, 10:40
by Krom
@MaxDeus:
You can use HouseCanReachResources (added in r5993) to see if house can reach resources and if it can't - build another house at B.