Forum

> > Stranded II > Scripts > Scripting Questions
ForenübersichtStranded II-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Scripting Questions

2.429 Antworten
Seite
Zum Anfang Vorherige 1 286 87 88121 122 Nächste Zum Anfang

alt Re: Scripting Questions

neek49
User Off Offline

Zitieren
oky im making a balista and welll im just lerning script as i go so how do i get it to take an item out of my inven wehn i hit it?script pleas some one? o_Oo ya and an eeror meseg if i dont have the item
1× editiert, zuletzt 05.02.10 06:17:44

alt Re: Scripting Questions

Vectarrio
User Off Offline

Zitieren
Vibhor hat geschrieben
it really makes unit go back
but the projectile speed is the same

EDIT:It also increases speed of everything
it even increased my speed

I don't know about projectile.
But I really forgot that you are unit too
Try that:
1
2
3
4
5
6
7
8
on:keyhit|yourkeyID|{
     loop ("units"){
	if(loop_id()>1){
         	 addstate "unit",loop_id(),"speed";
       		 statevalue "unit",loop_id(),"speed",-1;
  		}
	}
}
If not, then this:
1
2
3
4
5
6
7
8
on:keyhit|yourkeyID|{
     loop ("units"){
	if(loop_id()>1){
         	 addstate "unit",loop_id(),7;
       		 statevalue "unit",loop_id(),7,0;
  		}
	}
}
Also try to change this 7 to 6, or speed value(-10 or -1) to 0.

EDIT: Yep, and if you want projectiles, maybe you can change it this loop "units" to "items".

alt Re: Scripting Questions

Vibhor
User Off Offline

Zitieren
cant i add items with units too?
going to test it now

EDIT:the first one makes unit moon walk :p
but the second one doesnt work
i have another idea that it will change behavior to stand idle
but it wont stop the movement of player
i just want to stop movement of player and units
projectile not necessary for now
can i even change behavior of units via commands in editor?

alt Re: Scripting Questions

Vectarrio
User Off Offline

Zitieren
s2 cmd ai_stay !
Put this instead of states in loop:
1
ai_stay loop_id(),1;
And when finish of time stop,
1
ai_stay loop_id(),0;
in loop of cource.
And delete the "if" thing, because it is to avoid player changes.
I don't know how to stop player.

alt major workload

Flametail
User Off Offline

Zitieren
I have notice when building maps that I cannot enter a house in maps that i make. please tell me how to edit the configs to allow me to enter a house and close the door behind me. If you find it easy or just want to do it, maybe add a key to it, so that I need a key to operate the door.

For the hard part of this post, I would like to know how to edit the configs to allow me to build a house, to build a yacht and allow said yacht to hold things.

alt Re: Scripting Questions

Vectarrio
User Off Offline

Zitieren
White house? This model is not made for "entering", you cannot. It is not a bug, and you cannot do anything, only create new model

What new command are in multiplayer? (i know only send, play3d)
1× editiert, zuletzt 05.02.10 16:46:32

alt Re: Scripting Questions

Vibhor
User Off Offline

Zitieren
Flametail hat geschrieben
I have notice when building maps that I cannot enter a house in maps that i make. please tell me how to edit the configs to allow me to enter a house and close the door behind me. If you find it easy or just want to do it, maybe add a key to it, so that I need a key to operate the door.

For the hard part of this post, I would like to know how to edit the configs to allow me to build a house, to build a yacht and allow said yacht to hold things.


House is not enterable
you have to be intelligent and use s2 cmd loadmap
as for the "hard part"
its quite easy
just study the buildings and object inf
as for the yatch
look for raft script in units

alt Re: Scripting Questions

Flametail
User Off Offline

Zitieren
Vectar666 hat geschrieben
White house? This model is not made for "entering", you cannot. It is not a bug, and you cannot do anything, only create new model


Vibhor hat geschrieben
Flametail hat geschrieben
I have notice when building maps that I cannot enter a house in maps that i make. please tell me how to edit the configs to allow me to enter a house and close the door behind me. If you find it easy or just want to do it, maybe add a key to it, so that I need a key to operate the door.

