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 05-20-2011, 02:27 AM
SEE SEE is offline
Approved Member
 
Join Date: Oct 2009
Posts: 1,678
Default

+1 for the despawn waypoint.

I currently have a major headache with the script Trigger-Action Commands. I need an AI ac to land and for that ac to spawn another AI to take off. That results (or would) in a unwanted ground object doing nothing and showing up on the map if icons are enabled (despawn would be nice and simple for me). It should be possible to do this using the 'Group' and Passthorugh (an area on the runway) to act as a trigger but there appears to be a bug in that anything that lands automatically taxis to the same spawn point needed for the newly spawned ac - so it doesn't spawn! If you place an object on the runway and destroy the ac on the runway - the new ac spawns. You can use group and all the other commands with 'passthrough' to spawn Airgroups except a 'group' with a landing waypoint!

So, if there is a script please let me know or alternatively, can we also have a 're-arm' way point for AI ac to 'land - wait - and takeoff'!


Having spent hours on this problem I selected every available ac to land and they all appear to use the same algorithm for landing irrrespective of the FM for that ac........which may explain why some go 'tits up' on landing and others are OK! If you want to spawn a new AI - use the Anson....it can't land without going 'arse over tip' and your new AI spawns in its Hanger (and the Anson despawns!).....

Last edited by SEE; 05-20-2011 at 02:34 AM.
Reply With Quote
  #2  
Old 05-20-2011, 04:41 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

I think you can destroy an AC onAircraftLanding or do some damage to it, e.g. kill engine preventing it taxiing to a parking slot.
Reply With Quote
  #3  
Old 05-20-2011, 05:05 AM
ZaltysZ's Avatar
ZaltysZ ZaltysZ is offline
Approved Member
 
Join Date: Sep 2008
Location: Lithuania
Posts: 426
Default

Quote:
Originally Posted by Ataros View Post
I think you can destroy an AC onAircraftLanding or do some damage to it, e.g. kill engine preventing it taxiing to a parking slot.
OnAircraftLanded() is called only after plane stops. In case of AI, plane stops only after it reaches parking spot.
Reply With Quote
  #4  
Old 05-20-2011, 07:18 AM
Flashman Flashman is offline
Approved Member
 
Join Date: May 2010
Posts: 109
Default

Quote:
Originally Posted by SEE View Post
+1 for the despawn waypoint.

I currently have a major headache with the script Trigger-Action Commands. I need an AI ac to land and for that ac to spawn another AI to take off. That results (or would) in a unwanted ground object doing nothing and showing up on the map if icons are enabled (despawn would be nice and simple for me). It should be possible to do this using the 'Group' and Passthorugh (an area on the runway) to act as a trigger but there appears to be a bug in that anything that lands automatically taxis to the same spawn point needed for the newly spawned ac - so it doesn't spawn! If you place an object on the runway and destroy the ac on the runway - the new ac spawns. You can use group and all the other commands with 'passthrough' to spawn Airgroups except a 'group' with a landing waypoint!

So, if there is a script please let me know or alternatively, can we also have a 're-arm' way point for AI ac to 'land - wait - and takeoff'!


Having spent hours on this problem I selected every available ac to land and they all appear to use the same algorithm for landing irrrespective of the FM for that ac........which may explain why some go 'tits up' on landing and others are OK! If you want to spawn a new AI - use the Anson....it can't land without going 'arse over tip' and your new AI spawns in its Hanger (and the Anson despawns!).....
I dont know if you are trying to use the ACTION and TRIGGER settings as well as adding a script, but so far I have found that having a script disables the trigger and action setting, i.e. they just don't work. For that reason I dont use them at the moment and also we need the despawn script for MP.

But if you are using both that might help you find your solution.
Reply With Quote
  #5  
Old 05-20-2011, 07:20 AM
Flashman Flashman is offline
Approved Member
 
Join Date: May 2010
Posts: 109
Default

Hi EnlightenedFLorist,

I will have a look at that, though I have no knowledge of C++ and so far my scripts consist of hacking up other peoples and hoping they work!

Im really hoping 1C can include this Despawn idea as a setting in the FMB, it would be most helpful.

Anyhoo, I will have a look, do some swearing, and will see what I can come up with.

Cheers
Reply With Quote
  #6  
