Looking for an if statement for campaign check

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

User avatar
Frumph
Posts: 302
Joined: Wed, 20. Nov 13, 03:12
x4

Looking for an if statement for campaign check

Post by Frumph »

if campaign[stage] || freeplay {

}

sort of thing for the xml mods

anyone know of any such beast?
User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13489
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid »

Hi Frumph ;-)

If I'm not mistaken then you are looking for the game start type of the player. This is stored in player.module and has values
  • ep1
    ep1open
    ep1trade
    ep1fight
    ep1build
for campaign, freeplay, merchant, assassin and builder.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

Check for Freeplay:

Code: Select all

player.module == "ep1open" or player.module == "ep1trade" or player.module == "ep1fight" or player.module == "ep1build" or player.module == "dlc1open"
Check for Campaign or cue status in general:

Code: Select all

md.<mdscriptname>.<cuename>.state == cuestate.complete or md.<mdscriptname>.<cuename>.state == cuestate.active
concrete example: Plot Chapter 2 started - entered DV:

Code: Select all

md.Plot_ep1_ch2.Part_1.state == cuestate.complete or md.Plot_ep1_ch2.Part_1.state == cuestate.active
(this checks if either the Player currently is at this part or has already finished it - if you want to check for finish only leave the second for active out ;) )
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
User avatar
Frumph
Posts: 302
Joined: Wed, 20. Nov 13, 03:12
x4

Post by Frumph »

Those look like conditions right?

not sure how I would put that inside of say zones.xml which isn't an MD; would it be the same?

You see, i'm having the zones.xml create stations at buildconnpc locations (having the system not create the whole thing right away) after the entry into maelstrom is what i'm going for

(or) not a campaign
User avatar
Frumph
Posts: 302
Joined: Wed, 20. Nov 13, 03:12
x4

Post by Frumph »

and wow, apparently somewhere through the revisions hidden ships and the building constructing based stations moved some other place ;/ need to search for those heh
User avatar
Frumph
Posts: 302
Joined: Wed, 20. Nov 13, 03:12
x4

Post by Frumph »

aaand nevermind, the cue's for the constructing of stations (not auto built) are inside the plotline's xml so what I want to do is not accomplishable

not to mention that the Part_5_BuildStation_3_delay wheatfarm is probably supposed to be a metal yard according to the notes everywhere ;/

..that and just adding the stations to the zones.xml in an already progressing game doesn't init the buy/sale wares on the stations so i'm kinda not-able to do that one either


Yeah, going to give up on this idea and move on to my next ;/ i really dislike those limitations
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

what do you want to do? if its building some stations based on plot progress its certainly doable, you just have to do some more things than just spawning them. what EGO does is a beginning, but not everything..
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
User avatar
Frumph
Posts: 302
Joined: Wed, 20. Nov 13, 03:12
x4

Post by Frumph »

I was thinking that campaign creates the stations in molten, however it seems a bit .. lacking. The corporations from OL and Albion, yoolis and others know about DV now and would want to start adding product to those areas.

Creating burn-resource stations and having the player be able to create resource accumulating ones would be nice.

I tried the action / you recommended above and it created the station outright but the stations do not have any trade's available when created. -- unless I add it to plot xml within the cue's when it creates those other stations in the area.

The problem *than* is that again the non-campaign starts don't get those stations.

Not to mention the CV's do not have enable-defense on them so that when random reivers fly by they are destroyed with ease. (bug yeah)

There's also the mention that sure, i'm a programmer .. of various *other* languages but XML scripting is quite new to me so trying to grasp the concept and i'm getting there so i'm smacking myself on the head thinking .. ok that' should work and heh it doesn't, but i'm learning by mimic'ing other pieces of code I come across. So the frustration level is hitting me.

*also* .. apparently the xml has changed quite a bit from last year when I was into it and a lot of it has been shuffled around - for the better i'm sure so relearning that as well.

Anyways.

What I wanted to do was if it was not a campaign and the Part_5_Station_Construction cue to execute in non-campaign and include a single station from all factions in various areas.

I can do that with auto-built in the zones.xml sure but the trades don't show up.

The idea with construction ship-builds is to have more 'things to do' with building the economy in DV, having player help build up the stations and their own at the same time; which to me sounds like a 'reason' to keep going after campaign is done and also in non-campaign.

So basically to sum it up, was to increase the various corporation's presence in the DV sectors as well as give more actions for the player to be included in
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

Frumph wrote:I tried the action / you recommended above and it created the station outright but the stations do not have any trade's available when created. -- unless I add it to plot xml within the cue's when it creates those other stations in the area.

The problem *than* is that again the non-campaign starts don't get those stations.
afaik the problem here is that the Stations are missing their control NPCs (Manager, Defense Officer, Engineer) - so you have to add them after the Stations 1st stage is finished (before that its not possible since there are no Platforms where you could add them)
Frumph wrote:Not to mention the CV's do not have enable-defense on them so that when random reivers fly by they are destroyed with ease. (bug yeah)
as previously, afaik missing DO - if you spawn the construction Ship you can simply create him with it this way:

Code: Select all

        <create_ship name="$ship" macro="macro.units_size_xl_d_capital_destroyer_2_macro" zone="player.primaryship.zone" >
          <owner exact="faction.player" />
          <safepos object="player.primaryship" />
          <pilot macro="character_split_m_a_macro">
            <owner exact="faction.player" />
            <skills>
              <skill type="boarding" exact="5"/>
              <skill type="combat" exact="5"/>
              <skill type="engineering" exact="5"/>
              <skill type="leadership" exact="5"/>
              <skill type="management" exact="5"/>
              <skill type="morale" exact="5"/>
              <skill type="navigation" exact="5"/>
              <skill type="science" exact="5"/>
            </skills>
          </pilot>
          <engineer macro="character_split_m_a_macro">
            <owner exact="faction.player" />
            <skills>
              <skill type="boarding" exact="5"/>
              <skill type="combat" exact="5"/>
              <skill type="engineering" exact="5"/>
              <skill type="leadership" exact="5"/>
              <skill type="management" exact="5"/>
              <skill type="morale" exact="5"/>
              <skill type="navigation" exact="5"/>
              <skill type="science" exact="5"/>
            </skills>
          </engineer>
          <defence macro="character_split_m_a_macro">
            <owner exact="faction.player" />
            <skills>
              <skill type="boarding" exact="5"/>
              <skill type="combat" exact="5"/>
              <skill type="engineering" exact="5"/>
              <skill type="leadership" exact="5"/>
              <skill type="management" exact="5"/>
              <skill type="morale" exact="5"/>
              <skill type="navigation" exact="5"/>
              <skill type="science" exact="5"/>
            </skills>
          </defence>
        </create_ship>
(taken from some test script of mine - just copy it and adjust the values to your needs ;) )
note that NPCs created this way have the wrong dialogue tree because spawning them like this doesnt trigger <event_platform_actor_created/> - if necesary i have made a small workaround for this that which fixes this by triggering the resulting actions manually ;) think i will make a Topic for that in a few minutes
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
User avatar
Frumph
Posts: 302
Joined: Wed, 20. Nov 13, 03:12
x4

Post by Frumph »

^ the zones.xml isn't a building situation, it just creates the stations out-right, done i.e. completed. The stations don't have their trade wares available if the game is in progress.

I do get what you're saying if it's cue'd as constructed though; which then I can mimic how the plot xml does it, but again those ships as well don't have defense enabled (even in the master campaign)

Return to “X Rebirth - Scripts and Modding”