Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Can anyone help me out!

11 years ago

Ok I am having scripting issues!

What I need to know is this, my enemy that I have put in my game has 35 LIFE, if I wanted to make it so that he dies at 0, what would I need to script and would I script in the item script or the page script????

Can anyone help me out!

11 years ago

You would have to write a script that sends the user to a certain page when the LIFE variable hits 0. This page would tell the reader that the enemy has died. You would put this in the link script, as it has to with your destination.

The Basic, Intermediate and Advanced Scripting articles should help.

Can anyone help me out!

11 years ago

He PMd me asking for help and I replied there with this:

You'd want to put it in the global link script. I haven't scripted in awhile, so I'll probably miss some easy formatting errors but you can fix those:

IF %ENEMYLIFE < 1 THEN
BEGIN
$DEST := @P99
%ENEMYLIFE := 1
END

Replace 99 with the Page ID of the page that corresponds to the page where he dies. I sent his life back to 1 so that you don't keep getting taken to that page forever.

Can anyone help me out!

11 years ago

Here’s What You Need For Each Item Script (so far)

 

IF $PAGEID = 4 THEN

BEGIN

  %LIFE1 := %LIFE1 - 1D12

  %LIFE := %LIFE - 1D10

IF %LIFE1 < 1 AND %LIFE > 0 THEN

  $DEST := @P11

IF %LIFE < 1 THEN

  $DEST := @P27

END

 

IF $PAGEID = 15 THEN

BEGIN

  %HORDE1 := %HORDE1 - 1D12

  %LIFE := %LIFE - 1D15

IF %HORDE1 < 1 AND %LIFE > 0 THEN

  $DEST := @P16

IF %LIFE < 1 THEN

  $DEST := @P27

END

 

IF $PAGEID = 18 THEN

BEGIN

  %SOLDIER1 := %SOLDIER1 - 1D12

  %LIFE := %LIFE - 1D30

IF %SOLDIER1 < 1 AND %LIFE > 0 THEN

  $DEST := @P19

IF %LIFE < 1 THEN

  $DEST := @P27

END

 

IF $PAGEID = 21 THEN

BEGIN

  %DOGPACK1 := %DOGPACK1 - 1D12

  %LIFE := %LIFE - 1D20

IF %DOGPACK1 < 1 AND %LIFE > 0 THEN

  $DEST := @P22

IF %LIFE < 1 THEN

  $DEST := @P27

END

 

Every time you add a Monster Encounter, you’ll need to add a module for it to your Item Script. Here’s the breakdown of each module:

 

IF $PAGEID = 18 THEN

BEGIN

  %SOLDIER1 := %SOLDIER1 - 1D12 {Damage the Item does when used}

  %LIFE := %LIFE - 1D30 {Damage Monster does to hero}

IF %SOLDIER1 < 1 AND %LIFE > 0 THEN

  $DEST := @P19 {Appropriate Victory Page}

IF %LIFE < 1 THEN

  $DEST := @P27 {Hero Death Page}

END

 

(KEY)

$PAGEID = 18  {Page of the Encounter itself}

%SOLDIER1  {Monster’s Heath Variable}  

%LIFE  {Hero’s Health Variable}

 

Can anyone help me out!

11 years ago

Damn it > _<

The AND code screws the above up. I'm not sure why it doesn't work, but we'll have to create a workaround or you can have both the hero and monster die and still go to the victory page...

Can anyone help me out!

11 years ago

OK, this works:

 

IF $PAGEID = 4 THEN

BEGIN

  %LIFE1 := %LIFE1 - 1D25 - 5

  %LIFE := %LIFE - 1D10

END

 

IF $PAGEID = 15 THEN

BEGIN

  %HORDE1 := %HORDE1 - 1D25 - 5

  %LIFE := %LIFE - 1D15

END

 

IF $PAGEID = 18 THEN

BEGIN

  %SOLDIER1 := %SOLDIER1 - 1D25 - 5

  %LIFE := %LIFE - 1D30

END

 

IF $PAGEID = 21 THEN

BEGIN

  %DOGPACK1 := %DOGPACK1 - 1D25 - 5

  %LIFE := %LIFE - 1D20

END

 

IF %LIFE < 1 THEN

  $DEST := @P27

IF %LIFE > 0 THEN

BEGIN

IF %LIFE1 < 1 THEN

  $DEST := @P11

IF %HORDE1 < 1 THEN

  $DEST := @P16

IF %SOLDIER1 < 1 THEN

  $DEST := @P19

IF %DOGPACK1 < 1 THEN

  $DEST := @P22

END