Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 10/6/07 9:26

Tantir
Member
From: Cracow
Registered: 10/6/07

I made scripted mod...

yeah... I made.
And I dont know where i should send it to share it with your...
link: www.savefile.com/files/797217

Offline

#2 15/6/07 8:46

Tyr
Member
From: The Netherlands
Registered: 9/5/07
Website

Re: I made scripted mod...

It has potential, but it's becoming a bit too hard (atleast for me) smile

Also I crash when performing the super combo (p-p-k), with a "Blam, Oni Crashed".

For the rest nice

Offline

#3 15/6/07 10:48

paradox-01
Member
From: Germany
Registered: 14/1/07

Re: I made scripted mod...

Confirmed. The bug is triggered by ppk - and caused by the missing oni menu (version 3) . One have to place them together. Good work nevertheless, Tyr  Edit: ..ahm.. I mean Tantir.^^

Point of Gameplay: arrg, the ninja corps was my end. big_smile  (Maybe this phase should be played in "carousel"-mode.)

Last edited by paradox-01 (15/6/07 13:13)

Offline

#4 15/6/07 11:07

Tantir
Member
From: Cracow
Registered: 10/6/07

Re: I made scripted mod...

Ninja are easiest. TCTF troops get guns and they kill ninjas. hard is next wave, with ... emk... with cow (or pig) ;p. It`s too hard?? maybe little, but if you play one tousend times   like me you will think "it`s too easy" ;p


aha, i based on "tower of dooms" and i don`t know abaut oni menu (or something like that). I have this bug p-p-k so where can i get Oni menu or what i could do with this problem..?

Last edited by Tantir (15/6/07 11:43)

Offline

#5 15/6/07 12:22

paradox-01
Member
From: Germany
Registered: 14/1/07

Re: I made scripted mod...

I tried a few more, the stupid tctf didn't shoot at first try but now. roll
However... The next wave killed me. I guess I need more luck^^

"I have this bug" What?  Maybe I applaud too early. What did you do by yourself then? hmm (No real criticism, I just want to know.)

func pre(void) {
# launch Oni Menu if you have it
fork om_core_3
# Super Kick script
fork super_kick
# Super Punch script
fork super_punch
}

To solve your problem:

A) make a "#" before "fork om_core_3" or delete the line.

B) Or download the menu HERE and place them into the compound folder.
(It isn't that much useful in fighting situation but give you a lot a funny stuff e.g. running in air... Try it out. Run backwards and kick to activate it.)

screen_shot00000.png

Last edited by paradox-01 (15/6/07 14:09)

Offline

#6 15/6/07 12:52

Tantir
Member
From: Cracow
Registered: 10/6/07

Re: I made scripted mod...

Thanks.
I copy : "compound combos" from "towers of doom"
and

#
#
#
#

func void main(void)
{
#Hide dish2 gunk
env_show 401 1
env_shade 401 913 .2 .4 .2
env_show 402 1
env_shade 401 913 .2 .1 .3
env_show 403 1
env_shade 401 913 .3 .1 .3
env_show 404 1
env_shade 401 913 .3 .2 .1
env_show 405 1
env_shade 401 913 .1 .3 .2
env_show 406 1
env_shade 401 913 .2 .1 .4
env_show 407 1
env_shade 401 913 .1 .4 .1
env_show 408 1
env_shade 401 913 .4 .4 .1
env_show 409 1
particle dishpulse do start
particle sturm_ambient start
fork pre
gl_fog_blue=0.0
gl_fog_red=0.0
gl_fog_green=0.0
gl_fog_start=.985
gs_farclipplane_set 1000

.
It`s all.
I wrote myself other things.

Offline

#7 15/6/07 14:21

paradox-01
Member
From: Germany
Registered: 14/1/07

Re: I made scripted mod...

Sorry for giving you a false instruction: activation is by running backwards and kick in the run.

Okay. And in case you want to write more and don't know some commands:
- a tutorial "scratch" by "your mom"
- all functions

Additional you can use the global folder for scripts that work everywhere (if activate in the main function like "pre").

If you have questions I'm sure better coder than me will help you out. smile
Have fun!

Last edited by paradox-01 (15/6/07 14:22)

Offline

#8 15/6/07 18:47

geyser
Member
From: beyond the veil
Registered: 14/1/07
Website

Re: I made scripted mod...

Thanks for linking to the resources, paradox. I hope there'll be more to link to Soon(TM).

The global folder allows for some powerful scripting. But it doesn't work on the Mac or PC demo. So I no longer recommend it.

I haven't played this script yet; I've read it, though, since that gives me a good idea of what to expect smile

I 'd suggest a few improvements. Not to the content, but to the overall organization of the code.

You have a large number of waves there (each wave spawning several chars) in one very long function.
It would be nice to group the waves together, and to allow users to use savepoints to load certain waves.
If you want a demonstration of how to set up savepoints between the waves, see HERE (6th post on page)

It would also be nice to identify the operations that you use very often and to set up functions to do that.

For example, after spawning, you usually reset a character's inventory and teleport them to a certain flag.
Instead of writing those 3 statements (ai2_spawn, chr_teleport, chr_inv_reset) every time, you can write:

func SpawnNameFlagHealthReset(string n, int f, int h, int r){
    ai2_spawn(n); chr_teleport(n, f)
    if(h) chr_set_health(n, h)
    if(r) chr_inv_reset(n)
}

Then when you setup your waves, you can use lines like:

SpawnNameFlagHealthReset Griffin 23 600
SpawnNameFlagHealthReset Muro 22 2500
SpawnNameFlagHealthReset F_Er89 22 80 1
SpawnNameFlagHealthReset A_S1 24

(note that missing arguments are taken to be 0)

That's just an example of how you can use an extra function to make your code lighter.
That way, you don't have to write the same character name or flag ID more than once.
So it's easy and safe to replace a character with another one if you change your mind.

Last edited by geyser (15/6/07 18:50)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#9 16/6/07 10:04

Tantir
Member
From: Cracow
Registered: 10/6/07

Re: I made scripted mod...

