vovanius
  • vovanius
  • 56% (Neutral)
  • Private Topic Starter
18 years ago
Hi All! I am not so good in English, so maybe I missed a similar topic when searched... don't be angry, please!
For the reference - I using Generals ZeroHour WorldBuilder v.0.8, included in game distributive. Is it OK? Maybe there is a newer version and the problem below is my version's issue?
So, here's the problem. I want to have some independent team in skirmish game, that would attack me and my computer controlled enemies. Let's call them 'Partizanen', eah... So, first of all I create a team under PlyrCivilian, name it, and set Identity tab as follows: Max. quantity 1, Owner PlyrCivilian, Home position 'some waypoint', Condition 'Sub_start' (already written in scripts, and script 'Start' calling this sub written too, both are executed at the beginning, checked). Priority, Build for, Increase..., Decrease... all 0 (defaults), Min 3, Max 3, Unit type 'Militia Tank', Automatically reiforce... unchecked, Team members are... and Team created once... are both checked. Other tabs by default. So, when I start game, script 'Start' executes (checked by embedded sound effect), calls subscript 'Sub_start' (checked the same way), but team is NOT appear at any place of map. Again, trigger script is definitely executed at the very beginning of game. Team is not created. So, what I'm doing wrong? Thank You.
Sponsor
Me Myself and Pi
18 years ago
There is only one version of the Zero Hour world builder & it comes with the game.

Civilian teams don't work in skirmish/multiplayer play. (They only work for skirmish players, & that's how it works in AOD maps.) You'll have to use an entire player instead. But note, this won't work for other human players in a multiplayer game. It only works with the host & the skirmish players.

1) Create a new player in the map list with a civilian faction. (Note, it won't work just have it consider the other skirmish player here. That only works in a single player map.)
2) Go to script window & create a script in the PlyrCivilian folder using the action, Player\Alliances\Change how a player relates to another player.
3) In this action, have the player you created consider ( will actually refer to the host of the game. Don't ask me why though. also works, but if you ever played this map online, it would cause a mismatch. Again, don't ask me why.)
4) Copy the action & switch around the players so that considers the player you created to be an enemy. In the end, the script should look like this:
http://cncmaps.net/index.php?showtopic=648 . Be sure to uncheck auto verify before importing them because it will take a very long time to verify them all.
6) Now copy the script you created & change the 's to 's.
7) Now make 11 copies of that script & move all 12 of them into the skirmish player's folders. (When a script uses in a player's folder, then will refer to that player. So if it's in the PlyrCivilian folder, then will be PlyrCivilian. Same goes with the other skirmish player.)

That's it! You can create whatever scripting you want for that player but be sure to use individual units & not teams.

Note, even though it should take a few seconds to import the skirmish script, it will take about 45 seconds to load up the script window each time after that.
vovanius
  • vovanius
  • 56% (Neutral)
  • Private Topic Starter
18 years ago
Well, thanx for excellent explanation, all works good! Now I have some scripts related question. I'd like to know, what objects or players are tags , referred to? As I think, refers to player, in which folder script is. Am I right? What about if script is in subfolder? Can any tag refer to subfolder name? Or to the name of script itself? Please, give me a list of all possible references. Thanks a lot!
Me Myself and Pi
18 years ago
Yes, does refers to the player that the script is in. It doesn't change anything if the script is in a folder.

refers to the enemy of the player that the script is in. This works for the host of the game if put in the PlyrCivilian folder. I guess the script thinks that the host of the game is an enemy to the civilian player, even though they are accually neutral to each other.

refers to the human player in the game. If this is used in a multiplayer game, it will cause a mismatch. I don't know why though. Better to use instead.

refers to the team that activates the script. Usually used it solo play maps & AOD maps. To get it working, you check the script that uses as a subroutine. Then, go to the Team window of a team & you can select that script in several spots there to be activated upon an action. So you could have that script get run whenever the team is built, or if it sees an enemy, etc... So if a team runs a script that way, will be considered to be that team. Multiple teams can run the same script for themselves too.

only works in single player maps. This works the same as , only for structures. When you place buildings for a computer player to build them, you can double click on that building in the build list & choose that script there. The script will then be run each time the building is built & will then refer to that object.
vovanius
  • vovanius
  • 56% (Neutral)
  • Private Topic Starter
18 years ago
OK, got it. Now here is another question (sorry if boring You, im just new for all these things). There is Jarmen Kell patroling the map, he's a single unit belonging to above 'Partizanen' player. I programmed him to guard current position if he sees an enemy, and continue moving his way if all clear. Also he sometimes garrisones nearby buildings, stays there for a while, then moves further. If he's destroed, he reborns in some time in far deep forest and starts again... He hunts infanty units great, but how to make him snipe vehicles??? I programmed him to use commandbutton ability 'SnipeVehicleAttack' on an object (a NAMED test vehicle, controlled by me), he did it, but what about ANY enemy vehicle? I did not find any 'use ability on nearby enemy object' or something for single unit. And just 'use ability' without target does not work. What can I do about it?


Oh, and some design related question. I am just remaking a map, not creating from very begining. I noticed that my and my enemy units passing the bridges like it should be, moving on their suface. And civilian units that automatically moving some looped waypoint (cars, buses etc) are like "diving" under the bridge surface when passing. Actually, they moving on the river bottom, ignoring bridges. Fow can I fix this?

[EDIT: Double Post Splice -- CommieDog]
Me Myself and Pi
18 years ago
1) Use the action, Team\Hunt\Set to hunt using commandbutton ability. So select TeamPartizanen & the sniping command button.

