Jump to content

Bad script or corrupted executable?


Joaquin
 Share

Recommended Posts

HI,

I've got myself an extensive outline for an ACM with enough details to make it pretty interesting. I am having some problems with the script and I was wondering if someone would take a quick look at it. I've spent alot of time trying to debug it and I just don't see the problem (programmer's block or I've missed something in the instructions..hehe).

#

# SCRIPT Probation Patrol

#

#include glob_rg.scr

[dynamic]

#include glob_dyn.scr

#

[ai]

#include glob_ai.scr

#include glob_ag.scr

#

# Below is our control object, so, we hide and make it invincible

#

[dynamic]

galaxian diplomat,,ghq,probe1.3dc,satcom

[ai]

.ghq,100,100,100,100,100,100,1

start orbit blk05z^flx-11,5000,10,90,0

stop

events

!startup

cloak on this

invincible on this

autogen OFF

endevents

#

#

[acm]

CAMPAIGN.................TOD1 M1/?

THEATRE OF OPS...........POLARIS-2/POLARIS

MISSION CLASS............ROUTINE PATROL

.

BACKGROUND:

.

TESTING

.

:101,polar1z,setup_tod1m1,begin_tod1m1,resolve_tod1m1,tod1m1tick,1,45,15

#

# Adding Hyperspace drive into pod

[dynamic]

terran scientist,,cargo_pod,cargo2.3dc,pod

[ai]

.cargo_pod,100,100,100,100,100,100,0

start inactive near earthz^jmp-01 1000 earthz^jmp-02

stop

events 101

!begin_tod1m1

activate this

add_store this,1,331

endevents

#

#

# Asteroids

#

[dynamic]

unexplored hazard,,asteroid_m1,ast1a.3dc,asteroid_m1

[ai]

.asteroid_m1

start inactive near polar1z^jmp-30 1000 polaris-1

stop

.asteroid_m1

events 101

!begin_tod1m1

activate this

emit_sos off this

endevents

#

#Recon shuttle

#

[dynamic]

terran military,,marine_shuttle1,shuttle2.3dc,recon1

[ai]

.marine_shuttle1,100,100,100,100,100,100,0

start inactive near asteroid_m1 4000 polaris-1

stop

events 101

#

#THE FOLLOWING WORKS

#

!begin_tod1m1

activate this

halt on this

#

#THE FOLLOWING WORKS

#

!under_attack this

broadcast "May Day! May Day! Marine shuttle under attack"

endevents

#

#

# Explorer

#

[dynamic]

credian explorer,5,cred_explorer,megaron.3dc,Conquer

[ai]

.cred_explorer,100,100,100,100,100,100,0

start inactive near zelana 2000 moon-01

stop

events 101

#

#Unless you activate this unit, nothing within #its events block will work as expected.

#

!begin_tod1m1

activate this

#

Move this text to the marine_shuttle1 [ai] events 101 block.

#THE FOLLOWING DOES NOT WORK

#

!damaged marine_shuttle1 10

broadcast "Conquer reporting damage to Marine Shuttle"

#

#THE FOLLOWING DOES NOT WORK

#

!destroyed marine_shuttle1 bc

broadcast "!:Conquer reporting loss of Marine Shuttle"

TTFN

!tod1m1tick

#

#THE FOLLOWING IF WORKS

#

IF FLAG1 this RETURN

#

#THE FOLLOWING IF WORKS

#

IF BC IN polar2z THEN

activate this

patrol polar1z

FLAG1 on this

ENDIF

#

#THE FOLLOWING IF WORKS

#

IF BC IN polar2z THEN

attack marine_shuttle1

ENDIF

#

#THE FOLLOWING IF DOES NOT WORK

#

IF DESTROYED marine_shuttle1 THEN

broadcast "IF:Conquer reporting loss of Marine Shuttle"

ENDIF

endevents

#

$

I'd really appreciate any constructive criticism.

Thanks,

Joaquin

[ 11-05-2001: Message edited by: Joaquin ]

[ 11-05-2001: Message edited by: Supreme Cmdr ]

[ 11-05-2001: Message edited by: Gallion ]

Link to comment
Share on other sites

The SC pointed out one major script error and I think I found the other one Joaquin. Always place events that effect an actor in that actor's [ai] events block.

There are several minor ones - mostly script organization - left that should not hamper gameplay. Since you are familiar with various programming techniques Joaquin, I am sure that you can understand the need to organize and document your script.

I start with one script, the main one, that sets up the game universe and then calls other script files for each ACM TOD. This makes troubleshooting and corrections alot easier

