I'm a retard (so I ask help with stuff here)

Help regarding development/scripting, troubleshooting or just general gameplay -- anything that hasn't already been answered in the Wiki or pinned FAQs.

Moderator: Developers

User avatar
woodmouse
Monolich (Senior Member)
Monolich (Senior Member)
Posts: 4586
Joined: Wed Jul 23, 2008 3:53 pm
Location: Finland
Contact:

Re: I'm a retard (so I ask help with stuff here)

Post by woodmouse »

It still doesn't work... :(
Here's the door's script:

Code: Select all

// Make it stay open or close
IfSpawned
  KeepAction
  tmpargument = passage
  ClosePassage

//Open door and close it
IfTimeOut
  KeepAction
  tmpargument = 10
  SetTime
  tmpargument = passage + 1
  SetTargetToWhoeverIsInPassage
    IfTargetCanOpenStuff	//Only open for intelligent creatures
      OpenPassage
  Else
    tmpargument = 0
    IfContentIs			//Only close unlocked doors
      tmpargument = passage
      ClosePassage

//Magic unlock
IfOrdered
  tmpx = selforder
  tmpy = 491  // The unique code for an unlock order
  IfXIsEqualToY
    tmpargument = 3
    SendMessageNear

// Handle the animation and sound
tmpargument = passage 	// Is the passage clear?
IfPassageOpen			// 
  tmpargument = 0		  //
  IfStateIs			  // State 0 ( Closed )
    tmpargument = ACTIONMG	    //
    DoAction			    //
      tmpargument = 1		      // Open it
      SetState			      //
      tmpargument = 0		      //
      PlaySound			      //
Else
  tmpargument = 1		  //
  IfStateIs			  // State 1 ( Open )
    tmpargument = ACTIONMJ	    //
    DoAction			    //
      tmpargument = 0		      // Close it
      SetState			      //
      tmpargument = 1		      //
      PlaySound			      //

End				// Finished with this character
and the door part of passage.txt again

Code: Select all

4 Gate1:       52 30      53  31         F       T             F
5 Gate1Open:   52 31      53  32         T       T             F
6 Gate2:       35 17      36  18         F       T             F
7 Gate2Open:   35 18      36  19         T       T             F
8 Gate3:       10 4       11  5          F       T             F
9 Gate3Open:   10 5       11  6          T       T             F
Once upon a time, when unicorns roamed the earth...
bgbirdsey
{]-[0{0|307 (Developer)
{]-[0{0|307 (Developer)
Posts: 1864
Joined: Wed Jul 23, 2008 4:22 am
Location: Minnesota, USA

Re: I'm a retard (so I ask help with stuff here)

Post by bgbirdsey »

Right, so this only works for doors with buttons. Something else needs to control the opening and closing of the passage so that the command IfPassageOpen will work, and the detection passage serves no purpose.

Look in the advent starter to see how a locked door with this script works.
User avatar
woodmouse
Monolich (Senior Member)
Monolich (Senior Member)
Posts: 4586
Joined: Wed Jul 23, 2008 3:53 pm
Location: Finland
Contact:

Re: I'm a retard (so I ask help with stuff here)

Post by woodmouse »

Oh... but the doors in wizard starter and forgotten fortress open when going near them, and it's the same script... expect that I deleted the part of the script that's the locked door... and the normal unedited script doesn't work either so... :?
Once upon a time, when unicorns roamed the earth...
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Re: I'm a retard (so I ask help with stuff here)

Post by Zefz »

About the guards attacking crabs:

You can but guards and NPC's on a own team (Zippy Team for example) and put the crabs on a Insect team (players would still be Good team). Then you enable Allied between Zippy and Good, Zippy and Insect (but not Good and Insect!)
User avatar
woodmouse
Monolich (Senior Member)
Monolich (Senior Member)
Posts: 4586
Joined: Wed Jul 23, 2008 3:53 pm
Location: Finland
Contact:

Re: I'm a retard (so I ask help with stuff here)

Post by woodmouse »

Ok.

A new thing I'm seriously confused about is Man not appearing at all in the town. I even took away the random location thing just so I know for sure that I didn't screw up the coordinates, causing him to spawn outside the map... but he just isn't where he should be. Or anywhere else either. :shock: And yeah I add those useless comments there. Just because it's fun. :P

Code: Select all

//IfSpawned
//  tmpargument = rand % 3
//  SetState
//
//  tmpargument = 0
//  IfStateIs
//    tmpx = 2432
//    tmpy = 1536
//    SetXY
//    SetTargetToSelf
//    TeleportTarget
//
//  tmpargument = 1
//  IfStateIs
//    tmpx = 256
//    tmpy = 2432
//    SetXY
//    SetTargetToSelf
//    TeleportTarget
//
//  tmpargument = 2
//  IfStateIs
//    tmpx = 5888
//    tmpy = 1536
//    SetXY
//    SetTargetToSelf
//    TeleportTarget
//
//  tmpargument = 3
//  IfStateIs
//    tmpx = 6400
//    tmpy = 4096
//    SetXY
//    SetTargetToSelf
//    TeleportTarget

IfAttacked
  tmpargument = 5
  SendMessageNear
  tmpargument = 2
  PlaySound

IfKilled
  tmpargument = 45
  SetBumpHeight
  tmpargument = 3
  PlaySound
  SetTargetToWhoeverAttacked
  IfTargetIsOnSameTeam
    tmpargument = 4
    SendMessageNear
  Else
    tmpargument = 3
    SendMessageNear

IfBumped
  SetTargetToWhoeverBumped
  IfTargetIsAPlayer
    IfTargetIsOnSameTeam
      tmpargument = 0
      IfContentIs
      tmpargument = 6
      SendMessageNear
      PlaySound
      tmpargument = selfcontent + 1
      SetContent
      tmpargument = 50
      SetTime

  tmpx = selfcontent
  tmpy = 23                      //up to message 23
  IfXIsEqualToY
    tmpargument = 0
    SetContent


IfTimeOut
  SetTargetToWideEnemy		  // Look for enemies
    tmpargument = 4			  // Enter combat mode
    SetState

  //He just stays there
  IfStateIs0
    tmpx = selfx
    tmpy = selfy
    ClearWaypoints
    AddWaypoint

  //...no he doesn't move...
  IfStateIs1
    tmpx = selfx
    tmpy = selfy
    ClearWaypoints
    AddWaypoint

  //...still not moving...
  IfStateIs2
    tmpx = selfx
    tmpy = selfy
    ClearWaypoints
    AddWaypoint

  //even now, standing there.
  IfStateIs3
    tmpx = selfx
    tmpy = selfy
    ClearWaypoints
    AddWaypoint

  //GO TO COMBAT AND KICK THEIR ASSES!!! :D
  IfStateIs4
    tmpx = targetdistance
    tmpy = 150
    IfXIsLessThanY			//Close enough to attack?
      IfFacingTarget			//Facing the enemy?
        IfTargetIsOnHatedTeam		//Make sure its a enemy
          IfHoldingMeleeWeapon
            tmpargument = LATCHRIGHT
            PressLatchButton
          Else
            tmpargument = ACTIONUA
            DoAction			//Attack unarmed
    Else
      tmpx = targetx
      tmpy = targety
      tmpturn = targetturnto
      tmpdistance = 650
      Compass
      ClearWaypoints
      AddWaypoint

    //Enemy too far away?
    tmpx = targetdistance
    tmpy = 2000
    IfXIsMoreThanY
      tmpargument = 5			    //If enemy is too far, Man stops chasing...
      SetState
      tmpx = selfx
      tmpy = selfy
      ClearWaypoints
      AddWaypoint
  tmpargument = rand & 15 + 30		  //Set timer
  SetTime

  SetTargetToNearestEnemy
  tmpx = targetx
  tmpy = targety
  tmpdistance = 0-600
  tmpturn = targetturnto
  Compass
  ClearWaypoints
  AddWaypoint
  tmpargument = 75
  SetTime

  IfStateIs5
    SetTurnModeToVelocity
    tmpx = rand & 255 - 128 + selfspawnx
    tmpy = rand & 255 - 128 + selfspawny
    ClearWaypoints
    AddWaypoint

//------------------------------------------------------------------------------
End
//------------------------------------------------------------------------------
and here's the part of spawn.txt

Code: Select all

man:       NONE    42   19.0  12.0  1.0   S   10  0  0   0   0   F   F   G
  warham:  NONE    43   0.0   0.0   0.0   R   0   0  0   0   0   F   F   N
There's no errors in log.txt and there's no "SCRIPT ERROR" reading anywhere or anything, so... :? And yeah most of the script is from other stuff... :P
Once upon a time, when unicorns roamed the earth...
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Re: I'm a retard (so I ask help with stuff here)

Post by Zefz »

Try removing the entire script (use default script) and try a different slot number.
User avatar
woodmouse
Monolich (Senior Member)
Monolich (Senior Member)
Posts: 4586
Joined: Wed Jul 23, 2008 3:53 pm
Location: Finland
Contact:

Re: I'm a retard (so I ask help with stuff here)

Post by woodmouse »

With the default script he spawns just fine... :o So it's something in the script, but... :shock:

EDIT: I made an archmage-only area in the town... but it doesn't work; every non-archmage who enters the town joins evil team and everyone attacks, as well as the sound of the "non-archmage in passage" being endlessly looped... :? The passage coordinates are correct, so it's not that...

Code: Select all

IfSpawned
  tmpargument = 10
  SetTime
  tmpargument = 0
  SetState

IfTimeOut
  IfStateIs0
    SetTargetToWhoeverIsInPassage
    IfTargetIsAPlayer
      tmpargument = [AMAG]
      IfTargetHasSkillID
        DoNothing
        tmpargument = 10
        SetTime
    Else
      tmpargument = 0
      SendMessageNear
      PlayFullSound
      tmpargument = TEAME
      TargetJoinTeam

End
Once upon a time, when unicorns roamed the earth...
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Re: I'm a retard (so I ask help with stuff here)

Post by Zefz »

Your code does specify the behaviour you mention:

Code: Select all

      tmpargument = 0
      SendMessageNear
      PlayFullSound
      tmpargument = TEAME
      TargetJoinTeam
Try setting state to 1 after this has happened so it doesnt loop.
User avatar
woodmouse
Monolich (Senior Member)
Monolich (Senior Member)
Posts: 4586
Joined: Wed Jul 23, 2008 3:53 pm
Location: Finland
Contact:

Re: I'm a retard (so I ask help with stuff here)

Post by woodmouse »

I did that, haven't tested yet though, gonna test soon.

BTW: yeah this has been discussed maaaany times, but the map texture limit just kicked my donkey hard for the first time. :x Making towns is such a pain in the bass, doors, windows, etc... :P

EDIT: apparently resizing tiles to half size works fine! \o/
Once upon a time, when unicorns roamed the earth...
User avatar
bitnapper
Tome Mimic (Module Baker)
Tome Mimic (Module Baker)
Posts: 135
Joined: Fri Jan 30, 2009 3:33 pm
Location: Somewhere near the alps
Contact:

Re: I'm a retard (so I ask help with stuff here)

Post by bitnapper »

The new map editor only needs one instead of four textures for each direction of a wall.
This gives you more possibilities for textures using the four that we have :D

The downside is, that you have to build the whole map using the new map editor... :D
Two beer or not two beer... rather a malt whisky
User avatar
woodmouse
Monolich (Senior Member)
Monolich (Senior Member)
Posts: 4586
Joined: Wed Jul 23, 2008 3:53 pm
Location: Finland
Contact:

Re: I'm a retard (so I ask help with stuff here)

Post by woodmouse »

Zefz, what you said didn't work. It still loops and eventually causes Egoboo to crash. :shock:
Once upon a time, when unicorns roamed the earth...
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Re: I'm a retard (so I ask help with stuff here)

Post by Zefz »

Code: Select all

IfSpawned
  tmpargument = 10
  SetTime
  tmpargument = 0
  SetState

IfTimeOut
  IfStateIs0
    SetTargetToWhoeverIsInPassage
    IfTargetIsAPlayer
      tmpargument = [AMAG]
      IfTargetHasSkillID
        DoNothing
        tmpargument = 10
        SetTime
    Else
      tmpargument = 0
      SendMessageNear
      PlayFullSound
      tmpargument = TEAME
      TargetJoinTeam
      tmpargument = 1
      SetState

End
This will play the sound only once. It cannot do otherwise unless there is more to the script.
User avatar
woodmouse
Monolich (Senior Member)
Monolich (Senior Member)
Posts: 4586
Joined: Wed Jul 23, 2008 3:53 pm
Location: Finland
Contact:

Re: I'm a retard (so I ask help with stuff here)

Post by woodmouse »

Yeah now it doesn't loop, but it still triggers immediately when the module loads... and the only reason I could think of is that the "IfTargetIsAPlayer" wouldn't work, but... I'm not sure how or why it wouldn't. (there are peasants in the passage)
Once upon a time, when unicorns roamed the earth...
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Re: I'm a retard (so I ask help with stuff here)

Post by Zefz »

You haven't specified what passage to look in :)

tmpargument = passage
SetTargetToWhoeverIsInPassage
User avatar
woodmouse
Monolich (Senior Member)
Monolich (Senior Member)
Posts: 4586
Joined: Wed Jul 23, 2008 3:53 pm
Location: Finland
Contact:

Re: I'm a retard (so I ask help with stuff here)

Post by woodmouse »

Zefz wrote:You haven't specified what passage to look in :)

tmpargument = passage
SetTargetToWhoeverIsInPassage
:oops:

Anyway, that didn't help either, it still happens right away. :(

But after I did this, it worked:

Code: Select all

IfSpawned
  tmpargument = 10
  SetTime
  tmpargument = 2
  SetState

IfTimeOut
  IfStateIs0
    tmpargument = passage
    SetTargetToWhoeverIsInPassage
    IfTargetIsAPlayer
      tmpargument = [AMAG]
      IfTargetHasSkillID
        DoNothing
        tmpargument = 10
        SetTime
    Else
      tmpargument = 0
      SendMessageNear
      PlayFullSound
      tmpargument = TEAME
      TargetJoinTeam
      tmpargument = 1
      SetState

  IfStateIs2
    DoNothing

  IfStateIs1
    CallForHelp

End
I thought all that would be like a "default" thing to happen (DoNothing) but seems not... :P
Once upon a time, when unicorns roamed the earth...
Post Reply