For the hard part of this post, I would like to know how to edit the configs to allow me to build a house, to build a yacht and allow said yacht to hold things.


House is not enterable
you have to be intelligent and use s2 cmd loadmap
as for the "hard part"
its quite easy
just study the buildings and object inf
as for the yatch
look for raft script in units


ok, as for the house, thats why I am asking. I would like to make the house enterable. even if its cheasy like click the door and magically you are there. There doesnt have to be anything special. I just have to be able to go inside. even if it looks bad.

vectar666: I have no idea where to even begin to create an enterable model.


EDIT: Following your hazy instructions, the player can now build a house and a yacht that holds 1M. now we just have to figure out the house.....
1× editiert, zuletzt 05.02.10 22:22:03

alt Re: Scripting Questions

Psytechnic
User Off Offline

Zitieren
Flametail hat geschrieben
I would love that


There is a much simpler way, but slightly more bloated.
Have the house with an on:use function to free the current object (with a closed door) and replace it with an identical house with an open door. It's cheesy, but it works. This does mean that you can't add objects to the house with different functions (like a cooker or something).

To do that, you could set the house object on:use to loadmap of a saved house inner. This is more complicated but more rewarding as you will be able to have various objects within the house that do various things.

alt Re: Scripting Questions

Flametail
User Off Offline

Zitieren
hmm, I will start with vectar666's idea about replacing the current house model with an enterable one, because it suits my needs. But I won't forget your second idea, in case I need/want something more.
1× editiert, zuletzt 06.02.10 17:37:46

alt Re: Scripting Questions

Vibhor
User Off Offline

Zitieren
Flametail hat geschrieben
hmm, I will start with vectar666's idea about replacing the current house model with an enterable one, because it suits my needs. But I won't forget your idea, in case I want something more.


actually psytechnic's idea is much better and easy
you just need two commands
s2 cmd savemap and s2 cmd loadmap
fix it with an event and you will get a master piece

alt Re: Scripting Questions

Vectarrio
User Off Offline

Zitieren
I meant Psytechnic's idea too. Replace with house with closed door(but it is normal inside, it will be new model), and on:use it replaces to other object or model.

alt Re: Scripting Questions

Vibhor
User Off Offline

Zitieren
Vectar666 hat geschrieben
I meant Psytechnic's idea too. Replace with house with closed door(but it is normal inside, it will be new model), and on:use it replaces to other object or model.


thats hard work
plus units wont be able to enter it

alt Re: Scripting Questions

Vibhor
User Off Offline

Zitieren
Vectar666 hat geschrieben
It replaces to open door
It is not hard work
1
2
3
on:use{
model "gfx\house.b3d"
}


i was talking about model
but since i dont get to do anything i am okay with everything

alt Re: Scripting Questions

Flametail
User Off Offline

Zitieren
ok, another long post as I piece together what you are trying to do.

You want to replace the current model of the house with one that includes an interior, and have a second copy of that model but with an open door.

These new models will be scripted to function like a gate does. On use it switches the current model to the one with the open door and vice versa.

Pretty much, players uses the door by pressing {usekey}, the model of closed door house is replaced with model of open door house. Player enters the house via open door. Player can then turn around and hit {usekey} and the model of open door house is switched with closed door house, therebye shutting the player in the house.



NOTE: {usekey} is the key you press to use items, which for me is rightshift, but I forgot the defualt so I put {usekey} in the desription

alt Re: Scripting Questions

Flametail
User Off Offline

Zitieren
ok, just wanted to be sure.

(on a sidenote: I've come to notice, if not on level terrain, the terrain usually juts up into a building, like with a hut. becuase of this, it seems advisable not to add flooring to the new models. If flooring is added, the terrain would just come through the floor anyway. Besides, if there is no floor, I can build torches and other objects inside the house.
Zum Anfang Vorherige 1 286 87 88121 122 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtStranded II-ÜbersichtForenübersicht