Page 1 of 1

Textures, Models and some Code

Posted: October 9th, 2011, 8:52 pm
by idunno
Hi,

I just wanted to know...

1) Is it possible to import a custom texture so that it will fit on my map without having to re-size anything? Basically, in my map one part of my building is made of 2x10 of the smallest grid sizes, so is it possible to get a texture to fit on that space exactly without changing anything? (I hope that makes sense...)

Kinda like this...
□□□□□□□□□ <-so this is one row
□□□□□□□□□ <-this is the other and each square is the smallest grid size

2) I'm having trouble with my models (again... see 'model texture'). I can import them, but I can't see the texture. I've used the same steps as I did before (I wrote them down in case) and it worked for a while, but then it suddenly stopped working. I'm not sure what's going on, but I can't see the edited texture in Wings and I'm not sure why? Any ideas or is it just that my programs are tempremental??? BTW I'm using wings 3d and sb 2.5

3) I also have a question about coding. I haven't coded anythign before, but I'm just trying to make a basic game, where the player is assigned a quest to find three lost items and then has to take them back to an altar. I followed the example on 'how to make a working quest' by daltonds1 and just wanted to make sure that this is right and where it's supposed to go... :D

Code: Select all

//Picking up items
level_trigger_1 = [
   offerring_bowl = (+ $offerring_bowl 1)
   echo "You picked up the Offerring Bowl"
]

level_trigger_1 = [
   lare = (+ $lare 1)
   echo "You picked up the Lare"
]
//End Picking Up Items


//Start Quest

level_trigger_2 = [
   showgui Quest
]

newgui Quest [
   guitext "Hello! Welcome home. Do you want to make an offerring at the Lararium?" chat
   guibar
   guibutton "Yes" "showgui Quest_Yes"
   guibutton "No" "cleargui"
]
newgui Quest_Yes [
   guitext "Great! But do you remember where it is?" chat
   guibar
   guibutton "Yes" "showgui Quest_Yes1"
   guibutton "No" "cleargui"
]
newgui Quest_Yes1 [
   guitext "Find the Lararium" chat
   guibar
   guibutton "Let's go!" "cleargui"
]

level_trigger_2 = [showgui Man]

newgui Man [
   guitext "You found the Lararium! But I can't find the Lare or the Offerring Bowl" chat
   guitext "Do you want to find the Lare and the Offerring Bowl?" chat
   guibar
   guibutton "Yes" "showgui Quest_Yes"
   guibutton "No" "cleargui"
]
newgui Quest_Yes [
   guitext "Go and find the Lare and the Offerring Bowl" chat
   guitext "Bring them back here" chat
   guibar 
   guibutton "Ok. Let's go!" cleargui"
]

level_trigger_3 = [showgui Man]

newgui Man [
   guitext "Did you find the Lare and Offerring Bowl yet?" chat
   guibar
   guibutton "Yes!" "showgui Man1"
   guibutton "No, not yet" "cleargui"
]

newgui Man1
   guitext "Great! Put them in the Lararium" chat
   guibar
   guilist [ 
      guibutton "Ok" [
         if ( > $offerring_bowl 0)
            ( > $lare 0)  [
            money = ( + $money 20) 
            offerring_bowl = ( - $offerring_bowl 1)
            lare = ( - $lare 1)
      echo "Quest Completed: You earn 20 gold and have pleased your ancestors and the gods."
         ]
        ]
]
]

//End quest
Thanks in advance,
idunno

Re: Textures, Models and some Code

Posted: October 10th, 2011, 5:02 pm
by chocolatepie33
1) that's very confusing, but you can try /vscale ## (in %).
2) it's mostly right, but you can't have triggers repeat, so if you use level_trigger_1 once, then that's it. You've used it twice at least. Same with the rest.
Also, you can't have newgui Man more than once. That confuses the engine (that's the best way to put it). An alternate solution is to use this:

Code: Select all

level_trigger_1 = [showgui npc1-1]
newgui npc1-1 [
guitext "hi"
guibar
guibutton "bye" [cleargui]
] "Man"

newgui npc1-2 [
guitext "what's up"
guibar
guibutton "not much" [cleargui]
] "Man"
That way, the engine recognizes the different dialogues and uses each one in the right way. I used to make the same mistake when I first used PAS. Adding "Man" afterwards should rename the menu to that.

Re: Textures, Models and some Code

Posted: October 10th, 2011, 5:06 pm
by arcones
CP's right. I'd mostly suggest creating an inventory so you can hold things easier and keep track of items. As far as I can tell, you don't have one.