My main script:

code:

# SCRIPT BC3K0500.SCR

# NAME Gallion

# WEB

# DATE 12 NOV 00

# NEW OBJECTS NONE

# NEW WORLD NONE

# NEW SOUNDS NONE

# VERSION Uses BC3K v2.09; Script v1.0

#

# SCENARIO: This is an Insurgent Advanced Campaign Module.

# Much of this scenario is taken from the original ACM

# written by Derek Smart, Creator of BC3000AD.

#

# SYSTEM SCRIPT - FREE FLIGHT SCENARIO (INSURGENT)

#

# This script is used for the Insugent Advanced Campaign Mode.

#

# In this mode, the player launches from Galcom HQ in the Insurgent caste.

# Script files used: BC3K0500.scr; iacmtod1.scr; iacmtod2.scr; iacmtod3.scr;

# iacmtod4.scr; iacmtod5.scr; and BC3K0500.des

#

#

#include glob_rg.scr

[dynamic]

#include glob_dyn.scr

#

[ai]

#include glob_ai.scr

#include glob_ag.scr

#

[dynamic]

galaxian diplomat,,ghq,probe1.3dc,satcom

[ai]

#

.ghq,100,100,100,100,100,100,1

face KARL.PCX

start orbit blk05z^flx-11,1000,10,90,0

stop

events

!startup

cloak on this

autogen ON

invincible on this

mod_alliance terran,vesperon,0

mod_alliance vesperon,terran,0

mod_alliance empirian,vesperon,0

mod_alliance vesperon,empirian,0

set_career insurgent

endevents

#

#acm_skip_enable ON

#include iacmtod1.scr

#include iacmtod2.scr

#include iacmtod3.scr

#include iacmtod4.scr

#include iacmtod5.scr

$

Here is an excerpt from one of my ACM TOD files; IACMTOD2.SCR:

code:

# INSURGENT ADVANCED CAMPAIGN MODE

# INSURGENT TOD2 4/5

# ARTIFACTS: NONE

#

# TOD2 4/5

#

[acm]

CAMPAIGN MODE: TOD2 M4/5

THEATRE OF OPS: CENTRIS/ALPHA CENTAURI

MISSION CLASS: STATION CAPTURE

SUCCESS: CAPTURE EARTHCOM STATION SCIDHQ

.

The time has come for us to strike EarthCOM facilities and increase

our presence closer to Sol.

.

Your orders are to capture the SCID HQ EarthCOM Station located in

in Centris. Unfortunately we cannot spare any forces to assist you

in this mission Commander!

.

Succeed and you further the Insurgent cause Commander! Fail and you

will become a target!

.

Rules of Engagement: NONE!

.

Good Luck Commander!

.

Insurgent One OUT!

.

END TRANSMISSION

.

#

:204,centrisz,setup_tod2m4,begin_tod2m4,resolve_tod2m4,tod2m4tick,20,100,20

#

[dynamic]

terran,earthcom,5,recap2041,bcruzmk2.3dc,ECV_DEW

[ai]

.recap2041,100,100,100,100,100,100,0

start inactive IN centrisz

stop

EVENTS 204

!destroyed this

broadcast "+500 Experience Points, ECV-DEW Destroyed"

ep_add,500

FLAG1 ON recap2041

SIGNAL hunter2042,3

!damaged this,50

launch fighter,4,ATTACK bc

!detect bc

attack bc

!hunter2041

activate this

halt off this

ENDEVENTS

#

[dynamic]

terran,earthcom,5,recap2042,bcruzmk2.3dc,ECV_EWE

[ai]

.recap2042,100,100,100,100,100,100,0

start inactive IN centrisz

stop

EVENTS 204

!destroyed this

broadcast "+500 Experience Points, ECV-EWE Destroyed"

ep_add,500

FLAG1 ON recap2042

SIGNAL hunter2043,4

!damaged this,50

launch fighter,4,ATTACK bc

!detect bc

attack bc

!hunter2042

activate this

halt off this

ENDEVENTS

#

[dynamic]

terran,earthcom,5,recap2043,bcruzmk2.3dc,ECV_FEEL

[ai]

.recap2043,100,100,100,100,100,100,0

start inactive IN centrisz

stop

EVENTS 204

!destroyed this

broadcast "+500 Experience Points, ECV-FEEL Destroyed"

ep_add,500

FLAG1 ON recap2043

SIGNAL hunter2044,5

!damaged this,50

launch fighter,4,ATTACK bc