Great thanks!!!
I made savepoints but i have 2 problem:
1)  TCTF troops, corps and weapons disappeared. Corps and weapon disappeared always, but why TCTF??
2) I can`t make : if((save_point) eq 4) fork .... because Oni crashed.
link: www.savefile.com/files/814590

Last edited by Tantir (16/6/07 10:04)

Offline

#10 16/6/07 13:08

geyser
Member
From: beyond the veil
Registered: 14/1/07
Website

Re: I made scripted mod...

1)
Do you mean corpses and weapons "always disappeared" (if you waited long enough)?
And at what moment do the TCTF troops "disappear" now? Only when you load a savepoint?
That's normal, since restore_game only takes care of Konoko, not any other characters.
So of course you have to "remember" what TCTF troops you should have spawned "so far"...
And then you will spawn one, two, three or four teammates, depending on the savepoint.

2)
Have a look at your file:

func main {
    fork setup(); restore_game
#    ...
    if((save_point) eq 0) fork begin
    if((save_point) eq 1) fork sniper
    if((save_point) eq 2) fork ninja
    if((save_point) eq 3) fork miesz
}
func setup {
#    ...
}
func begin {
#    ...
    fork pyrpeciarz

#OOPS! No "}" ?!

func pyrpeciarz {
#    ...
    save_point= 1; save_game 1 autosave
    fork sniper
}
 
func sniper {
#    ...
    save_point= 2; save_game 2 autosave
    fork ninja
}

func ninja {
#    ...
    save_point= 3; save_game 3 autosave
    fork miesz
}

func miesz {
#    ...
}

#    ...
    endgame
# OOPS! What function are we in?!

func void endgame(string ai_name) {
#    ...
    win
}

}
# OOPS! An extra "}" ?!

Looks like you messed up the closing braces ("}") when grouping the waves into functions smile


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#11 16/6/07 14:30

Tantir
Member
From: Cracow
Registered: 10/6/07

Re: I made scripted mod...

Thanks, when i trying add savepoints (i don`t copy "restore level") I  add extra "}"
I know, in my file is very big masc,  but  it working and I`m happy.
 

So of course you have to "remember" what TCTF troops you should have spawned "so far"...
And then you will spawn one, two, three or four teammates, depending on the savepoint.

No, because if someone play and "Druzyna Krowy" kill TCTF trooper,  after open savepoint TCTF trooper has resurrect. (hmm, I wrote nice sentence)
http://www.savefile.com/files/815147
Very sorry for my misteakes.

Offline

#12 16/6/07 17:11

paradox-01
Member
From: Germany
Registered: 14/1/07

Re: I made scripted mod...

God d**n, it didn't work for me and took hours figuring out...

I added "var int my_save_point=0;" and other nasty things.. ^_^'

var int my_save_point=0;

func pre(void) {
    # launch Oni Menu if you have it
    # fork om_core_3
fork super_kick
fork super_punch
}


func super_punch(void) {
chr_wait_animation 0 KONCOMcomb_p_p_p
slowmo 240
chr_animate 0 KONCOMsuper_punch
sleep 50
fork super_punch
}


func super_kick(void) {
chr_wait_animation 0 KONCOMcomb_p_p_k
slowmo 240
chr_animate 0 KONCOMsuper_kick
sleep 50
fork super_kick
}


func SpawnNameFlagHealthReset(string n, int f, int h, int r){
    ai2_spawn(n); chr_teleport(n, f)
    if(h) chr_set_health(n, h)
    if(r) chr_inv_reset(n)
}

func SpawnNameFlagReset(string n, int f, int r){
    ai2_spawn(n); chr_teleport(n, f)
    if(r) chr_inv_reset(n)
}

func void main(void)
{
env_show 401 1
env_shade 401 913 .2 .4 .2
env_show 402 1
env_shade 401 913 .2 .1 .3
env_show 403 1
env_shade 401 913 .3 .1 .3
env_show 404 1
env_shade 401 913 .3 .2 .1
env_show 405 1
env_shade 401 913 .1 .3 .2
env_show 406 1
env_shade 401 913 .2 .1 .4
env_show 407 1
env_shade 401 913 .1 .4 .1
env_show 408 1
env_shade 401 913 .4 .4 .1
env_show 409 1
particle dishpulse do start
particle sturm_ambient start
fork pre
gl_fog_blue=0.0
gl_fog_red=0.0
gl_fog_green=0.0
gl_fog_start=.989
gs_farclipplane_set 5000

dmsg "Zaraz zacznie sie mlucka kolo hangarow."

chr_inv_reset 0
chr_teleport 0 22
chr_set_health 200
dmsg " Walcz z Syndykatem. "

sleep 70
chr_giveweapon 0 w3_phr
chr_givepowerup 0 ammo 1
chr_givepowerup 0 cell 1
chr_givepowerup 0 shield 60

my_save_point = save_point;

    if (my_save_point eq 0)
    {
        fork wave1
    }

    if (my_save_point eq 1)
    {
        save_point=1;    
        fork wave2
    }

    if (my_save_point eq 2)
    {
    
        save_point=2;
        fork wave3
    }

    if (my_save_point eq 3)
    {
    
        save_point=3;
        fork wave4
    }

    if (my_save_point eq 4)
    {

    }
}



func void wave1(void){

dmsg " Pomoga ci w tym agenci TCTF. "
sleep 200
dmsg "[r. Druzyna Pyrpeciarza.]" 

SpawnNameFlagHealthReset GrifOps01 23
SpawnNameFlagReset F_C62 22
SpawnNameFlagHealthReset shooter_dummy 22 30 1
SpawnNameFlagReset A_E5b 22 1
chr_givepowerup 0 shield 60
chr_givepowerup  GrifOps01 shield 110
chr_wait_health A_E5b 0
dmsg "[g. Pyrpeciarz zabity.]"
chr_wait_health shooter_dummy 0
chr_wait_health F_C62 0
dmsg "[r. Druzyna Mlyna .]"

SpawnNameFlagHealthReset ParkStriker 22
SpawnNameFlagHealthReset A_Sb8 22
SpawnNameFlagHealthReset C_Sr18 22
chr_set_health GrifOps01 90
chr_wait_health C_Sr18 0
dmsg "[g. Mlynek Zabity.]"
chr_wait_health A_Sb8 0
chr_wait_health ParkStriker  0
sleep 400
dmsg "[r. Druzyna Krowy.]"

SpawnNameFlagHealthReset C_Sr19 22
SpawnNameFlagHealthReset C_Eb22 22
SpawnNameFlagHealthReset C_Sb26 22
SpawnNameFlagHealthReset C_Eb21 22
chr_set_health GrifOps01 90
ai2_attack C_Eb21 0
chr_wait_health C_Eb21 0
chr_wait_health C_Eb22 0
chr_wait_health C_Sb26 0
chr_wait_health C_Sr19 0
sleep 200

endgame
}


func void wave2(void){
dmsg "[r. Uwaga!!! Snajper.]"
sleep 100
SpawnNameFlagHealthReset A_S1 24
chr_givepowerup 0 shield 50
chr_givepowerup GrifOps01 shield 50
chr_set_health GrifOps01 90
sleep 600

SpawnNameFlagHealthReset C_Sb78 22
SpawnNameFlagHealthReset C_Sb76 22
SpawnNameFlagHealthReset target_dummy 22
chr_set_health target_dummy 45
ai2_attack A_S1 0
chr_givepowerup GrifOps01 cell 3
chr_wait_health A_S1 0
dmsg "[g. Snajper unieszkodliwiony.]"
chr_wait_health C_Sb76  0
chr_wait_health C_Eb22 0
chr_wait_health target_dummy 0
sleep 100
dmsg "[g. Pomoc z kwatery glownej.]"

SpawnNameFlagHealthReset GrifOps02 23
chr_giveweapon GrifOps02  w3_phr
chr_set_health GrifOps02 120 
chr_set_health GrifOps01 90
chr_givepowerup GrifOps02 ammo 1
chr_givepowerup GrifOps01 cell 1
chr_givepowerup GrifOps02 cell 1
chr_givepowerup GrifOps01 ammo 2
dmsg "Wiedz, ze ten agent TCTF ma wszczepiony eksperymentalny Crystalis i jego pasek zycia jest o 1/3 wiekszy niz zwykle."
sleep 88
dmsg "Agenci maja apteczki ktorych uzywaja po kazdej walce"
sleep 100 
dmsg "[r. Kobitki atakuja]"
SpawnNameFlagReset GrifElite03 22 1
SpawnNameFlagHealthReset GrifElite02 22
SpawnNameFlagReset D_R31 22 1
SpawnNameFlagReset D_R33 22 1
SpawnNameFlagHealthReset F_R61 22

dmsg "[g. Burdelmama nie zyje.]"
chr_wait_health GrifElite02 
chr_wait_health D_R31 0
chr_wait_health D_R33 0
chr_wait_health F_R61 0

endgame
}

func void wave3(void){

sleep 800
dmsg "[r. Nindza z Pincza.]"
SpawnNameFlagReset C_Tr28 22 1
SpawnNameFlagReset E_Nr36 22 1
SpawnNameFlagReset E_Nb38 22 1
SpawnNameFlagReset E_Tr40 22 1
SpawnNameFlagReset E_Nr39 22 1
SpawnNameFlagReset GrifElite06 23 1
chr_givepowerup GrifOps02 ammo 1
chr_givepowerup GrifOps01 cell 1
chr_givepowerup GrifOps02 cell 1
chr_givepowerup GrifOps01 ammo 2

chr_teleport GrifElite06 22

chr_set_health GrifOps01 90
chr_set_health GrifOps02 120
chr_giveweapon GrifOps02 w1_tap 
chr_giveweapon GrifOps01 w2_sap
chr_wait_health C_Tr28 0
chr_wait_health E_Nr36 0
chr_wait_health E_Nb38 0
chr_wait_health E_Tr40 


sleep 900
   
dmsg "[r. Uwaga!!! Snajper.]"
SpawnNameFlagHealthReset A_S2 24
chr_set_health GrifOps02 120
chr_set_health GrifOps01 90
chr_wait_health A_S2 0
dmsg "[g. Snajper unieszkodliwiony.]"
sleep 600

SpawnNameFlagHealthReset A_E5 22
SpawnNameFlagHealthReset B_Eb11 22
SpawnNameFlagHealthReset B_Esb15 22
SpawnNameFlagHealthReset E_Eb35 22
SpawnNameFlagHealthReset GrifElite01 22
chr_wait_health GrifElite01 0
dmsg "[g. Mucka padla na ziemie.]"
chr_wait_health A_E5 0
chr_wait_health B_Eb11 0
chr_wait_health B_Esb15 0
chr_wait_health E_Eb35 0
dmsg "[g. Posilki z TCTF.]"

SpawnNameFlagHealthReset GrifOps03 23 150
chr_giveweapon GrifOps03 w3_phr 
chr_giveweapon GrifOps02 w1_tap 
chr_giveweapon GrifOps01 w2_sap
chr_set_health GrifOps02 120
chr_set_health GrifOps01 90
chr_givepowerup GrifOps01 cell 3
chr_givepowerup GrifOps02 cell 2
chr_givepowerup GrifOps03 cell 1
chr_givepowerup GrifOps01 ammo 3
chr_givepowerup GrifOps02 ammo 2 
chr_givepowerup GrifOps03 ammo 1
chr_givepowerup GrifOps01 shield 200
chr_givepowerup GrifOps02 shield 80
chr_givepowerup GrifOps03 shield 40

endgame
}

func void wave4(void){

dmsg "[g. Udalo sie.]"
sleep 300

dmsg "[r. Mieszanka Krakowska atakuje.]"
SpawnNameFlagHealthReset A_E3
ai2_spawn A_E4
SpawnNameFlagHealthReset A_Sb7 22
SpawnNameFlagHealthReset C_Sr17 22
SpawnNameFlagHealthReset F_Nr60 22
SpawnNameFlagHealthReset E_R46 22
SpawnNameFlagHealthReset E_Nr46 22
chr_teleport A_E3 22
chr_teleport A_E4 22
chr_teleport C_Sr17 22
chr_wait_health A_E4  0
dmsg "[g. Cukierek wypadl z papierka.]"
chr_wait_health A_E3 0
chr_wait_health A_Sb7 0
chr_wait_health C_Sr17 0
chr_wait_health F_Nr60 0
chr_wait_health E_R46 0
chr_wait_health E_Nr46 0

sleep 900
dmsg "[r. Ulemniacy nadchodza.]"

chr_set_health GrifOps03 150
chr_set_health GrifOps02 120
chr_set_health GrifOps01 90

SpawnNameFlagReset new_2 22 1
SpawnNameFlagHealthReset F_Er89 22 80 1
SpawnNameFlagHealthReset F_Nr87 22 55 1
SpawnNameFlagHealthReset C_Sb77 22 50 1
SpawnNameFlagHealthReset C_Sb75 22 60 1
SpawnNameFlagHealthReset F_Eb47 22 40 1
SpawnNameFlagHealthReset A_E3b 22 50 1
SpawnNameFlagHealthReset E_Nb37 22 30 1
SpawnNameFlagHealthReset C_Eb30 22 79 1
SpawnNameFlagHealthReset B_N1 22 55 1

chr_changeteam B_N1 Syndicate
chr_wait_health new_2 0
chr_wait_health F_Nr87 0
chr_wait_health F_Er89 0
chr_wait_health C_Sb77 0
chr_wait_health C_Sb75 0
chr_wait_health  F_Eb47 0
chr_wait_health  A_E3b 0
chr_wait_health E_Nb37 0
chr_wait_health C_Eb30 0
#chr_wait_health B_N1 1
chr_wait_health B_N1 0
dmsg "[g. Griffin przybywa.]"

SpawnNameFlagHealthReset Griffin 23 600
chr_set_health GrifOps03 150
chr_set_health GrifOps02 120
chr_set_health GrifOps01 90
sleep 300
dmsg "[r. Muro!!!.]"
SpawnNameFlagHealthReset Muro 22 2500
chr_wait_health Muro 0
sleep 100
dmsg "[g. Udalo sie.]"

chr_set_health GrifOps03 150
chr_set_health GrifOps02 120
chr_set_health GrifOps01 90
chr_set_health Griffin 600
sleep 300
dmsg "[g. Zwyciestwo.]"
sleep 100
dmsg "[g. Narka.]

endgame
}





########################

func void you_lose(string ai_name)
{
    sleep 240
    fade_out 0 0 0 180 
    sleep 240
    lose
}


########################



func void endgame(string ai_name)
{
    sleep f120
    chr_animate 0 KONOKOendpowerup
    sleep f120
    cm_interpolate EndCam 600
    sleep f500
    fade_out 0 0 0 120
    sleep f120
    win
}

########################



#snow for the airfield
func void snow1_start(string ai_name)
{
    dprint snow1_start
    particle snow1 start
}

func void snow2_start(string ai_name)
{
    dprint snow2_start
    particle snow2 start
}

func void snow3_start(string ai_name)
{
    dprint snow3_start
    particle snow3 start
}

Update:
Code is improved more or less now, including geyser's code tip.
(PS: (re-)added things: snowfall, the daodan blast is working - theres was a _ in it, and super attacks have a slowmo event..)

Last edited by paradox-01 (16/6/07 18:29)

Offline

#13 16/6/07 18:53

geyser
Member
From: beyond the veil
Registered: 14/1/07
Website

Re: I made scripted mod...

@ paradox: "my_save_point" is a hack used by Bungie's scripters because they didn't know how to script smile
Does my "Jesus" script work for you? It should. And it doesn't use "my_save_point" at all. So there.
The one thing wrong with your version is that you only get to play one wave at a time. Why is that?
I mean, shouldn't one proceed to wave 2 when one is done with wave 1, and so on?

@ Tantir:

I know, in my file is very big masc,  but  it working and I`m happy.

