Page 11 of 24
Re: New Dynamic Script Ideas
PostPosted: 28 Nov 2013, 16:32
by RandomLyrics
How about UnitLock? You see your unit but cant control it ?
Re: New Dynamic Script Ideas
PostPosted: 29 Nov 2013, 02:54
by Lewin
Hmm no its desont looks strange it look exsacly like u destroy your own house when the serf coming to it

- its the same situation
As long as the player realises the resources have been taken by the script. Cancelling all of the serfs' deliveries is a bit complicated to implement but it could be done.
How about UnitLock? You see your unit but cant control it ?
I think it should be GroupLock, since you can't control units that aren't soldiers, and there's no point only locking some of the soldiers in a group.
Re: New Dynamic Script Ideas
PostPosted: 29 Nov 2013, 08:15
by RandomLyrics
Hmm no its desont looks strange it look exsacly like u destroy your own house when the serf coming to it

- its the same situation
As long as the player realises the resources have been taken by the script. Cancelling all of the serfs' deliveries is a bit complicated to implement but it could be done.
Great!
How about UnitLock? You see your unit but cant control it ?
I think it should be GroupLock, since you can't control units that aren't soldiers, and there's no point only locking some of the soldiers in a group.
Yes,i mean GroupLock

but unitlock can be usefull to freeze entire town for cinematic purpose etc, and from unitlock we can easily make GroupLock.
Re: New Dynamic Script Ideas
PostPosted: 29 Nov 2013, 08:34
by Lewin
How about UnitLock? You see your unit but cant control it ?
I think it should be GroupLock, since you can't control units that aren't soldiers, and there's no point only locking some of the soldiers in a group.
Yes,i mean GroupLock

but unitlock can be usefull to freeze entire town for cinematic purpose etc, and from unitlock we can easily make GroupLock.
You're describing something different there. I thought GroupLock would just stop the player from controling the group, but otherwise they would keep behaving like normal. You described UnitLock as if it makes them freeze in the middle of whatever they are currently doing.
Re: New Dynamic Script Ideas
PostPosted: 29 Nov 2013, 11:04
by RandomLyrics
UnitLock like freeze, UnitHide , hide and freeze unit till unhide ( it might be usefull in cinematic). Maybe we can call new script GroupControl(aUnit: integer; On/Off: boolean)? - it takes players control away , but still leaves it to script ( like orders etc ) - very usefull when you want to have more ppl in multi.
UnitLock mean lock so i was thinking about freeze or smth ;p ( i used to be map maker in warcraft 3, there was a lot similar scripts and names )

Re: New Dynamic Script Ideas
PostPosted: 29 Nov 2013, 13:22
by Bence791
You can use GroupOrderWalk for "GroupControl"

Re: New Dynamic Script Ideas
PostPosted: 02 Dec 2013, 14:39
by RandomLyrics
Is there any way to check is the occupant went to inn? example: if States.HouseOccupantInInn(ahouseID) then ...
and how to force AI to not destroy exshousted mines, stones etc (with autobuild on) ?
also why i cant add stones to quarry?
Re: New Dynamic Script Ideas
PostPosted: 02 Dec 2013, 23:58
by Lewin
Is there any way to check is the occupant went to inn? example: if States.HouseOccupantInInn(ahouseID) then ...
and how to force AI to not destroy exshousted mines, stones etc (with autobuild on) ?
also why i cant add stones to quarry?
Internally in the KaM Remake houses have two kinds of resources they can store: "in" (consumed by the house) and "out" (to be taken somewhere else by serfs). At the moment you can only change the "in" resources. I'd like to make it so you can change the "out" resources too (although that needs to be done with care in order to make sure it works correctly with the delivery system). I'll add it to my todo list
When a unit is inside a house its XY position is at the door, so you can tell if somebody is in the inn by using something like:
if States.HouseType(States.HouseAt(States.UnitPositionX(U), States.UnitPositionY)) = 27 then
Re: New Dynamic Script Ideas
PostPosted: 03 Dec 2013, 00:48
by RandomLyrics
thanks

Re: New Dynamic Script Ideas
PostPosted: 03 Dec 2013, 14:57
by Lewin
...aaaand it's implemented!

As well as the script you can also alter the "out" wares from the map editor, so you can make villages seem more "alive" for example by having a few stones sitting in the stonemason's hut when the game starts.
Re: New Dynamic Script Ideas
PostPosted: 03 Dec 2013, 16:18
by RandomLyrics
Great! i saw it earlier in the "Changes Log"

.
Hmm i have question , is there any way to improve FPS? The maps size will change smth? image:

Re: New Dynamic Script Ideas
PostPosted: 03 Dec 2013, 16:31
by andreus
Re: New Dynamic Script Ideas
PostPosted: 03 Dec 2013, 16:43
by RandomLyrics
oh, okay, my bad, i was runing KaM on Intel Graphics xD
Re: New Dynamic Script Ideas
PostPosted: 04 Dec 2013, 22:41
by RandomLyrics
When a unit is inside a house its XY position is at the door, so you can tell if somebody is in the inn by using something like:
if States.HouseType(States.HouseAt(States.UnitPositionX(U), States.UnitPositionY)) = 27 then
Hmm im checking if the unit is in house and always get ' -1 ' . Heres the code:
- Code:
function HouseChangeOwner(aHouse, toPlayer: integer): integer;
var o: integer;
begin
if (aHouse > 0) and ( toPlayer >= 0 ) and ( toPlayer < 8 ) then begin
o:= States.UnitAt(States.HousePositionX(aHouse), States.HousePositionY(aHouse)); //here i check if unit is in house, coz 'houseDestroy' also kills unit in it.
test(o);
if o > 0 then
Actions.GiveUnit(toPlayer, States.UnitType(o), States.HousePositionX(aHouse), States.HousePositionY(aHouse)+1, 0);
Actions.HouseDestroy(aHouse, true);
result:= Actions.GiveHouse(toPlayer, States.HouseType(aHouse), States.HousePositionX(aHouse), States.HousePositionY(aHouse));
end else begin
result:= -1;
end;
end;
btw the States.HouseOccupant(aHouseID: Integer) is pointless, its giving only type not ID of occupant, evan if the house is empty. It should be HouseToOccupantType
Re: New Dynamic Script Ideas
PostPosted: 05 Dec 2013, 03:43
by Lewin
When a unit is inside a house its XY position is at the door, so you can tell if somebody is in the inn by using something like:
if States.HouseType(States.HouseAt(States.UnitPositionX(U), States.UnitPositionY)) = 27 then
Hmm im checking if the unit is in house and always get ' -1 ' . Heres the code:
UnitAt does not give you units that are inside a house, since there can be many units inside a house at once (e.g. barracks, storehouse, serfs collecting bread from baker, etc.). However, UnitPosition will be the same as HousePosition when a unit is inside a house.
btw the States.HouseOccupant(aHouseID: Integer) is pointless, its giving only type not ID of occupant, evan if the house is empty. It should be HouseToOccupantType
I agree, HouseTypeToOccupantType would be a more useful and generic function. HouseOccupant is confusing.