2) You're probably using the action, Unit\Move\Set a unit to EXACTLY follow a waypoint paths. This allow unit to go through every kind of obsticle, such as, mountains, cliffs, water, structures, & bridges. Use the Unit\Move\Set a unit to follow a waypoint paths. action instead.
vovanius
  • vovanius
  • 56% (Neutral)
  • Private Topic Starter
18 years ago
Well, it works. But when I set entire team to hunt, all units begin to hunt, not only J.Kell. What if I need other partisan units to stay still or move somewhere else while Kell is operating? Script 'hunt using commandbutton ability' sets to hunt all team units or only those, who are able to use selected ability?
Me Myself and Pi
18 years ago
Oh. Well then, just create a bunch more actions, after the action to tell Jarmen Kell to hunt, Telling all the other units to stop.
vovanius
  • vovanius
  • 56% (Neutral)
  • Private Topic Starter
18 years ago
Well, I thought so, but also I thought there is more "elegant" way to do this. Why did'nt they make a similar set of scripts for teams & for units? I noticed a lot of team scripts, that could be theoretically applied to single unit... And that script tree - can it be manually sorted? It takes a time to find something, especially when needed script hidden somewhere in 'unused'. I found file "C&C Generals - Zero Hour\Zero Hour\Data\Scripts\Scripts.ini", where, as I think, there is description of all scripts, can it be modifyed? Maybe someone already did it? I mean, sorted scripts more logically?
In Scripts.ini I found this:

ScriptAction
InternalName = "NAMED_HUNT";
UIName = "Unit/Hunt/Set a specific unit to hunt.";
HelpText="No Help."
End

and this:

ScriptAction
InternalName = "TEAM_HUNT_WITH_COMMAND_BUTTON";
UIName = "Team/Hunt/Set to hunt using commandbutton ability.";
HelpText="No Help."
End

What if I insert there a new script descriptor like this:

ScriptAction
InternalName = "NAMED_HUNT_WITH_COMMAND_BUTTON";
UIName = "Unit/Hunt/Set a specific unit to hunt using commandbutton ability.";
HelpText="No Help."
End

Will this work, how do You think?
CommieDog
18 years ago
I don' think you can create new scripting actions like that. If you really want Jarmen Kell to operate independently of other units, you'll have to put him in his own team.
UserPostedImage 
CommieDog: Because someone has to do your dirty work for you
Me Myself and Pi
18 years ago
Yeah accually, you can sneak in one more player in the player list. Delete one of the skirmish players, (this will delete the scripts in that folder if you have any) add a new player & add the skirmish player back it. I don't think it'll let you create a 2nd player if you have all the skirmish players in the game.

If you've imported the skirmish scripts into your map, I recommend you export all of you scripts & import them into another map. Then remove all buy one of the players from the player list from that map (including PlyrCivilian) but sure that the player you keep is the one you're going to temporary remove from your other map. So now you have only the scripts for you map in one skirmish player folder, go ahead & export those.
Go back to you map now & remove that skirmish player, create the new play & add skirmish players again. Then import those scripts for that one player back in.

For units, they only have a hunt script, not a hunt with a command button action.

It does look like you can change the path of a script from that INI file. But I dought you'll be successful in creating a new one. But be sure to save a copy of that file to your desktop before you do. Modifying might now allow you to play online.
vovanius
  • vovanius
  • 56% (Neutral)
  • Private Topic Starter
18 years ago
Well, above question is more or less solved. Now I have a few others:
How can i determine in script if the named vehicle became unmanned (was sniped)?
How can I determine if named unmanned vehicle was captured by certain player?
Is it possible to initiate nuke explosion somewhere without missile, when say any unit enters some trigger area?

Thank You all for cooperation 🙂
Me Myself and Pi
18 years ago
You might be able to use some conditions in the Player\Owns folders. To have script act upon getting sniped, you might be able to use the condition Player has (comparison) unit type.. I think that when a vehicle gets sniped it goes from the PlyrCivilian player to the Neutral player. That is, if you had the vehicle start out in PlyrCivilian. So in that action, specify that when PlyrCivilian owns equal to 0 of unit type.
For when it gets captured, just put a trigger area around the sniped unit & when the unit leaves the area from getting captured, you could have the script act on that. (Unit\Area\Unit exits an area.)

To get nuclear explosion to occur, use the action, Unit\Spawn\Spawn -- an unnamed unit on team at waypoint.In that action specify that Civilian\System\NeutronMissile (The Neutron Missile is the Nuclear missile) spawns on team TeamPlyrCivilian & whatever waypoint you want.
vovanius
  • vovanius
  • 56% (Neutral)
  • Private Topic Starter
18 years ago
It all works accept nuclear explosion. Missile appears where explosion should be, but there's no explosion itself. Missile just lays on the ground... I tryed also 'Neutron Blast Object' and 'Scud Storm Missile' - nothing happens. The things worked were 'Nuclear Bomb' and 'MOAB', but I need more destructive blast.
Me Myself and Pi
18 years ago
Oh, okay. Then use the action, Spawn -- a named unit on team at waypoint. & name the missile. Then right after that, use an action to kill the missile. If it still doesn't work, then just spawn the Civilian Vehicle, ConvoyTruckArmedWithNuke instead. That at least will work.
vovanius
  • vovanius
  • 56% (Neutral)
  • Private Topic Starter
18 years ago
Yep, all working good now. Partisan units operating very effectively, causing a lot of trouble to those who entering town. Just some more details to finish... Is there a possibility to spawn something (e.g. GLADemoTrap) on CURRENT unit position? I mean, if unit sees an enemy, he 'places the mine' right where he is, then trying to run away. If enemy will chase him, he'll be surpised 🙂
Me Myself and Pi
18 years ago
No, there's not action that will do that. What you could do though is use Colonel Burton to to set a bomb on a unit or building.