Author Topic: Changin ship score during mission. Possible?  (Read 2973 times)

0 Members and 1 Guest are viewing this topic.

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Changin ship score during mission. Possible?
OK here's the scenario.  I have some mines inside some asteroids.  There are more asteroids then mines and which asteroids contain mines is randomly determined at mission start.  Now I would like the score for the mine to be awarded to whoever destroys the asteroid which sets off a SD of the mine.  I can't just assign a score to the asteroids because I don't want destroying an "empty" asteroid to give a score.  Is there any way during a mission to change the score of the asteroid from 0 to say 100 if it contains a mine?  Determining if it contains a mine is easy but I don't see any way to change the score. 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Shade

  • 211
Re: Changin ship score during mission. Possible?
As far as I know you can't change the ship's score in-mission, but if you're willing to jump through several hoops to get there, you might be able check for which ship killed the offending asteroid and use change-player-score to add in the extra points.
« Last Edit: September 17, 2008, 09:57:33 pm by Shade »
Report FS_Open bugs with Mantis  |  Find the latest FS_Open builds Here  |  Interested in FRED? Check out the Wiki's FRED Portal | Diaspora: Website / Forums
"Oooooooooooooooooooooooooooooooooooooooh ****ing great. 2200 references to entry->index and no idea which is the one that ****ed up" - Karajorma
"We are all agreed that your theory is crazy. The question that divides us is whether it is crazy enough to have a chance of being correct." - Niels Bohr
<Cobra|> You play this mission too intelligently.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Changin ship score during mission. Possible?
Can't do that it's for TBP so it's a 3.6.9 build. 

Any way to make weapons pass through an object?  If they went through the asteroid and killed the mine it would award the correct score and also give the proper effect. 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Colonol Dekker

  • HLP is my mistress
  • 213
  • Aken Tigh Dekker- you've probably heard me
    • My old squad sub-domain
Re: Changin ship score during mission. Possible?
Make a new asteroid class with zero score but high damage and a low blast radius? That way the mines would die. Or a new transparent class of rock. Tbqh i'm knackered and not thinking straight, bit twingy due to humidity is the only reason i'm not asleep yet.
Campaigns I've added my distinctiveness to-
- Blue Planet: Battle Captains
-Battle of Neptune
-Between the Ashes 2
-Blue planet: Age of Aquarius
-FOTG?
-Inferno R1
-Ribos: The aftermath / -Retreat from Deneb
-Sol: A History
-TBP EACW teaser
-Earth Brakiri war
-TBP Fortune Hunters (I think?)
-TBP Relic
-Trancsend (Possibly?)
-Uncharted Territory
-Vassagos Dirge
-War Machine
(Others lost to the mists of time and no discernible audit trail)

Your friendly Orestes tactical controller.

Secret bomb God.
That one time I got permabanned and got to read who was being bitxhy about me :p....
GO GO DEKKER RANGERSSSS!!!!!!!!!!!!!!!!!
President of the Scooby Doo Model Appreciation Society
The only good Zod is a dead Zod
NEWGROUNDS COMEDY GOLD, UPDATED DAILY
http://badges.steamprofile.com/profile/default/steam/76561198011784807.png

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Changin ship score during mission. Possible?
Can't it's multiplayer. 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Shade

  • 211
Re: Changin ship score during mission. Possible?
Quote
Any way to make weapons pass through an object?   If they went through the asteroid and killed the mine it would award the correct score and also give the proper effect.

Can't do that either as far as I'm aware, but it did give me an idea. You can set the score for the mine asteroids in the ships editor and then, instead of having them in the mission from the start, have them plus all but one non-mine asteroid arrive one second in using a 'near ship' arrival to an asteroid already in place, as that will completely randomize their locations. Set player entry delay to 2 seconds and that should be that. In theory.

Or, if you want more control, you could use set-object-position to do it - This would probably be hell to FRED without the nested argument fixes, which I'm not sure are available in a 3.6.9 build, but should still be doable given enough time, sweat and work.
« Last Edit: September 17, 2008, 10:00:03 pm by Shade »
Report FS_Open bugs with Mantis  |  Find the latest FS_Open builds Here  |  Interested in FRED? Check out the Wiki's FRED Portal | Diaspora: Website / Forums
"Oooooooooooooooooooooooooooooooooooooooh ****ing great. 2200 references to entry->index and no idea which is the one that ****ed up" - Karajorma
"We are all agreed that your theory is crazy. The question that divides us is whether it is crazy enough to have a chance of being correct." - Niels Bohr
<Cobra|> You play this mission too intelligently.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Changin ship score during mission. Possible?
Well it's a ground assault mission so the asteroids aren't really asteroids but rocks on the ground.  Having them not there at mission start would look bad.  I'm warping the mines inside them after the mission starts.   Oh and there is another catch.  Depending on the difficulty level there could be anywhere from 0 to 24 mines. 