!detect bc

attack bc

!hunter2043

activate this

halt off this

ENDEVENTS

#

[dynamic]

terran,earthcom,5,recap2044,bcruzmk2.3dc,ECV_LUCKY

[ai]

.recap2044,100,100,100,100,100,100,0

start inactive IN centrisz

stop

EVENTS 204

!destroyed this

broadcast "+500 Experience Points, ECV-LUCKY Destroyed"

ep_add,500

FLAG1 ON recap2044

!damaged this,50

launch fighter,4,ATTACK bc

!detect bc

attack bc

!hunter2044

activate this

halt off this

ENDEVENTS

#

.ghq

events 204

!begin_tod2m4

broadcast "Patrol Zone is Centris after you've Captured SCIDHQ Commander!"

patrolz bc centrisz

signal hunter2041

!resolve_tod2m4

IF FLAG1 recap2041 THEN

IF FLAG1 recap2042 THEN

IF FLAG1 recap2043 THEN

IF FLAG1 recap2044 THEN

broadcast "ALL SLIME Hunters destroyed"

broadcast "+1 COMBAT SHIELD"

add_medal 6,1

ep_add,1500

broadcast "+1500 Experience Points! Well done Commander!"

FLAG1 OFF recap2041

FLAG1 OFF recap2042

FLAG1 OFF recap2043

FLAG1 OFF recap2044

ENDIF

ENDIF

ENDIF

ENDIF

IF scidhq TAKEOVER terran insurgent THEN

broadcast "Mission success: SCID-HQ captured"

broadcast "+2500 EXPERIENCE POINTS +1 PLANETARY SHIELD MEDAL"

broadcast "Patrol Zone Secured, +500 EXPERIENCE POINTS"

add_medal 4,1

ep_add,3000

patrolz bc

ELSE

broadcast "Mission failure: SCID-HQ was not captured!"

broadcast "-55000 EXPERIENCE POINTS, +10 VIOLATIONS"

ep_dec,55000

patrolz bc

violation_add,10

acm_off,raider

ENDIF

endevents

#

Dont forget to include the MISSION SUCCESS blurb in. The SC added this to the mission statement way back in the BC3K v2.03 patch - I think Why? Because certain whinners were doing the BMC 'cause they couldn't figure out how to get a mission success. IOW they were to lazy to figure out, on their own, how to successfully complete a mission.

Anyway, the docs that come with BC3K GBS give several good examples on how to format one's script. That is the example, along with the ACM acripts that came with BC3K, that I use when I script.

Another thing to remember, as you have experienced, just because a script parses without any errors does not necessarily mean that the script will play correctly. Include the parsing error message, along with the script that causes the error the next time you're stumped.

Enjoy and Welcome to My Nightmare

TTFN

[ 11-06-2001: Message edited by: Gallion ]

Link to comment
Share on other sites

quote:

The SC added this to the mission statement way back in the BC3K v2.03 patch - I think

I remember that. He darn near blew a gasket.

quote:

Why? Because certain whiners were doing the BMC 'cause they couldn't figure out how to get a mission success. IOW they were to lazy to figure out, on their own, how to successfully complete a mission.

It isn't that. The man is absolutely sadistic when it comes to those things.

Link to comment
Share on other sites

quote:


Originally posted by Joaquin:

Thanks SC and Gallion,

@#$%^&* I knew I had been staring at this thing too long! I'll make the changes as suggested.

I appreciate the help.

Joaquin


Believe me, it happens. Sometimes I stare at my scripts for so long, I go cross eyed trying to figure out why an event is not firing.

I do need to develop a new state machine which allows the runtime testing of scripts. This way, you could pop-up a console (ala Quake), alter a script, and execute it right there from inside the game.

In fact, I have it in my GBSII design docs but it kinda fell by the wayside and gave way to other critical things : like getting the damn game done.

Which reminds me, I may as well start working on the new GBSII docs. I will be releasing GBSII with BCStudio, PTEstudio etc. and with a lot of samples on scripting, moding etc.

[ 11-06-2001: Message edited by: Supreme Cmdr ]

Link to comment
Share on other sites

hehehe ... I feel your pain Joaquin Like you and the SC stated, I to get a case of the dufus when I stare at a script to long

quote:

Which reminds me, I may as well start working on the new
GBSII
docs. I will be releasing GBSII with BCStudio, PTEstudio etc. and with a lot of samples on scripting, moding etc.

Yes

TTFN

[ 11-06-2001: Message edited by: Gallion ]

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...