What's a "very big masc"? Do you mean "mess"?
It's good if you're happy, but if you learn how to make "clean" scripts, you'll be even happier.
If you have some good habits, you will spend much less time later debugging new situations.

Thanks, when i trying add savepoints (i don`t copy "restore level") I  add extra "}"

No, I don't think you added an extra "}"... See the missing "}" at the end of "func begin"? I think it's the same "}" smile

No, because if someone play and "Druzyna Krowy" kill TCTF trooper,  after open savepoint TCTF trooper has resurrect.

That's true, but what if enemies don't kill any TCTF troops, and you don't respawn them? Same problem, right?
When a user loads a savepoint, you must "know" (or "choose") how well the player has played so far; how many teammates the player has managed to protect.
If you want to "choose", then you can use the difficulty setting (if(difficulty() eq 0) SpawnAllFriendsSoFar()), or another global variable no one cares about.

For example, if you want, you can keep the number of teammates still alive in ai2_debug_localmove_lines (it's an int that no one really needs, usually).
If you're smart about it, you can use one int to store a lot of information (whether the first TCTF guy has died or not, whether the second one has died or not, etc).
You can also use global booleans like ai2_barabbas_run, ai2_boss_battle, ai2_chump_stop, and some of the ai2_show... variables.
However, the information you store in these variables will only last until the player exits Oni. The next time Oni starts, those variables will be reset.

The only way to actually "save" the current status of your team it to "encode" it into persistent variables: either Konoko's inventory, or Konoko's position, or the "did we kill Griffin?" flag.
There are two "flags" you can set in Konoko's inventory:
First, you can give her an "lsi" item when a teammate dies, and then check on it with chr_has_lsi(0).
Second, you can make sure she holds an empty weapon (and has no ammo) when the game is saved (and check on that with chr_has_empty_weapon(0)).
And of course you can set whether or not Konoko killed Griffin, and check on that. That means you can permanently save the alive/dead status of three characters.

The first and third hacks above are easy. The second is harder, and maybe not feasible in a satisfactory way.
There are other ways to "remember" things through Konoko's character, but they would be even weirder.


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#14 17/6/07 5:18

Tantir
Member
From: Cracow
Registered: 10/6/07

Re: I made scripted mod...

Good work paradox-01.
How "give her an "lsi" item when a teammate dies" ???

Offline

#15 17/6/07 6:32

geyser
Member
From: beyond the veil
Registered: 14/1/07
Website

Re: I made scripted mod...

Well, something like: chr_wait_health(GrifOps01, 0); chr_givepowerup(0, lsi); in a separate fork.
And then, when you load the savepoint, you'd do: if(!chr_has_lsi(0)) ai2_spawn(GrifOps01); etc.


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#16 17/6/07 7:02

paradox-01
Member
From: Germany
Registered: 14/1/07

Re: I made scripted mod...

Stuff I tried without success (old try marked as comment #) - HUD doesn't changed:

func void wave1(void){
    fork dead
    ...
}

func void dead(void) {
    # chr_wait_health GrifOps01 0
    # chr_has_lsi() eq 1;
    # or # chr_has_lsi = 1;
chr_wait_health(GrifOps01, 0); chr_givepowerup(0, lsi);
}

.. also with these two deactivated "chr_set_health GrifOps01 90" lines hmm

Last edited by paradox-01 (17/6/07 7:06)

Offline

#17 17/6/07 12:12

geyser
Member
From: beyond the veil
Registered: 14/1/07
Website

Re: I made scripted mod...

paradox, you don't make it clear what worked for you and what didn't.
If that's of any help, you're not supposed to chr_wait_health on a non-existing character.
So you have to make sure you spawn GrifOps01 before you "fork dead"...

I recommend working with MINIMAL code when debugging new stuff.
Get rid of everything you can. Make it work in a simple case first.
For example, here's a very simple thing. Try it. It should work.

func main {
    if(save_point eq 0) SavePoint0
    if(save_point eq 1) SavePoint1
}

func SavePoint0 {
    chr_weapon 0 8
    chr_teleport 0 23
    SpawnNameFlagHealthReset Griffin 23 1
    fork GriffinDeathCheck
    sleep 300
    save_game 1 autosave
}

func SavePoint1 {
    restore_game
    if(!chr_has_lsi(0))
        SpawnNameFlagHealthReset Griffin 23 1
}

func SpawnNameFlagHealthReset(string n, int f, int h, int r){
    ai2_spawn(n); chr_teleport(n, f)
    if(h) chr_set_health(n, h)
    if(r) chr_inv_reset(n)
}

func GriffinDeathCheck {
    chr_wait_health Griffin 0
    chr_givepowerup 0 lsi
}

If you load SP0, you have 5 seconds to kill Griffin, then SP1 is written. If you kill Griffin, you get the truck keys.
Then, if you load SP1, the script checks on the truck keys and spawns Griffin only if you don't have them.

Good work paradox-01.

I repeat: paradox's version does not chain the waves. One can only play one wave at a time, depending on the SP one loaded. That's "odd" smile

Last edited by geyser (8/7/07 17:05)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#18 17/6/07 12:25

paradox-01
Member
From: Germany
Registered: 14/1/07

Re: I made scripted mod...

Well, "SpawnNameFlagHealthReset" worked and the changed version of "chained waves" I didn't post but will do then... (I liked the savepoints as "difficulty setters" so far.)
I will try your new advice at first.
So "fork dead" needs a spawned char, thought that "fork" wait until...^^
__________________

Update | Features: chained waves, lsi (giver function) || Update2 | lsi (reader function):Griffin will be spawned (Savepoint1) if GrifOps01 has died

var int my_save_point=0;

func pre(void) {
    # launch Oni Menu if you have it
    # fork om_core_3
fork super_kick
fork super_punch
}


func super_punch(void) {
chr_wait_animation 0 KONCOMcomb_p_p_p
slowmo 240
chr_animate 0 KONCOMsuper_punch
sleep 50
fork super_punch
}


func super_kick(void) {
chr_wait_animation 0 KONCOMcomb_p_p_k
slowmo 240
chr_animate 0 KONCOMsuper_kick
sleep 50
fork super_kick
}


func SpawnNameFlagHealthReset(string n, int f, int h, int r){
    ai2_spawn(n); chr_teleport(n, f)
    if(h) chr_set_health(n, h)
    if(r) chr_inv_reset(n)
}

func SpawnNameFlagReset(string n, int f, int r){
    ai2_spawn(n); chr_teleport(n, f)
    if(r) chr_inv_reset(n)
}

func void main(void)
{
env_show 401 1
env_shade 401 913 .2 .4 .2
env_show 402 1
env_shade 401 913 .2 .1 .3
env_show 403 1
env_shade 401 913 .3 .1 .3
env_show 404 1
env_shade 401 913 .3 .2 .1
env_show 405 1
env_shade 401 913 .1 .3 .2
env_show 406 1
env_shade 401 913 .2 .1 .4
env_show 407 1
env_shade 401 913 .1 .4 .1
env_show 408 1
env_shade 401 913 .4 .4 .1
env_show 409 1
particle dishpulse do start
particle sturm_ambient start
fork pre
gl_fog_blue=0.0
gl_fog_red=0.0
gl_fog_green=0.0
gl_fog_start=.989
gs_farclipplane_set 5000


my_save_point = save_point;

    if (my_save_point eq 0)
    {
        fork wave1
    }

    if (my_save_point eq 1) SavePoint1
    {
        save_point=1;
    restore_game
        fork wave2
    }

    if (my_save_point eq 2)
    {
    
        save_point=2;
    restore_game
        fork wave3
    }

    if (my_save_point eq 3)
    {
    
        save_point=3;
    restore_game
        fork wave4
    }

    if (my_save_point eq 4)
    {

    }
}



func SavePoint1 {
    restore_game
    if(!chr_has_lsi(0))
        SpawnNameFlagHealthReset Griffin 23 100
}


func void wave1(void){

dmsg "Zaraz zacznie sie mlucka kolo hangarow."

chr_inv_reset 0
chr_teleport 0 22
chr_set_health 200
dmsg " Walcz z Syndykatem. "

sleep 70
chr_giveweapon 0 w3_phr
chr_givepowerup 0 ammo 1
chr_givepowerup 0 cell 1
chr_givepowerup 0 shield 60


dmsg " Pomoga ci w tym agenci TCTF. "
sleep 200
dmsg "[r. Druzyna Pyrpeciarza.]" 

SpawnNameFlagHealthReset GrifOps01 23

fork dead

SpawnNameFlagReset F_C62 22
SpawnNameFlagHealthReset shooter_dummy 22 30 1
SpawnNameFlagReset A_E5b 22 1
chr_givepowerup 0 shield 60
chr_givepowerup  GrifOps01 shield 110
chr_wait_health A_E5b 0
dmsg "[g. Pyrpeciarz zabity.]"
chr_wait_health shooter_dummy 0
chr_wait_health F_C62 0
dmsg "[r. Druzyna Mlyna .]"

SpawnNameFlagHealthReset ParkStriker 22
SpawnNameFlagHealthReset A_Sb8 22
SpawnNameFlagHealthReset C_Sr18 22

chr_set_health GrifOps01 90

chr_wait_health C_Sr18 0
dmsg "[g. Mlynek Zabity.]"
chr_wait_health A_Sb8 0
chr_wait_health ParkStriker  0
sleep 400
dmsg "[r. Druzyna Krowy.]"

SpawnNameFlagHealthReset C_Sr19 22
SpawnNameFlagHealthReset C_Eb22 22
SpawnNameFlagHealthReset C_Sb26 22
SpawnNameFlagHealthReset C_Eb21 22



chr_set_health GrifOps01 90
ai2_attack C_Eb21 0
chr_wait_health C_Eb21 0
chr_wait_health C_Eb22 0
chr_wait_health C_Sb26 0
chr_wait_health C_Sr19 0
sleep 200

save_game 1 autosave
wave2
# endgame
}


func void dead(void) {
    chr_wait_health(GrifOps01, 0)
    chr_givepowerup(0, lsi)
}




func void wave2(void){
dmsg "[r. Uwaga!!! Snajper.]"
sleep 100
SpawnNameFlagHealthReset A_S1 24
chr_givepowerup 0 shield 50
chr_givepowerup GrifOps01 shield 50
chr_set_health GrifOps01 90
sleep 600

SpawnNameFlagHealthReset C_Sb78 22
SpawnNameFlagHealthReset C_Sb76 22
SpawnNameFlagHealthReset target_dummy 22
chr_set_health target_dummy 45
ai2_attack A_S1 0
chr_givepowerup GrifOps01 cell 3
chr_wait_health A_S1 0
dmsg "[g. Snajper unieszkodliwiony.]"
chr_wait_health C_Sb76  0
chr_wait_health C_Eb22 0
chr_wait_health target_dummy 0
sleep 100
dmsg "[g. Pomoc z kwatery glownej.]"

SpawnNameFlagHealthReset GrifOps02 23
chr_giveweapon GrifOps02  w3_phr
chr_set_health GrifOps02 120 
chr_set_health GrifOps01 90
chr_givepowerup GrifOps02 ammo 1
chr_givepowerup GrifOps01 cell 1
chr_givepowerup GrifOps02 cell 1
chr_givepowerup GrifOps01 ammo 2
dmsg "Wiedz, ze ten agent TCTF ma wszczepiony eksperymentalny Crystalis i jego pasek zycia jest o 1/3 wiekszy niz zwykle."
sleep 88
dmsg "Agenci maja apteczki ktorych uzywaja po kazdej walce"
sleep 100 
dmsg "[r. Kobitki atakuja]"
SpawnNameFlagReset GrifElite03 22 1
SpawnNameFlagHealthReset GrifElite02 22
SpawnNameFlagReset D_R31 22 1
SpawnNameFlagReset D_R33 22 1
SpawnNameFlagHealthReset F_R61 22

dmsg "[g. Burdelmama nie zyje.]"
chr_wait_health GrifElite02 
chr_wait_health D_R31 0
chr_wait_health D_R33 0
chr_wait_health F_R61 0

save_game 2 autosave
wave3
# endgame
}

func void wave3(void){

sleep 800
dmsg "[r. Nindza z Pincza.]"
SpawnNameFlagReset C_Tr28 22 1
SpawnNameFlagReset E_Nr36 22 1
SpawnNameFlagReset E_Nb38 22 1
SpawnNameFlagReset E_Tr40 22 1
SpawnNameFlagReset E_Nr39 22 1
SpawnNameFlagReset GrifElite06 23 1
chr_givepowerup GrifOps02 ammo 1
chr_givepowerup GrifOps01 cell 1
chr_givepowerup GrifOps02 cell 1
chr_givepowerup GrifOps01 ammo 2

chr_teleport GrifElite06 22

chr_set_health GrifOps01 90
chr_set_health GrifOps02 120
chr_giveweapon GrifOps02 w1_tap 
chr_giveweapon GrifOps01 w2_sap
chr_wait_health C_Tr28 0
chr_wait_health E_Nr36 0
chr_wait_health E_Nb38 0
chr_wait_health E_Tr40 


sleep 900
   
dmsg "[r. Uwaga!!! Snajper.]"
SpawnNameFlagHealthReset A_S2 24
chr_set_health GrifOps02 120
chr_set_health GrifOps01 90
chr_wait_health A_S2 0
dmsg "[g. Snajper unieszkodliwiony.]"
sleep 600

SpawnNameFlagHealthReset A_E5 22
SpawnNameFlagHealthReset B_Eb11 22
SpawnNameFlagHealthReset B_Esb15 22
SpawnNameFlagHealthReset E_Eb35 22
SpawnNameFlagHealthReset GrifElite01 22
chr_wait_health GrifElite01 0
dmsg "[g. Mucka padla na ziemie.]"
chr_wait_health A_E5 0
chr_wait_health B_Eb11 0
chr_wait_health B_Esb15 0
chr_wait_health E_Eb35 0
dmsg "[g. Posilki z TCTF.]"

SpawnNameFlagHealthReset GrifOps03 23 150
chr_giveweapon GrifOps03 w3_phr 
chr_giveweapon GrifOps02 w1_tap 
chr_giveweapon GrifOps01 w2_sap
chr_set_health GrifOps02 120
chr_set_health GrifOps01 90
chr_givepowerup GrifOps01 cell 3
chr_givepowerup GrifOps02 cell 2
chr_givepowerup GrifOps03 cell 1
chr_givepowerup GrifOps01 ammo 3
chr_givepowerup GrifOps02 ammo 2 
chr_givepowerup GrifOps03 ammo 1
chr_givepowerup GrifOps01 shield 200
chr_givepowerup GrifOps02 shield 80
chr_givepowerup GrifOps03 shield 40

save_game 3 autosave
wave4
# endgame
}

func void wave4(void){

dmsg "[g. Udalo sie.]"
sleep 300

dmsg "[r. Mieszanka Krakowska atakuje.]"
SpawnNameFlagHealthReset A_E3
ai2_spawn A_E4
SpawnNameFlagHealthReset A_Sb7 22
SpawnNameFlagHealthReset C_Sr17 22
SpawnNameFlagHealthReset F_Nr60 22
SpawnNameFlagHealthReset E_R46 22
SpawnNameFlagHealthReset E_Nr46 22
chr_teleport A_E3 22
chr_teleport A_E4 22
chr_teleport C_Sr17 22
chr_wait_health A_E4  0
dmsg "[g. Cukierek wypadl z papierka.]"
chr_wait_health A_E3 0
chr_wait_health A_Sb7 0
chr_wait_health C_Sr17 0
chr_wait_health F_Nr60 0
chr_wait_health E_R46 0
chr_wait_health E_Nr46 0

sleep 900
dmsg "[r. Ulemniacy nadchodza.]"

chr_set_health GrifOps03 150
chr_set_health GrifOps02 120
chr_set_health GrifOps01 90

SpawnNameFlagReset new_2 22 1
SpawnNameFlagHealthReset F_Er89 22 80 1
SpawnNameFlagHealthReset F_Nr87 22 55 1
SpawnNameFlagHealthReset C_Sb77 22 50 1
SpawnNameFlagHealthReset C_Sb75 22 60 1
SpawnNameFlagHealthReset F_Eb47 22 40 1
SpawnNameFlagHealthReset A_E3b 22 50 1
SpawnNameFlagHealthReset E_Nb37 22 30 1
SpawnNameFlagHealthReset C_Eb30 22 79 1
SpawnNameFlagHealthReset B_N1 22 55 1

chr_changeteam B_N1 Syndicate
chr_wait_health new_2 0
chr_wait_health F_Nr87 0
chr_wait_health F_Er89 0
chr_wait_health C_Sb77 0
chr_wait_health C_Sb75 0
chr_wait_health  F_Eb47 0
chr_wait_health  A_E3b 0
chr_wait_health E_Nb37 0
chr_wait_health C_Eb30 0
#chr_wait_health B_N1 1
chr_wait_health B_N1 0
dmsg "[g. Griffin przybywa.]"

SpawnNameFlagHealthReset Griffin 23 600
chr_set_health GrifOps03 150
chr_set_health GrifOps02 120
chr_set_health GrifOps01 90
sleep 300
dmsg "[r. Muro!!!.]"
SpawnNameFlagHealthReset Muro 22 2500
chr_wait_health Muro 0
sleep 100
dmsg "[g. Udalo sie.]"

chr_set_health GrifOps03 150
chr_set_health GrifOps02 120
chr_set_health GrifOps01 90
chr_set_health Griffin 600
sleep 300
dmsg "[g. Zwyciestwo.]"
sleep 100
dmsg "[g. Narka.]

endgame
}





########################

func void you_lose(string ai_name)
{
    sleep 240
    fade_out 0 0 0 180 
    sleep 240
    lose
}


########################



func void endgame(string ai_name)
{
    sleep f120
    chr_animate 0 KONOKOendpowerup
    sleep f120
    cm_interpolate EndCam 600
    sleep f500
    fade_out 0 0 0 120
    sleep f120
    win
}

########################



#snow for the airfield
func void snow1_start(string ai_name)
{
    dprint snow1_start
    particle snow1 start
}

func void snow2_start(string ai_name)
{
    dprint snow2_start
    particle snow2 start
}

func void snow3_start(string ai_name)
{
    dprint snow3_start
    particle snow3 start
}

Last edited by paradox-01 (17/6/07 13:24)

Offline

#19 17/6/07 14:03

geyser
Member
From: beyond the veil
Registered: 14/1/07
Website

Re: I made scripted mod...

So "fork dead" needs a spawned char, thought that "fork" wait until...^^

"fork dead" doesn't need (or mean) anything in particular: everything depends on what's inside "func dead".
The "fork"ed thread starts running right away: it only "waits" if there's a "sleep" or a "chr_wait_..." in that thread.
And if there's a "chr_wait_..." there, then, well, it just doesn't make sense to monitor a character that doesn't exist.
When you call "chr_wait_...", Oni will try to find the character you specified.
If it finds the character, it will monitor the health. If it doesn't... guess what.

On the whole, great job upgrading Tantir's script (even if I haven't played any version yet).

Last edited by geyser (17/6/07 14:05)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#20 17/6/07 14:38

paradox-01
Member
From: Germany
Registered: 14/1/07

Re: I made scripted mod...

Hm, the script is working. But I think there's still place for improvements. (There should be a way packing together all the group-"chr_wait_health" and -"chr_givepowerup"s.)
Now it's Tantir's turn experimenting on stuff if he wants to. (Giving lsi a better use than I did, adding "did_kill_griffen" as second modifier, etc.)
Anyway, it made fun looking a bit into stuff again. Thanks to you two. smile

PS: "strange but maybe working"
What happen if Konoko fulfils some tasks? Per result we can teleport her on triggervolums and save the game (thus including her position, oh and we can give her a weapon type, and holstering 0/1). Then we load the game, she activate triggervolume that's connected to function you wrote, plus weapon and holstering.
In sum we have: sli, did_griffin_kill, triggervolumen by (not-for-playing)-start position, a weapon type, holstering, wow 5 possibilities already^^. Other question is what's easy in doing of course. (We haven't eventually a nice map that show us where're lying triggervolumes, or?) (If I talking crazy s**t again tell me^_^)

Last edited by paradox-01 (17/6/07 15:18)

Offline

#21 17/6/07 16:04

Tantir
Member
From: Cracow
Registered: 10/6/07

Re: I made scripted mod...

Ok, I add first "lsi".
GrifOps01 is respawn after load savepoints.
Tomorrow i will try add other GrifOps.
Can you tell me which commands work with triggervolumen, did_griffin_kill ,  holstering? Like:
lsi:        chr_givepowerup 0 lsi
and
            if(!chr_has_lsi(0))
            SpawnNameFlagHealthReset GrifOps01 23

var int my_save_point=0;

func pre(void) {
    # launch Oni Menu if you have it
    # fork om_core_3
fork super_kick
fork super_punch
}


func super_punch(void) {
chr_wait_animation 0 KONCOMcomb_p_p_p
slowmo 240
chr_animate 0 KONCOMsuper_punch
sleep 50
fork super_punch
}


func super_kick(void) {
chr_wait_animation 0 KONCOMcomb_p_p_k
slowmo 240
chr_animate 0 KONCOMsuper_kick
sleep 50
fork super_kick
}


func SpawnNameFlagHealthReset(string n, int f, int h, int r){
    ai2_spawn(n); chr_teleport(n, f)
    if(h) chr_set_health(n, h)
    if(r) chr_inv_reset(n)
}

func SpawnNameFlagReset(string n, int f, int r){
    ai2_spawn(n); chr_teleport(n, f)
    if(r) chr_inv_reset(n)
}

func void main(void)
{
env_show 401 1
env_shade 401 913 .2 .4 .2
env_show 402 1
env_shade 401 913 .2 .1 .3
env_show 403 1
env_shade 401 913 .3 .1 .3
env_show 404 1
env_shade 401 913 .3 .2 .1
env_show 405 1
env_shade 401 913 .1 .3 .2
env_show 406 1
env_shade 401 913 .2 .1 .4
env_show 407 1
env_shade 401 913 .1 .4 .1
env_show 408 1
env_shade 401 913 .4 .4 .1
env_show 409 1
particle dishpulse do start
particle sturm_ambient start
fork pre
gl_fog_blue=0.0
gl_fog_red=0.0
gl_fog_green=0.0
gl_fog_start=.989
gs_farclipplane_set 5000

dmsg "Zaraz zacznie sie mlucka kolo hangarow."

chr_inv_reset 0
chr_teleport 0 22
chr_set_health 200
dmsg " Walcz z Syndykatem. "

sleep 70
chr_giveweapon 0 w3_phr
chr_givepowerup 0 ammo 1
chr_givepowerup 0 cell 1

my_save_point = save_point;
restore_game
    if (my_save_point eq 0)
    {          fork wave1
    }

    if (my_save_point eq 1)
    {         save_point=1;    
       fork GrifOPS01respawn
    fork wave2
    }

    if (my_save_point eq 2)
    {
    
        save_point=2;
 fork GrifOPS01respawn
        fork wave3
    }

    if (my_save_point eq 3)
    {
    
        save_point=3;
  fork GrifOPS01respawn
        fork wave4
    }

    if (my_save_point eq 4)
    {     save_point=4
  fork GrifOPS01respawn
    fork wave5
    }
}
func GrifoPS01DeathCheck {
    chr_wait_health GrifOps01 0
    chr_givepowerup 0 lsi
}

func GrifOPS01respawn {
        if(!chr_has_lsi(0))
     SpawnNameFlagHealthReset GrifOps01 23
}


func void wave1(void){

dmsg " Pomoga ci w tym agenci TCTF. "
sleep 200
dmsg "[r. Druzyna Pyrpeciarza.]" 

SpawnNameFlagHealthReset GrifOps01 23
SpawnNameFlagReset F_C62 22
SpawnNameFlagHealthReset shooter_dummy 22 30 1
SpawnNameFlagReset A_E5b 22 1
chr_givepowerup 0 shield 60
chr_givepowerup  GrifOps01 shield 110
chr_wait_health A_E5b 0
dmsg "[g. Pyrpeciarz zabity.]"
chr_wait_health shooter_dummy 0
chr_wait_health F_C62 0
sleep 400
dmsg "[r. Druzyna Mlyna .]"

SpawnNameFlagHealthReset ParkStriker 22
SpawnNameFlagHealthReset A_Sb8 22
SpawnNameFlagHealthReset C_Sr18 22
chr_set_health GrifOps01 90
chr_wait_health C_Sr18 0
dmsg "[g. Mlynek Zabity.]"
chr_wait_health A_Sb8 0
chr_wait_health ParkStriker  0
sleep 500
dmsg "[r. Druzyna Krowy.]"

SpawnNameFlagHealthReset C_Sr19 22
SpawnNameFlagHealthReset C_Eb22 22
SpawnNameFlagHealthReset C_Sb26 22
SpawnNameFlagHealthReset C_Eb21 22
chr_set_health GrifOps01 90
ai2_attack C_Eb21 0
chr_wait_health C_Eb21 0
chr_wait_health C_Eb22 0
chr_wait_health C_Sb26 0
chr_wait_health C_Sr19 0
sleep 200
fork GrifoPS01DeathCheck
save_point= 1; save_game 1 autosave
fork wave2
}


func void wave2(void){

sleep 100
ai2_spawn A_S1
chr_teleport A_S1 24
chr_givepowerup 0 shield 50
chr_givepowerup GrifOps01 shield 50
chr_set_health GrifOps01 90
sleep 600

SpawnNameFlagHealthReset C_Sb78 22
SpawnNameFlagHealthReset C_Sb76 22
SpawnNameFlagHealthReset target_dummy 22
chr_set_health target_dummy 45
ai2_attack A_S1 0
chr_givepowerup GrifOps01 cell 3
chr_wait_health A_S1 0
dmsg "[g. Snajper unieszkodliwiony.]"
chr_wait_health C_Sb76  0
chr_wait_health C_Eb22 0
chr_wait_health target_dummy 0
sleep 100
dmsg "[g. Pomoc z kwatery glownej.]"

SpawnNameFlagHealthReset GrifOps02 23
chr_giveweapon GrifOps02  w3_phr
chr_set_health GrifOps02 120 
chr_set_health GrifOps01 90
chr_givepowerup GrifOps02 ammo 1
chr_givepowerup GrifOps01 cell 1
chr_givepowerup GrifOps02 cell 1
chr_givepowerup GrifOps01 ammo 2
dmsg "Wiedz, ze ten agent TCTF ma wszczepiony eksperymentalny Crystalis i 

jego pasek zycia jest o 1/3 wiekszy niz zwykle."
sleep 88
dmsg "Agenci maja apteczki ktorych uzywaja po kazdej walce"
sleep 100 
dmsg "[r. Kobitki atakuja]"
SpawnNameFlagReset GrifElite03 22 1
SpawnNameFlagHealthReset GrifElite02 22
SpawnNameFlagReset D_R31 22 1
SpawnNameFlagReset D_R33 22 1
SpawnNameFlagHealthReset F_R61 22

dmsg "[g. Burdelmama nie zyje.]"
chr_wait_health GrifElite02 
chr_wait_health D_R31 0
chr_wait_health D_R33 0
chr_wait_health F_R61 0
fork GrifoPS01DeathCheck
fork wave3
save_point= 2; save_game 2 autosave
}

func void wave3(void){

sleep 800
dmsg "[r. Nindza z Pincza.]"
SpawnNameFlagReset C_Tr28 22 1
SpawnNameFlagReset E_Nr36 22 1
SpawnNameFlagReset E_Nb38 22 1
SpawnNameFlagReset E_Tr40 22 1
SpawnNameFlagReset E_Nr39 22 1
SpawnNameFlagReset GrifElite06 23 1
chr_givepowerup GrifOps02 ammo 1
chr_givepowerup GrifOps01 cell 1
chr_givepowerup GrifOps02 cell 1
chr_givepowerup GrifOps01 ammo 2

chr_teleport GrifElite06 22

chr_set_health GrifOps01 90
chr_set_health GrifOps02 120
chr_giveweapon GrifOps02 w1_tap 
chr_giveweapon GrifOps01 w2_sap
chr_wait_health C_Tr28 0
chr_wait_health E_Nr36 0
chr_wait_health E_Nb38 0
chr_wait_health E_Tr40 


sleep 900
   
dmsg "[r. Uwaga!!! Snajper.]"
SpawnNameFlagHealthReset A_S2 24
chr_set_health GrifOps02 120
chr_set_health GrifOps01 90
chr_wait_health A_S2 0
dmsg "[g. Snajper unieszkodliwiony.]"
sleep 600

SpawnNameFlagHealthReset A_E5 22
SpawnNameFlagHealthReset B_Eb11 22
SpawnNameFlagHealthReset B_Esb15 22
SpawnNameFlagHealthReset E_Eb35 22
SpawnNameFlagHealthReset GrifElite01 22
chr_wait_health GrifElite01 0
dmsg "[g. Mucka padla na ziemie.]"
chr_wait_health A_E5 0
chr_wait_health B_Eb11 0
chr_wait_health B_Esb15 0
chr_wait_health E_Eb35 0
dmsg "[g. Posilki z TCTF.]"

SpawnNameFlagHealthReset GrifOps03 23 150
chr_giveweapon GrifOps03 w3_phr 
chr_giveweapon GrifOps02 w1_tap 
chr_giveweapon GrifOps01 w2_sap
chr_set_health GrifOps02 120
chr_set_health GrifOps01 90
chr_givepowerup GrifOps01 cell 3
chr_givepowerup GrifOps02 cell 2
chr_givepowerup GrifOps03 cell 1
chr_givepowerup GrifOps01 ammo 3
chr_givepowerup GrifOps02 ammo 2 
chr_givepowerup GrifOps03 ammo 1
chr_givepowerup GrifOps01 shield 200
chr_givepowerup GrifOps02 shield 80
chr_givepowerup GrifOps03 shield 40
fork GrifoPS01DeathCheck
fork wave4
save_point= 3; save_game 3 autosave
}

func void wave4(void){

dmsg "[g. Udalo sie.]"
sleep 300

dmsg "[r. Mieszanka Krakowska atakuje.]"
SpawnNameFlagHealthReset A_E3
ai2_spawn A_E4
SpawnNameFlagHealthReset A_Sb7 22
SpawnNameFlagHealthReset C_Sr17 22
SpawnNameFlagHealthReset F_Nr60 22
SpawnNameFlagHealthReset E_R46 22
SpawnNameFlagHealthReset E_Nr46 22
chr_teleport A_E3 22
chr_teleport A_E4 22
chr_teleport C_Sr17 22
chr_wait_health A_E4  0
dmsg "[g. Cukierek wypadl z papierka.]"
chr_wait_health A_E3 0
chr_wait_health A_Sb7 0
chr_wait_health C_Sr17 0
chr_wait_health F_Nr60 0
chr_wait_health E_R46 0
chr_wait_health E_Nr46 0

sleep 900
dmsg "[r. Ulemniacy nadchodza.]"

chr_set_health GrifOps03 150
chr_set_health GrifOps02 120
chr_set_health GrifOps01 90

SpawnNameFlagReset new_2 22 1
SpawnNameFlagHealthReset F_Er89 22 80 1
SpawnNameFlagHealthReset F_Nr87 22 55 1
SpawnNameFlagHealthReset C_Sb77 22 50 1
SpawnNameFlagHealthReset C_Sb75 22 60 1
SpawnNameFlagHealthReset F_Eb47 22 40 1
SpawnNameFlagHealthReset A_E3b 22 50 1
SpawnNameFlagHealthReset E_Nb37 22 30 1
SpawnNameFlagHealthReset C_Eb30 22 79 1
SpawnNameFlagHealthReset B_N1 22 55 1

chr_changeteam B_N1 Syndicate
chr_wait_health new_2 0
chr_wait_health F_Nr87 0
chr_wait_health F_Er89 0
chr_wait_health C_Sb77 0
chr_wait_health C_Sb75 0
chr_wait_health  F_Eb47 0
chr_wait_health  A_E3b 0
chr_wait_health E_Nb37 0
chr_wait_health C_Eb30 0
#chr_wait_health B_N1 1
chr_wait_health B_N1 0
dmsg "[g. Griffin przybywa.]"

SpawnNameFlagHealthReset Griffin 23 600
chr_set_health GrifOps03 150
chr_set_health GrifOps02 120
chr_set_health GrifOps01 90
sleep 300
fork GrifoPS01DeathCheck
fork wave5
save_point= 4; save_game 4 autosave
}
func void wave5(void){
dmsg "[r. Muro!!!.]"
SpawnNameFlagHealthReset Muro 22 2500
chr_wait_health Muro 0
sleep 100
dmsg "[g. Udalo sie.]"

chr_set_health GrifOps03 150
chr_set_health GrifOps02 120
chr_set_health GrifOps01 90
chr_set_health Griffin 600
sleep 300
dmsg "[g. Zwyciestwo.]"
sleep 100
dmsg "[g. Narka.]

endgame
}





########################

func void you_lose(string ai_name)
{
    sleep 240
    fade_out 0 0 0 180 
    sleep 240
    lose
}


########################



func void endgame(string ai_name)
{
    sleep f120
    chr_animate 0 KONOKOendpowerup
    sleep f120
    cm_interpolate EndCam 600
    sleep f500
    fade_out 0 0 0 120
    sleep f120
    win
}

########################



#snow for the airfield
func void snow1_start(string ai_name)
{
    dprint snow1_start
    particle snow1 start
}

func void snow2_start(string ai_name)
{
    dprint snow2_start
    particle snow2 start
}

func void snow3_start(string ai_name)
{
    dprint snow3_start
    particle snow3 start
}

Offline

#22 17/6/07 17:26

geyser
Member
From: beyond the veil
Registered: 14/1/07
Website

Re: I made scripted mod...

paradox is talking crazy s**t again: there's no way to detect the holstered/drawn state or the type of the player's weapon EDIT: that's half wrong wink
The only thing you can use in a check (after loading a savepoint) is: chr_has_empty_weapon(0). And as I told you, that's not convenient.
The problem is not at check-time, but at save-time: how do you force the player to be holding an empty weapon?
Not as easy as chr_givepowerup 0 lsi. For one thing, an "empty weapon" means: no ammo inside the gun and no spare clips for it.

It's easy to ensure that the player is not holding an empty weapon (you either take the weapon away or give a new, full weapon).
It is hard, however, to ensure that the player is holding an empty weapon. Here's the easiest and least weird scheme.

You take all ammo away (chr_inv_reset), then you give a weapon, and then you force the player to fire all the ammo smile
1) You can only do that if the level includes a FILM file with a "fire" event. In compound, there is such a FILM, but you have to look it up.
2) Unless you speed up the gameplay, all that weird stuff happening will annoy the player (Konoko getting a new gun and firing it? WTF?)
3) It will be annoying anyway because all the inventory and weapon status will have been cleared just before the game is saved...

paradox also was inaccurate with the"did we kill Griffin?" stuff. There are two functions for two different purposes:
bool did_kill_griffen(void) returns true=1 if the (nameless) variable "we killed Griffin" is set and false=0 otherwise.
void killed_griffen(bool) sets the (nameless) variable "we killed Griffin" to the same value as its argument.
It's easy to see an example of how they are used. Just read teh original scripts for Chapters 13 and 14.

As for trigger volumes, paradox is correct: they will work, but there's a reason why I didn't suggest that solution.
Point is, it's such a f##ked-up idea to use TVs (even if they have "unlimited" potential) that you deserve to figure it out by yourself wink
To figure it out by yourself and to explain to Tantir, of course tongue  As for me, I'm quite happy with Oni's "short memory"...

In case you're interested, there's a reliable and level-independent way to encode "any" amount of information in a savepoint.
What you want to ask yourself is: what information is stored in a savepoint? Position, rotation, inventory, health. That's all.
Then you want to ask yourself: how much information can I store in those fields and how can I retrieve it?
Also, if you store information in any of those fields, you obviously can't use that field for what it's meant for. No miracle here: you'll have to sacrifice something.
Thus, if you set Konoko's position to something "meaningful", then you'll lose the information on her "current" position at the moment when the savepoint is reached.
Same thing if you change her inventory so that it means something special: you will lose the information of what the actual inventory was upon reaching the savepoint.

Personally, I think the most convenient information container in a savepoint is Konoko's health, but you have to be willing to reset her health when a SP is loaded.
You have to take care of stuff like "elderrune", but mostly you can store and retrieve any information that way (hint: you'd retrieve with chr_wait_health)
You can also use Konoko's height above the ground (or complete position as paradox suggested), but that's cumbersome and level-dependent and sick.
If you are willing to reset Konoko's weapon, there's indeed a way to check rather quickly for her current "variant" (unarmed, pistol, rifle).

Last edited by geyser (18/6/07 11:14)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#23 18/6/07 10:34

paradox-01
Member
From: Germany
Registered: 14/1/07

Re: I made scripted mod...

Jip. The griffen stuff - I wrote a new reply yesterday but my system crashed.
You value at possibility my ideas and now a have to say: "good that it is clarified".
For working ideas: I ended up with scripting for a longer time cuz making to little steps forward.
If Tandir get how to establish "did_kill_griffen" I will be satisfied enough. Scripts and codes aren't my battle ground. smile
--
Something left (@ Tantir): I remember SP1 gave me a "blam" and on other SPs the player is teleported twice. It is also doing on your PC/mac?

Last edited by paradox-01 (18/6/07 10:43)

Offline

#24 18/6/07 11:12

geyser
Member
From: beyond the veil
Registered: 14/1/07
Website

Re: I made scripted mod...

You value at possibility my ideas and now a have to say: "good that it is clarified".

Er?

I remember SP1 gave me a "blam" and on other SPs the player is teleported twice.

Everything happens for a reason. Good luck and have fun wink
Your scripts should work totally the same on every PC and Mac
(at least all the versions I've seen so far are 100% portable...)

Last edited by geyser (18/6/07 11:13)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#25 18/6/07 14:51

paradox-01
Member
From: Germany
Registered: 14/1/07

Re: I made scripted mod...

Just wanted to say: you explain why some ideas don't work or why it's to hard.

Okay. I located two bugs. I think the first is caused by this "code window" in the browser - I copied a broken "dmsg"-line...
Second: Konoko is teleporting twice because the following is written out of the SP-function. It was before.

    dmsg "Zaraz zacznie sie mlucka kolo hangarow."

    chr_inv_reset 0
    chr_teleport 0 22
    chr_set_health 200
    dmsg " Walcz z Syndykatem. "
    chr_giveweapon 0 w3_phr
    chr_givepowerup 0 ammo 1
    chr_givepowerup 0 cell 1

Offline

Board footer

Powered by FluxBB