Re: Textures, Models and some Code

Posted: October 15th, 2011, 9:48 pm
by idunno
Hi,

Sorry for the delay and thanks for your help! I'll give it a go :)

Also, how do I create an inventory? I imagine that it involves some code?

Re: Textures, Models and some Code

Posted: October 15th, 2011, 11:03 pm
by chocolatepie33
yes, it does involve code. Search fer it.

Re: Textures, Models and some Code

Posted: October 16th, 2011, 9:49 pm
by idunno
I think I've fixed it and added an inventory. Is it correct now?

Code: Select all

//Picking up items
level_trigger_1 = [
   offerring_bowl = (+ $offerring_bowl 1)
   echo "You picked up the Offerring Bowl"
   lare = (+ $lare 1)
   echo "You picked up the Lare"
]
//End Picking Up Items

newgui main [
   guilist [
   guilist [
   guibutton "Quest" "showgui quests"
   guibutton "Inventory" "showgui inventory"
   ]	
]
   guibar
   @main
]

newgui Inventory [
   guibutton "Back" "cleargui 1"
   guibar
   guitext (format "You have %1 Lare" $lare)
   guitext (format "You have %1 Offerring Bowl" $offerringbowl)
   ]	

//Start Quest

level_trigger_2 = [
   showgui Quest
]

newgui Quest [
   guitext "Hello! Welcome home. Do you want to make an offerring at the 

Lararium?" chat
   guibar
   guibutton "Yes" "showgui Quest_Yes"
   guibutton "No" "cleargui"
]
newgui Quest_Yes [
   guitext "Great! But do you remember where it is?" chat
   guibar
   guibutton "Yes" "showgui Quest_Yes1"
   guibutton "No" "cleargui"
]
newgui Quest_Yes1 [
   guitext "Find the Lararium" chat
   guibar
   guibutton "Let's go!" "cleargui"
]

level_trigger_2 = [showgui npc1-1]

newgui npc1-1 [
   guitext "You found the Lararium! But I can't find the Lare or the Offerring 

Bowl" chat
   guitext "Do you want to find the Lare and the Offerring Bowl?" chat
   guibar
   guibutton "Yes" "showgui Quest_Yes"
   guibutton "No" "cleargui"
] "Man"
newgui Quest_Yes [
   guitext "Go and find the Lare and the Offerring Bowl" chat
   guitext "Bring them back here" chat
   guibar 
   guibutton "Ok. Let's go!" cleargui"
]

level_trigger_3 = [showgui Man]

newgui npc1-2 [
   guitext "Did you find the Lare and Offerring Bowl yet?" chat
   guibar
   guibutton "Yes!" "showgui Man1"
   guibutton "No, not yet" "cleargui"
]"Man"

newgui npc1-3
   guitext "Great! Put them in the Lararium" chat
   guibar
   guilist [ 
      guibutton "Ok" [
         if ( > $offerring_bowl 0)
            ( > $lare 0)  [
            money = ( + $money 20) 
            offerring_bowl = ( - $offerring_bowl 1)
            lare = ( - $lare 1)
      echo "Quest Completed: You earn 20 gold and have pleased your ancestors 

and the gods."
         ]"Man"
        ]
]
]

//End quest
    
With the level_trigger_1, I'm not sure if this is right.... Do I have to put both items under the same trigger or do I have to change one of them?
so it would be...

Code: Select all

//Picking up items
level_trigger_1 = [
   offerring_bowl = (+ $offerring_bowl 1)
   echo "You picked up the Offerring Bowl"
]

level_trigger_12 = [
   lare = (+ $lare 1)
   echo "You picked up the Lare"
]
//End Picking Up Items
Sorry, I'm a bit confused on how to pick up more than 1 item. I've checked out the forum, but can't find anything and I've also looked at the code for 'Village', but that's totally confused me.

But, thanks for all your help! I really appreciate it!! :)

Re: Textures, Models and some Code

Posted: October 17th, 2011, 10:45 am
by arcones
Simply put, it's different triggers for different pick-up items. Otherwise, each time you find a level trigger that's 1, you pick up both the offering bowl and the lare. I'm not quite sure that's the way you want it, so you'd want to separate those into different triggers.

That said, it also allows for longer quests :)

Re: Textures, Models and some Code

Posted: October 17th, 2011, 11:29 am
by java.x.beast
Also another thing, I dont think the people who play your game want to see "Yes1" or anything at the top of the gui. So I would suggest putting "Yes" in quotations after the end of the gui.