Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: wistler on April 29, 2009, 08:29:37 am

Title: Campaign persistent variable instead of red alert.
Post by: wistler on April 29, 2009, 08:29:37 am
My missions work fine until I make one red alert. This seems to cause problems in the next mission which Freespace wiki says can happen. It recommends that I use campaign persistent variables and after reading through the walkthrough I still can't work out how to use one.

I need the ship that Alpha 1 has chosen as well as his weapons and hit points left to carry on over, but how would I write a Variable that checks these things before the mission ends?

Would anyone know how to do it?
Title: Re: Campaign persistent variable instead of red alert.
Post by: karajorma on April 29, 2009, 08:52:32 am
Read this (http://www.freespacefaq.com/fredretail.html#variables) and then this (http://www.freespacefaq.com/fredopen.html#variables) so that you have a good idea what variables and specifically campaign specific ones are for and how to use them.

The big problem with replacing red-alert with variables is that AFAIK there is no way to get which weapon Alpha 1 currently has if you offered the player a choice. You can figure out how much ammo they have left but not the type. That means you can either limit the player to a set loadout in mission 1 or we can figure out what went wrong with your red alert.
Title: Re: Campaign persistent variable instead of red alert.
Post by: wistler on April 29, 2009, 11:46:38 am
Well here's the problem, It's a Orion Destroyer that's suddenly stopped showing up at the beginning of the level but it's still in the Escort List  :hopping:

I changed the missions so they weren't red alert anymore but problem remains.

Code: [Select]
=================== ENDING LOAD ================
Real count = 463,  Estimated count = 425
================================================
Received post for event GS_EVENT_RED_ALERT during state transtition. Find Allender if you are unsure if this is bad.
Got event GS_EVENT_RED_ALERT (57) in state GS_STATE_START_GAME (52)
ANI 2_ssfighter2t-02.ani with size 560x368 (28.1% wasted)
SHIP ANI: Found hires version of 2_ssfighter2t-02.ani
ANI iconSD4 with size 56x24 (25.0% wasted)
ANI iconScalpel with size 56x24 (25.0% wasted)
ANI iconPromR with size 56x24 (25.0% wasted)
ANI iconPromS with size 56x24 (25.0% wasted)
ANI iconMX-64 with size 56x24 (25.0% wasted)
ANI iconTempest with size 56x24 (25.0% wasted)
ANI iconHornet with size 56x24 (25.0% wasted)
ANI iconBombardier with size 56x24 (25.0% wasted)
ANI 2_SD4.ani with size 332x304 (40.6% wasted)
ANI 2_Scalpel.ani with size 332x304 (40.6% wasted)
ANI 2_PromR.ani with size 332x304 (40.6% wasted)
ANI 2_PromS.ani with size 332x304 (40.6% wasted)
ANI 2_mx64.ani with size 332x304 (40.6% wasted)
ANI 2_Tempest.ani with size 332x304 (40.6% wasted)
ANI 2_hornet.ani with size 332x304 (40.6% wasted)
ANI 2_tornado.ani with size 332x304 (40.6% wasted)
Frame  0 too long!!: frametime = 27.835 (27.835)
Got event GS_EVENT_ENTER_GAME (2) in state GS_STATE_RED_ALERT (44)
Entering game at time =  35.403
ASSERTION: "objp->type == OBJ_SHIP" at Object.cpp:911
    hud_get_target_strength()    hud_escort_show_icon()    hud_display_escort()    HUD_render_2d()    game_render_hud_2d()    game_frame()    game_do_frame()    game_do_state()    gameseq_process_events()    game_main()    WinMain()    WinMainCRTStartup()    kernel32.dll 7c817067()
Freeing all existing models...
Title: Re: Campaign persistent variable instead of red alert.
Post by: karajorma on April 29, 2009, 12:50:17 pm
I'd probably need to see both missions to fix this one.