[en] - Modding Corner > Coding

Coding in Edain 4.00

<< < (14/23) > >>

Glorfindel23:
Edited
I had not seen the first time but all your code is false I've make a correction


--- Zitat von: calsash am 26. Feb 2016, 23:22 ---Im still having no luck with the command set :/

Object ElvenBarracks
 CommandSet = LothlorienBarracksComman dSetNewName
End

CommandSet LothlorienBarracksComman dSetNewName
InitialVisible = 8
    1      = Command_ConstructBruchta lSchwertkämpferHorde_Sum moned
    2      = Command_ConstructLothlor ienBerserkerHorde
    3      = Command_ConstructElvenKn ightHorde
    4      = Command_ConstructDorwini onNaturmagier
    5      = Command_ConstructDorwini onWinzer
    6      = Command_StartCitadelSelf Repair     
    7      = Command_ConstructLindonW arriorHorde
    8      = Command_ConstructHeavenW arriorHorde
End   

--- Ende Zitat ---

You must delete the "Summoned" because it doesn't exist in the ini file

New code :

--- Zitat ---Object ElvenBarracks
 CommandSet = LothlorienBarracksComman dSetNewName
End

CommandSet LothlorienBarracksComman dSetNewName
InitialVisible = 8
    1      = Command_ConstructBruchta lSchwertkämpferHorde_Summoned
    2      = Command_ConstructLothlor ienBerserkerHorde
    3      = Command_ConstructImlaAmr othReiter
    4      = Command_ConstructDorwini onNaturmagierInn
    5      = Command_ConstructDorwini onWinzerInn
    6      = Command_StartCitadelSelf Repair     
    7      = Command_ConstructLothlor ienLindonWarriorHorde
    8      = Command_ConstructLindonH eavenWarriorHorde
End     
--- Ende Zitat ---

Or if you want continue with the "summoned" you must create his button like it doesn't exist :

New code :


--- Zitat ---
CommandButton Command_ConstructBruchta lSchwertkämpferHordeSummoned
    Command                = UNIT_BUILD
    Object                = BruchtalSchwertkämpferHorde_Summoned
    TextLabel            = CONTROLBAR:BuildBruchtalSchwertkämp ferHorde
    ButtonImage            = HSImladrisSchwert
    ButtonBorderType    = BUILD
    DescriptLabel        = CONTROLBAR:ToolTipBuildBruchtalSchw ertkämpferHorde
    Radial                = Yes
    InPalantir               = Yes
    IsClickable            = Yes
    Options                = CANCELABLE
    ShowProductionCount    = Yes     
End

Object ElvenBarracks
 CommandSet = LothlorienBarracksComman dSetNewName
End

CommandSet LothlorienBarracksComman dSetNewName
InitialVisible = 8
    1      = Command_ConstructBruchta lSchwertkämpferHordeSumm oned
    2      = Command_ConstructLothlor ienBerserkerHorde
    3      = Command_ConstructImlaAmr othReiter
    4      = Command_ConstructDorwini onNaturmagierInn
    5      = Command_ConstructDorwini onWinzerInn
    6      = Command_StartCitadelSelf Repair     
    7      = Command_ConstructLothlor ienLindonWarriorHorde
    8      = Command_ConstructLindonH eavenWarriorHorde
End
--- Ende Zitat ---

Important : your major problem is the command you must open the "commandbutton.inc" and in this you must search the command than you want use

calsash:
Working now so thank you for enduring with me Glorfindel. There is however 1 flaw which is that no upgrades for the unit can be purchased where as they can be if the unit is on the map.

Also one more thing im not sure if this is coding or not but how would i make it so that when you capture a flag a timer will start and after that timer some units will appear?

Gnomi:
This is scriting. Therefore give the flag a name and set a waypoint (this is where the units start) and open the scripting menu in the worldbuilder.
Script 1:

Script conditions:
If Unit 'Flagname' belongs to player 'Playername'
then
Actions if TRUE:
start timer 'Troupsarrive' with 'XXX' seconds

Script 2:
If Timer Troupsarrive is finished
then
spawn units


Spawn units can be different things:
Either you just spawn the units (spawn unit xyz at waypoint 'spawnname').
Or you spawn a whole team. Therefore you go to the team-editor first, go to the player which should get the units and add a new team. Then you can give this team units, f.e. min 1, max 1 Mordorfighterhorde.
Afterwards you say in the script:
Spawn an instance of team 'teamname'.

If you want the units to move in the map you have to additionally set a waypointpath (klick on the spawnpoint with the waypopinttool, hold it and pull the mouse somewhere else. A second waypoint will appear and a red arrow.)
Now you have to name the waypointpath and add as a second action:
Have team/unit follow waypointpath.

or you just add another waypoint and say: move team/unit to waypoint)


They can't get upgrades, because it isn't defined in the inis.^^ You have to add the upgrades to the unit with the inis. I personally would say: Try it yourself, you learn most by doing it yourself^^)

calsash:

--- Zitat von: Gnomi am 27. Feb 2016, 09:48 ---This is scriting. Therefore give the flag a name and set a waypoint (this is where the units start) and open the scripting menu in the worldbuilder.
Script 1:

Script conditions:
If Unit 'Flagname' belongs to player 'Playername'
then
Actions if TRUE:
start timer 'Troupsarrive' with 'XXX' seconds

Script 2:
If Timer Troupsarrive is finished
then
spawn units


Spawn units can be different things:
Either you just spawn the units (spawn unit xyz at waypoint 'spawnname').
Or you spawn a whole team. Therefore you go to the team-editor first, go to the player which should get the units and add a new team. Then you can give this team units, f.e. min 1, max 1 Mordorfighterhorde.
Afterwards you say in the script:
Spawn an instance of team 'teamname'.

If you want the units to move in the map you have to additionally set a waypointpath (klick on the spawnpoint with the waypopinttool, hold it and pull the mouse somewhere else. A second waypoint will appear and a red arrow.)
Now you have to name the waypointpath and add as a second action:
Have team/unit follow waypointpath.

or you just add another waypoint and say: move team/unit to waypoint)


They can't get upgrades, because it isn't defined in the inis.^^ You have to add the upgrades to the unit with the inis. I personally would say: Try it yourself, you learn most by doing it yourself^^)

--- Ende Zitat ---
Thank you Gnomi 1 more question should the flag be neutral? because for some reason i cant actually capture the flag.

Gnomi:
To capture a flag, there need to be a building right beside it which can be captured. If there is no capturable building the flag can't be captured. (either you make a building capturable or you just place an inn, scale it to 0.01 and z=-1 (or something else so you don't see it) and make it not selectable.

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln