[CreateShip] please help

Creation, discussion, and balancing of game content such as techs, buildings, ship parts.

Moderator: Committer

Post Reply
Message
Author
newbie345
Space Krill
Posts: 3
Joined: Sat Oct 27, 2018 10:15 pm

[CreateShip] please help

#1 Post by newbie345 » Sat Oct 27, 2018 10:32 pm

Hi there,
First I wanna thank all of you doing all the programming and developing such a great game.
I am a newbie to programming myself, but started doing some "modifying" the game after a couple of sessions.

I would now like to improve the starting- conditions for a certain species.
I put following modification into the SP_......focs in /freeorion/default/scripting/species:
EffectsGroup
scope = Source
activation = Turn low = 1 high = 1
target = Source
effects = CreateShip designname = "SD_COLONY_SHIP" empire = Source.Owner species = Source.Species
Yet, no ship is created.

What am I doing wrong? Can one of you guys correct me?

Thanks a lot for your time and input.

User avatar
Dilvish
AI Lead, Programmer
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: [CreateShip] please help

#2 Post by Dilvish » Sun Oct 28, 2018 12:16 am

If you check your freeorion.log file I expect you'll see an error message there that would help. The problem I notice there is your line

Code: Select all

target = Source
Effectsgroups have no such line, the Target(s) is/are determined by the Scope. If you still have trouble with it, take a look at the Acirema FOCS file, they have a similar effect.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

newbie345
Space Krill
Posts: 3
Joined: Sat Oct 27, 2018 10:15 pm

Re: [CreateShip] please help

#3 Post by newbie345 » Sun Oct 28, 2018 8:01 am

Thank you for your feedback, Dilvish.

The log says
(...)error] client : ParseImpl.h:41 : More than one species has the same name, SP_HUMAN.
whereas line 41 of -in this case- the SP_HUMAN.focs is
designname = "SD_COLONY_SHIP"
I did not add any species and a.f.a.i.k. the species should only be taken by one player, right?

Any ideas?

/EDIT1:
I have renamed the "SD_COLONY_SHIP.focs" in "SM_COLONY_SHIP.focs" and moved it from ...\scripting\ship_designs\ to ...\scripting\monster_designs
(Just like the SM_ACIREMA_GUARD you referred to above.)
In addition IN the SM_COLONY_SHIP.focs I also changed the name to "SM_COLONY_SHIP", but left everything else untouched.
I still get the same error.

/EDIT2:
I Started a game as human and w/ only 1 AI-Player, so that there can most likely not be a collision w/ species.
I still get the same error.

/EDIT3:
I have now changed line 40-43 so that they now read
effects = CreateShip
designname = "SM_ACIREMA_GUARD"
empire = Source.Owner
species = Source.Species
So the SM_ACIREMA_GUARD should be created.
I still get the same error.
This does not make sense! Why does it give the message "...same name, SP_HUMAN" when I am trying to create an ACIREMA-ship?!

User avatar
Oberlus
Juggernaut
Posts: 841
Joined: Mon Apr 10, 2017 4:25 pm

Re: [CreateShip] please help

#4 Post by Oberlus » Sun Oct 28, 2018 9:31 am

SP_ACIREMA.focs.txt has this chunk:

Code: Select all

        EffectsGroup
            scope = Source
            activation = AND [
                Planet
                OR [
                    Turn low = 10 high = 10
                    Turn low = 80 high = 80
                    Turn low = 150 high = 150
                    Turn low = 220 high = 220
                    Turn low = 290 high = 290
                ]
                Not WithinStarlaneJumps jumps = 1 condition = And [
                    System
                    Contains And [
                        Planet
                        OwnedBy affiliation = AnyEmpire
                    ]
                ]
            ]
            effects = CreateShip designname = "SM_ACIREMA_GUARD" species = "SP_ACIREMA"
Assuming you are making a modified human species that overwrites current human, I think you'd have to leave alone the colony ship design and add something like this to the original SP_HUMAN.focx.txt file:

Code: Select all

        EffectsGroup
            scope = Source
            activation = AND [
                Planet
                Turn low = 1 high = 1
            ]
            effects = CreateShip designname = "SD_COLONY_SHIP" species = "SP_HUMAN"

newbie345
Space Krill
Posts: 3
Joined: Sat Oct 27, 2018 10:15 pm

Re: [CreateShip] please help

#5 Post by newbie345 » Sun Oct 28, 2018 9:46 am

Thank you, Obelus; thank you, Dilvish.

I figured out, what I did wrong:

I left the original SP_HUMAN.focs in the same directory (named "_ORI_SP_HUMAN.focs").
I did not consider, that it will also be loaded and especially ONLY be loaded insted of the SM_HUMAN.focs.
(That's where the messages "...more than one species.." came from.)

Hence, my modified SP_HUMAN.focs did not get loaded.../ was ignored...

It's working now!

THANK YOU!

Post Reply