Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 03-12-2012, 05:22 AM
hc_wolf hc_wolf is offline
Approved Member
 
Join Date: Jul 2010
Posts: 439
Question Investigation into multi Spawn of same chief naming???

Hi,

I have a curly one.

I have a script that works fine on individual triggers. But I want to bundle two triggers together.

1) So the first thing is a group spawn 11_Chief
2) Then it triggers an action "action1 ASpawnGroup 0 11_Chief"

3) Since 11_Chief already exists it spawns IN GAME a 1:11_Chief when you right click on the screen and view vheicles you see this.

4) The issue is when you look below I have named trigger Target1_1 1:Chief but it does not recognise that as the valid name in game to set the trigger off.

Anyone know what naming the 1:11_Chief should be in the below trigger area???


I know i can just hard code a second chief called 12_Chief but that is not what I want. Anyone know what the TRIGGER 1:11_Chief should be in .mis file. I have tried these and they don't seem to work

below do't work.
Target1_1 TGroupDestroyed 1:11_Chief 100
Target1_1 TGroupDestroyed _11_Chief 100
Target1_1 TGroupDestroyed 1_11_Chief 100
Target1_1 TGroupDestroyed 11_1_Chief 100




[Trigger]
Target1 TGroupDestroyed 11_Chief 100
Target1_1 TGroupDestroyed 1:11_Chief 100

[Action]
action1 ASpawnGroup 0 11_Chief

Code:
    public override void OnTrigger(int missionNumber, string shortName, bool active)
    {
        base.OnTrigger(missionNumber, shortName, active);


 if (("Target1".Equals(shortName) && active) && ("Target1_1".Equals(shortName) && active))
      
  {
     GamePlay.gpHUDLogCenter("Column destroyed!!!");
            GamePlay.gpGetTrigger(shortName).Enable = false;

        }
__________________
__________________
Win7, 64bit Ultra
Asus P8P67Pro MB
Intel i7-2600K
Coursair 16GB (4x 4GB), DDR3-1600MHz
Gainward Nvidia 580GTX 3GB DDR5
850-Watt Modular Power Supply
WIN7 and COD on Gskill SSD 240GB
40" Panasonic LCD
TrackIR5 +
Thrustmaster Warthog stick, throttle & pedals
Reply With Quote
  #2  
Old 03-12-2012, 05:50 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

When you spawn a Group via action its the same as you load a submission. The 1: is the number of this submission (you can get the next Missionnumber with GamePlay.gpNextMissionNumber()). So the first Question is do you have MissionNumberListener = -1?
Reply With Quote
  #3  
Old 03-12-2012, 05:54 AM
Smokeynz Smokeynz is offline
Approved Member
 
Join Date: Apr 2011
Posts: 106
Default

good point Kodiak

From my limited experience each occurance of an object, no matter what it is has an internal identifer related to mission number, shortname and active.

Anyway your code may be asking the wrong question, && is adding both objects together" object and object", using | is syntax for "or" so you would then be "object or object"

I might also add read this thread refering to trigger spawning, I see a few differences to your current script which may be helpful.
http://forum.1cpublishing.eu/showthread.php?t=26515
Reply With Quote
  #4  
Old 03-12-2012, 06:40 AM
hc_wolf hc_wolf is offline
Approved Member
 
Join Date: Jul 2010
Posts: 439
Default

Hi guys, hope you would be on reading this.

Yes I forgot to add MissionNumberListener = -1 to this smaller script for testing but it is in the larger one.

I do not import a new mission on trigger it is all run from the one mission and .cs file.


Also I want the syntax for 'AND' not 'OR' cause I want it to say that objective is complete if Target 1 & Target 2 are triggered. So the Syntax for 'AND' is && or something else?

So it registers that both triggers destroy and so both triggers are active as i changed
Target1_1 TGroupDestroyed 11_Chief 100

But this is not correct also. So I think I wil have go to with two separate Chiefs and not a respawn of the first as both Trigger 1 and two refer to the same group and the groups are dont individually designed like 10Cheif and 11_Cheif


will read the link now.

Thanks guys
__________________
__________________
Win7, 64bit Ultra
Asus P8P67Pro MB
Intel i7-2600K
Coursair 16GB (4x 4GB), DDR3-1600MHz
Gainward Nvidia 580GTX 3GB DDR5
850-Watt Modular Power Supply
WIN7 and COD on Gskill SSD 240GB
40" Panasonic LCD
TrackIR5 +
Thrustmaster Warthog stick, throttle & pedals
Reply With Quote
  #5  
Old 03-12-2012, 07:00 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Ah ok a little misinterpretion


first
if (("Target1".Equals(shortName) && active) && ("Target1_1".Equals(shortName) && active))

couldnt work there is only one shortName it could be Target1 or Target1_1 but never both.

So you can create a global bool variable.
Example
bool Target1triggered = false;
bool Target1_1triggered = false;


then in Ontrigger you can set
if ("Target1".Equals(shortName) && active)
{
Target1triggered = true;
}

if ("Target1_1".Equals(shortName) && active)
{
Target1_1triggered = true;
}

if (Target1triggered && Target1_1triggered)
{
// Your code
}

Or you check if the Trigger is enabled, normaly the trigger will be disabled (not the PassThru-Trigger) after activation.
if (GamePlay.gpGetTrigger("Trigger1").Enable == false && GamePlay.gpGetTrigger("Target1_1").Enable == false)
should became true
Reply With Quote
  #6  
Old 03-12-2012, 07:05 AM
hc_wolf hc_wolf is offline
Approved Member
 
Join Date: Jul 2010
Posts: 439
Default

You Wizzards of Code! Ok will put this together and test. let you know in a little while
__________________
__________________
Win7, 64bit Ultra
Asus P8P67Pro MB
Intel i7-2600K
Coursair 16GB (4x 4GB), DDR3-1600MHz
Gainward Nvidia 580GTX 3GB DDR5
850-Watt Modular Power Supply
WIN7 and COD on Gskill SSD 240GB
40" Panasonic LCD
TrackIR5 +
Thrustmaster Warthog stick, throttle & pedals
Reply With Quote
  #7  
Old 03-12-2012, 08:51 AM
Smokeynz Smokeynz is offline
Approved Member
 
Join Date: Apr 2011
Posts: 106
Default

Isnt he sneaky
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:29 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.