Just hit another hitch that you mentioned.  I need nested when-arguments now too.  Not for this but for the ending.  Need a series of explosions so I need 3 <arguments> for the coordinates.  Only way I can think of doing it without a bunch of events is to use when-argument with in-sequence for each coordinate. 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Shade

  • 211
Re: Changin ship score during mission. Possible?
Since you need the nested arguments anyway, you should be able to do something like this (probably full of problems but it'll get the idea across), and then use set-object-position combined with get-object-x/y/z on the mines to place them in their appropriate rocks:

- op when-argument
   - op in-sequence
      # <list of X coords>
   - op true
   - op modify-variable
      # X(0)
      # <argument>
   - op invalidate-argument
      # <argument>
   - op when-argument
      - op in-sequence
         # <list of Y coords>
      - op true
      - op modify-variable
         # Y(0)
         # <argument>
      - op invalidate-argument
         # <argument>
      - op when-argument
         - op in-sequence
            # <list of Z coords>
         - op true
         - op modify-variable
            # Z(0)
            # <argument>
         - op invalidate-argument
            # <argument>
         - op when-argument
            - op random-multiple-of
               # <list of asteroids>
            - op true
            - op set-object-position
               # <argument>
               # X(0)
               # Y(0)
               # Z(0)
            - op invalidate-argument
               # <argument>


As for it looking bad if they're not there from the start, that's why I included a player entry delay. That *should* let the arrivals or SEXPs do their thing before the players get a chance to look at it.

[Edit] And even if the delay doesn't work in multi (I actually don't remember if it does), using the SEXP method will sort it all out in few frames, so all you'd have to do is make sure the players are not facing a nearby rock at the mission start (or have their view obstructed in some other fashion) and it'll be in place before they can turn.
« Last Edit: September 17, 2008, 10:36:29 pm by Shade »
Report FS_Open bugs with Mantis  |  Find the latest FS_Open builds Here  |  Interested in FRED? Check out the Wiki's FRED Portal | Diaspora: Website / Forums
"Oooooooooooooooooooooooooooooooooooooooh ****ing great. 2200 references to entry->index and no idea which is the one that ****ed up" - Karajorma
"We are all agreed that your theory is crazy. The question that divides us is whether it is crazy enough to have a chance of being correct." - Niels Bohr
<Cobra|> You play this mission too intelligently.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Changin ship score during mission. Possible?
Actually it doesn't need to be nested.  I swear I'm going to just start FREDing in the shower.  As soon as I got in there it hit me this would work:

When
-->true (replace with the necessary event later)
-->when-argument
---->in-sequence
------->list of x coordinates
---->true
----->modify-variable
------->x1
-------><argument>
-->when-argument
---->in-sequence
------->list of y coordinates
---->true
----->modify-variable
------->y1
-------><argument>
-->when-argument
---->in-sequence
------->list of z coordinates
---->true
----->modify-variable
------->z1
-------><argument>
-->explosion-effect (or whatever it's called)
---->x1
---->y1
---->z1
..........

Doesn't help for the asteroid problem.  Player entry delay doesn't even do anything in single unless something been changed.  Having the view blocked isn't possible as the only cap ship in the game is behind the players so the whole field of view is visible.  There are always 24 rocks but not always 24 mines so trying to shuffle them around without looking bad would be nearly impossible. 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Changin ship score during mission. Possible?
Yep, Nesting that way round should work perfectly well in 3.6.9. The bug was caused by the inner When/When-argument SEXP wiping out the complete argument list when it exited leaving the outer when-argument with a broken list.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Changin ship score during mission. Possible?
Well apparently a when-argument inside a when doesn't work either.  Tried to add it 5 times and I CTD every time.  Even broke it down into steps.  As soon as you try to do a modify-variable with <argument> splat.  Looks like the special effects will need to wait until 3.6.10.

No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Changin ship score during mission. Possible?
My bad it does work I just forgot to convert the string to a number before storing it to a numeric variable.  Lack of beer last night.

Moving on to a probable feature request.  I am going to be able to do one of 2 explosion sequence that I want.  The other I don't think there is anyway to do.  Something along the same lines but instead of in-sequence for the coordinates I wanted a few random ones.  The problem is I can't think of any way to get multiple when-arguments to return an argument at the same position in the list.  So if I have say a list of 10 explosion points that I want to happen randomly and I use rand-multi for the x coordinate there is no way I can think of to get the corresponding y and z coordinates. 

So I was thinking what about a when-arguments which would do something like this:

When-arguments
-->random-of
----->3 (number of arguments in a group)
----->200
----->0
----->0
----->-200
----->0
----->0
----->400
----->0
----->0
----->-400
----->0
----->0
-->true
-->modify-variable
---->x
----><argument>
-->increment-argument (goes to the next argument in the list)
-->modify-variable
---->y
----><argument>
-->increment-argument
-->modify-variable
---->z
----><argument>
-->invalidate-arguments (invalidates the group of arguments)

This would basically only allow random-of to pick items 2, 5, 8, etc in the list giving you control to increment to the next item in the list and store the value.  Of course it wouldn't just be for random-of it could be used with in-sequence, number-of, etc.    I've already run into 3 places in this one mission where it would come in handy. 

Of course an implementation of array variables and functions would probably be even better but that would be a little more then a feature request.   :pimp:



« Last Edit: September 18, 2008, 07:44:01 pm by FUBAR-BDHR »
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Changin ship score during mission. Possible?
Well something is screwy with this.  Not really sure what but it's not working.  Here's what I've been testing:

when
-->has-time-elapsed
----->10
-->when-argument
---->in-sequence
------>512
------>512
------>0
---->true
---->modify-variable
------>x1
------>string-to-int
--------><argument>
---->send-message
------->#command
------->high
------->x set
---->invalidate-argument
------><argument>
-->when-argument
---->in-sequence
------>20
------>-5
------>-10
---->true
---->modify-variable
------>y1
------>string-to-int
--------><argument>
---->send-message
------->#command
------->high
------->y set
---->invalidate-argument
------><argument>
-->when-argument
---->in-sequence
------>1000
------>1000
------>800
---->true
---->modify-variable
------>z1
------>string-to-int
--------><argument>
---->send-message
------->#command
------->high
------->z set
---->invalidate-argument
------><argument>
-->when-argument
---->in-sequence
------>500
------>700
------>1000
---->true
---->modify-variable
------>size1
------>string-to-int
--------><argument>
---->send-message
------->#command
------->high
------->size set
---->invalidate-argument
------><argument>

when
-->not
---->=
------>size1
------>0
-->explosion-effect
---->x1
---->y1
---->z1
---->10
---->10
---->size1
---->10
---->size1
---->0
---->1
---->7
-->modify-variable
---->size1
---->0
-->send-message
---->#command
---->high
---->boom

Default value of all variables is 0 and both event are repeating 999999999 times at 1 second delay.  The original test I had had the explosion-effect in the first event.  I heard the noise but didn't see anything.  Added messages and changed it to what's posted now and I don't even get any sound or messages.  Also tried replacing <argument> in the string-to-int functions with actual values instead of <argument> and still no effect. Tested in the latest Kightly build with the same results.  It's like it's not processing the when-argument inside the when at all.  Either that or it's hitting the string-to-int and just ignoring the rest of the when-argument. 

Also tried just doing an explosion-effect with values and that does work.   


Took out all the string-to-int and replaced with hard coded numbers.  Still does nothing.

Edit 2:  Defiantly something to do with the when-arguments inside of the when.  I just moved them all to separate evens and they worked.  Game crashed right after the explosions though so now I have something else to track down. 

Edit 3:  Apparently 1000 was too big of an explosion size resulting in a crash.
« Last Edit: September 22, 2008, 01:21:13 am by FUBAR-BDHR »
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Changin ship score during mission. Possible?
Mantis that last one as it's a bug the explosion-effect SEXP should be changed to handle then.

Not sure why the rest isn't working though. Try a very recent build (i.e anything after I committed the argument fix) and see if that fails too.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Changin ship score during mission. Possible?
Mantised that one as soon as I confirmed it.  That when/when-argument I wasn't sure what to do with. 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Changin ship score during mission. Possible?
If it doesn't work in 3.6.10 then it should be mantised. But make sure you use a very recent build. There was an error in the one I posted the first time round and I had to rip it out of SVN and replace it later with one which did work.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Changin ship score during mission. Possible?
I tested using the latest one available form the Knightly builds.  I'll stick it in there then.  Wasn't sure if I was just missing something in the way it worked or not.  Was trying 3 things at the same time I never did before (string-to-int, explosion-effect, and the when/when-argument). 

Only had a problem with 2 out of 3.  Seems I'm slipping a bit.   :pimp:
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Re: Changin ship score during mission. Possible?
Too long; didn't read. Just thought I'd add that you can assign events a point value so when they trigger you can add that many points.
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Re: Changin ship score during mission. Possible?
An easy and cheap way to get the same result is to duplicate the table entry, change the score and then use change-ship-class...

Or better, create an event triggered by the destruction of the given ship and set a score for it.
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito
My interviews: [ 1 ] - [ 2 ] - [ 3 ]

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Re: Changin ship score during mission. Possible?
The former won't work, as it's TBP and Multiplayer and in any case a really really ugly solution.

The latter is what I was thinking.
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...