Old 05-20-2011, 07:49 AM
TheEnlightenedFlorist TheEnlightenedFlorist is offline
Approved Member
 
Join Date: May 2011
Location: SLC, Utah, USA
Posts: 143
Default

Quote:
Originally Posted by Flashman View Post
so far I have found that having a script disables the trigger and action setting, i.e. they just don't work. For that reason I dont use them at the moment and also we need the despawn script for MP.
I think what might be happening is that when you add a script, the game expects you to deal with triggers and actions in the script. They work fine with my scripts. I actually don't know how to use triggers or actions without a script.

If you need help writing a script, you can post it on the forum and I'm sure there'll be plenty of people willing to help you out.

Also, scripts are written in C#, not C++. C# is very much like Java and way easier to work with than C++. I don't want you to go learning C++ when you should be learning C#.

Last edited by TheEnlightenedFlorist; 05-20-2011 at 08:15 AM.
Reply With Quote
  #7  
Old 05-20-2011, 10:22 AM
SYN_Flashman SYN_Flashman is offline
Approved Member
 
Join Date: Feb 2011
Posts: 48
Default

Quote:
Originally Posted by TheEnlightenedFlorist View Post
Also, scripts are written in C#, not C++. C# is very much like Java and way easier to work with than C++. I don't want you to go learning C++ when you should be learning C#.
Now worries on that score, I wasn't planning on learning either, my brain isn't big enough! I learn just enough to make it appear i know what im doing when in fact I haven't a bloody clue. Mcuh like the rest of my life really....

I will have a look at using triggers and actions within the script itself as some are quite useful. I did have a mission where if one plane was shot down another would spawn... lots of potential with that one.

There is a lot to learn, but equally there is a lot we can do that is really interesting.

I will post up my next daft script and see what people think later on when im home. Cheers!
Reply With Quote
  #8  
Old 05-20-2011, 12:01 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

If you want to destroy aircraft loaded by submissions do not forget to include
Code:
//////////////////////////////////////////////////////////////////////////////////////////////////

    //Listen to events of every (sub)mission
    public override void Init(maddox.game.ABattle battle, int missionNumber)
    {
        base.Init(battle, missionNumber);
        MissionNumberListener = -1; //Listen to events of every mission
    }

 //////////////////////////////////////////////////////////////////////////////////////////////////
I made that mistake. Thanks to ZaltysZ for correcting it in my script!
Reply With Quote
  #9  
Old 05-20-2011, 12:22 PM
SYN_Flashman SYN_Flashman is offline
Approved Member
 
Join Date: Feb 2011
Posts: 48
Default

Quote:
Originally Posted by Ataros View Post
If you want to destroy aircraft loaded by submissions do not forget to include
Code:
//////////////////////////////////////////////////////////////////////////////////////////////////

    //Listen to events of every (sub)mission
    public override void Init(maddox.game.ABattle battle, int missionNumber)
    {
        base.Init(battle, missionNumber);
        MissionNumberListener = -1; //Listen to events of every mission
    }

 //////////////////////////////////////////////////////////////////////////////////////////////////
I made that mistake. Thanks to ZaltysZ for correcting it in my script!
How do I use this piece of script, do I just copy and paste it into mt script or do I need to make any changes?
Reply With Quote
  #10  
Old 05-20-2011, 12:27 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

@ Flashman
Just copy and past anywhere you like. You can always check out my recent script in Online Missions go here thread.


@all
It seems like this script I use does not destroy ships loaded by a submission. Other ground units are destroyed as intended. What can be wrong? IIRC ships belong to AiGroundActor

Code:
    //Ground objects (except AA Guns) will die after 55 min when counted from their birth

    public override void OnActorCreated(int missionNumber, string shortName, AiActor actor)
    {
        base.OnActorCreated(missionNumber, shortName, actor);
        //Ground objects (except AA Guns) will die after 55 min when counted from their birth
        if (actor is AiGroundActor)
            if ((actor as AiGroundActor).Type() != maddox.game.world.AiGroundActorType.AAGun)
                Timeout(3300, () =>
                {
                    if (actor != null)
                    { (actor as AiGroundActor).Destroy(); }
                }
                        );
    }
Complete code here http://forum.1cpublishing.eu/showpos...5&postcount=41

Last edited by Ataros; 05-20-2011 at 12:34 PM.
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 05:47 PM.


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